From 71297d35854e7763191aba12f257329554671944 Mon Sep 17 00:00:00 2001 From: Neenu1995 Date: Thu, 27 May 2021 18:27:22 -0400 Subject: [PATCH] feat: initial generation --- .github/.OwlBot.lock.yaml | 3 + .github/.OwlBot.yaml | 29 + .github/CODEOWNERS | 10 + .github/ISSUE_TEMPLATE/bug_report.md | 51 + .github/ISSUE_TEMPLATE/feature_request.md | 21 + .github/ISSUE_TEMPLATE/support_request.md | 7 + .github/PULL_REQUEST_TEMPLATE.md | 7 + .github/blunderbuss.yml | 7 + .github/generated-files-bot.yml | 12 + .github/readme/synth.py | 19 + .github/release-please.yml | 3 + .github/snippet-bot.yml | 0 .github/sync-repo-settings.yaml | 49 + .github/trusted-contribution.yml | 2 + .github/workflows/approve-readme.yaml | 54 + .github/workflows/auto-release.yaml | 88 + .github/workflows/ci.yaml | 79 + .github/workflows/samples.yaml | 14 + .gitignore | 17 + .kokoro/build.bat | 3 + .kokoro/build.sh | 125 + .kokoro/coerce_logs.sh | 38 + .kokoro/common.cfg | 13 + .kokoro/common.sh | 58 + .kokoro/continuous/common.cfg | 25 + .kokoro/continuous/java8.cfg | 12 + .kokoro/continuous/readme.cfg | 55 + .kokoro/dependencies.sh | 90 + .kokoro/nightly/common.cfg | 25 + .kokoro/nightly/integration.cfg | 37 + .kokoro/nightly/java11.cfg | 7 + .kokoro/nightly/java7.cfg | 7 + .kokoro/nightly/java8-osx.cfg | 3 + .kokoro/nightly/java8-win.cfg | 3 + .kokoro/nightly/java8.cfg | 12 + .kokoro/nightly/samples.cfg | 38 + .kokoro/populate-secrets.sh | 43 + .kokoro/presubmit/clirr.cfg | 13 + .kokoro/presubmit/common.cfg | 34 + .kokoro/presubmit/dependencies.cfg | 12 + .kokoro/presubmit/integration.cfg | 33 + .kokoro/presubmit/java11.cfg | 7 + .kokoro/presubmit/java7.cfg | 7 + .kokoro/presubmit/java8-osx.cfg | 3 + .kokoro/presubmit/java8-win.cfg | 3 + .kokoro/presubmit/java8.cfg | 12 + .kokoro/presubmit/linkage-monitor.cfg | 12 + .kokoro/presubmit/lint.cfg | 13 + .kokoro/presubmit/samples.cfg | 33 + .kokoro/readme.sh | 45 + .kokoro/release/bump_snapshot.cfg | 53 + .kokoro/release/common.cfg | 49 + .kokoro/release/common.sh | 50 + .kokoro/release/drop.cfg | 6 + .kokoro/release/drop.sh | 32 + .kokoro/release/promote.cfg | 6 + .kokoro/release/promote.sh | 34 + .kokoro/release/publish_javadoc.cfg | 23 + .kokoro/release/publish_javadoc.sh | 53 + .kokoro/release/publish_javadoc11.cfg | 30 + .kokoro/release/publish_javadoc11.sh | 67 + .kokoro/release/snapshot.cfg | 6 + .kokoro/release/snapshot.sh | 33 + .kokoro/release/stage.cfg | 19 + .kokoro/release/stage.sh | 45 + .kokoro/trampoline.sh | 26 + .repo-metadata.json | 15 + CODE_OF_CONDUCT.md | 94 + CONTRIBUTING.md | 139 + LICENSE | 201 + codecov.yaml | 4 + google-cloud-private-catalog-bom/pom.xml | 85 + google-cloud-private-catalog/pom.xml | 111 + .../v1beta1/PrivateCatalogClient.java | 734 +++ .../v1beta1/PrivateCatalogSettings.java | 221 + .../v1beta1/gapic_metadata.json | 27 + .../privatecatalog/v1beta1/package-info.java | 59 + .../GrpcPrivateCatalogCallableFactory.java | 115 + .../v1beta1/stub/GrpcPrivateCatalogStub.java | 277 ++ .../v1beta1/stub/PrivateCatalogStub.java | 73 + .../stub/PrivateCatalogStubSettings.java | 502 ++ .../v1beta1/MockPrivateCatalog.java | 59 + .../v1beta1/MockPrivateCatalogImpl.java | 123 + .../v1beta1/PrivateCatalogClientTest.java | 259 + .../pom.xml | 69 + .../v1beta1/PrivateCatalogGrpc.java | 704 +++ java.header | 15 + license-checks.xml | 10 + owlbot.py | 24 + pom.xml | 179 + .../clirr-ignored-differences.xml | 19 + .../pom.xml | 46 + .../v1beta1/AssetReference.java | 3762 +++++++++++++++ .../v1beta1/AssetReferenceOrBuilder.java | 455 ++ .../cloud/privatecatalog/v1beta1/Catalog.java | 1588 ++++++ .../privatecatalog/v1beta1/CatalogName.java | 168 + .../v1beta1/CatalogOrBuilder.java | 178 + .../privatecatalog/v1beta1/GcsSource.java | 1023 ++++ .../v1beta1/GcsSourceOrBuilder.java | 102 + .../privatecatalog/v1beta1/GitSource.java | 1613 +++++++ .../v1beta1/GitSourceOrBuilder.java | 192 + .../cloud/privatecatalog/v1beta1/Inputs.java | 734 +++ .../v1beta1/InputsOrBuilder.java | 63 + .../v1beta1/PrivateCatalogProto.java | 360 ++ .../cloud/privatecatalog/v1beta1/Product.java | 4286 +++++++++++++++++ .../privatecatalog/v1beta1/ProductName.java | 168 + .../v1beta1/ProductOrBuilder.java | 742 +++ .../v1beta1/SearchCatalogsRequest.java | 1124 +++++ .../SearchCatalogsRequestOrBuilder.java | 123 + .../v1beta1/SearchCatalogsResponse.java | 1146 +++++ .../SearchCatalogsResponseOrBuilder.java | 104 + .../v1beta1/SearchProductsRequest.java | 1138 +++++ .../SearchProductsRequestOrBuilder.java | 127 + .../v1beta1/SearchProductsResponse.java | 1146 +++++ .../SearchProductsResponseOrBuilder.java | 104 + .../v1beta1/SearchVersionsRequest.java | 1138 +++++ .../SearchVersionsRequestOrBuilder.java | 127 + .../v1beta1/SearchVersionsResponse.java | 1146 +++++ .../SearchVersionsResponseOrBuilder.java | 104 + .../cloud/privatecatalog/v1beta1/Version.java | 1712 +++++++ .../privatecatalog/v1beta1/VersionName.java | 223 + .../v1beta1/VersionOrBuilder.java | 198 + .../v1beta1/private_catalog.proto | 559 +++ renovate.json | 73 + samples/install-without-bom/pom.xml | 84 + samples/pom.xml | 56 + samples/snapshot/pom.xml | 83 + samples/snippets/pom.xml | 47 + versions.txt | 6 + 129 files changed, 31991 insertions(+) create mode 100644 .github/.OwlBot.lock.yaml create mode 100644 .github/.OwlBot.yaml create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/support_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/blunderbuss.yml create mode 100644 .github/generated-files-bot.yml create mode 100644 .github/readme/synth.py create mode 100644 .github/release-please.yml create mode 100644 .github/snippet-bot.yml create mode 100644 .github/sync-repo-settings.yaml create mode 100644 .github/trusted-contribution.yml create mode 100644 .github/workflows/approve-readme.yaml create mode 100644 .github/workflows/auto-release.yaml create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/samples.yaml create mode 100644 .gitignore create mode 100644 .kokoro/build.bat create mode 100755 .kokoro/build.sh create mode 100755 .kokoro/coerce_logs.sh create mode 100644 .kokoro/common.cfg create mode 100644 .kokoro/common.sh create mode 100644 .kokoro/continuous/common.cfg create mode 100644 .kokoro/continuous/java8.cfg create mode 100644 .kokoro/continuous/readme.cfg create mode 100755 .kokoro/dependencies.sh create mode 100644 .kokoro/nightly/common.cfg create mode 100644 .kokoro/nightly/integration.cfg create mode 100644 .kokoro/nightly/java11.cfg create mode 100644 .kokoro/nightly/java7.cfg create mode 100644 .kokoro/nightly/java8-osx.cfg create mode 100644 .kokoro/nightly/java8-win.cfg create mode 100644 .kokoro/nightly/java8.cfg create mode 100644 .kokoro/nightly/samples.cfg create mode 100755 .kokoro/populate-secrets.sh create mode 100644 .kokoro/presubmit/clirr.cfg create mode 100644 .kokoro/presubmit/common.cfg create mode 100644 .kokoro/presubmit/dependencies.cfg create mode 100644 .kokoro/presubmit/integration.cfg create mode 100644 .kokoro/presubmit/java11.cfg create mode 100644 .kokoro/presubmit/java7.cfg create mode 100644 .kokoro/presubmit/java8-osx.cfg create mode 100644 .kokoro/presubmit/java8-win.cfg create mode 100644 .kokoro/presubmit/java8.cfg create mode 100644 .kokoro/presubmit/linkage-monitor.cfg create mode 100644 .kokoro/presubmit/lint.cfg create mode 100644 .kokoro/presubmit/samples.cfg create mode 100755 .kokoro/readme.sh create mode 100644 .kokoro/release/bump_snapshot.cfg create mode 100644 .kokoro/release/common.cfg create mode 100755 .kokoro/release/common.sh create mode 100644 .kokoro/release/drop.cfg create mode 100755 .kokoro/release/drop.sh create mode 100644 .kokoro/release/promote.cfg create mode 100755 .kokoro/release/promote.sh create mode 100644 .kokoro/release/publish_javadoc.cfg create mode 100755 .kokoro/release/publish_javadoc.sh create mode 100644 .kokoro/release/publish_javadoc11.cfg create mode 100755 .kokoro/release/publish_javadoc11.sh create mode 100644 .kokoro/release/snapshot.cfg create mode 100755 .kokoro/release/snapshot.sh create mode 100644 .kokoro/release/stage.cfg create mode 100755 .kokoro/release/stage.sh create mode 100644 .kokoro/trampoline.sh create mode 100644 .repo-metadata.json create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 codecov.yaml create mode 100644 google-cloud-private-catalog-bom/pom.xml create mode 100644 google-cloud-private-catalog/pom.xml create mode 100644 google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogClient.java create mode 100644 google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogSettings.java create mode 100644 google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/gapic_metadata.json create mode 100644 google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/package-info.java create mode 100644 google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/stub/GrpcPrivateCatalogCallableFactory.java create mode 100644 google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/stub/GrpcPrivateCatalogStub.java create mode 100644 google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/stub/PrivateCatalogStub.java create mode 100644 google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/stub/PrivateCatalogStubSettings.java create mode 100644 google-cloud-private-catalog/src/test/java/com/google/cloud/privatecatalog/v1beta1/MockPrivateCatalog.java create mode 100644 google-cloud-private-catalog/src/test/java/com/google/cloud/privatecatalog/v1beta1/MockPrivateCatalogImpl.java create mode 100644 google-cloud-private-catalog/src/test/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogClientTest.java create mode 100644 grpc-google-cloud-private-catalog-v1beta1/pom.xml create mode 100644 grpc-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogGrpc.java create mode 100644 java.header create mode 100644 license-checks.xml create mode 100644 owlbot.py create mode 100644 pom.xml create mode 100644 proto-google-cloud-private-catalog-v1beta1/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-private-catalog-v1beta1/pom.xml create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/AssetReference.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/AssetReferenceOrBuilder.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Catalog.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/CatalogName.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/CatalogOrBuilder.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GcsSource.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GcsSourceOrBuilder.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GitSource.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GitSourceOrBuilder.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Inputs.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/InputsOrBuilder.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogProto.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Product.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/ProductName.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/ProductOrBuilder.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsRequest.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsRequestOrBuilder.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsResponse.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsResponseOrBuilder.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsRequest.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsRequestOrBuilder.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsResponse.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsResponseOrBuilder.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsRequest.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsRequestOrBuilder.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsResponse.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsResponseOrBuilder.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Version.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/VersionName.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/VersionOrBuilder.java create mode 100644 proto-google-cloud-private-catalog-v1beta1/src/main/proto/google/cloud/privatecatalog/v1beta1/private_catalog.proto create mode 100644 renovate.json create mode 100644 samples/install-without-bom/pom.xml create mode 100644 samples/pom.xml create mode 100644 samples/snapshot/pom.xml create mode 100644 samples/snippets/pom.xml create mode 100644 versions.txt diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml new file mode 100644 index 00000000..a32a9e04 --- /dev/null +++ b/.github/.OwlBot.lock.yaml @@ -0,0 +1,3 @@ +docker: + digest: sha256:ee698481139bf3df35cd83d2f17f9670ee914d6184f8909a81d672a6abaf0e72 + image: gcr.io/repo-automation-bots/owlbot-java:latest \ No newline at end of file diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml new file mode 100644 index 00000000..265f4112 --- /dev/null +++ b/.github/.OwlBot.yaml @@ -0,0 +1,29 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +docker: + image: "gcr.io/repo-automation-bots/owlbot-java:latest" + +deep-remove-regex: +- "/grpc-google-.*/src" +- "/proto-google-.*/src" +- "/google-.*/src" + +deep-copy-regex: +- source: "/google/cloud/privatecatalog/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-private-catalog-$1/src" +- source: "/google/cloud/privatecatalog/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-private-catalog-$1/src" +- source: "/google/cloud/privatecatalog/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-private-catalog/src" \ No newline at end of file diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..30fdb7b9 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,10 @@ +# Code owners file. +# This file controls who is tagged for review for any given pull request. + +# For syntax help see: +# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax + +* @googleapis/yoshi-java + +# The java-samples-reviewers team is the default owner for samples changes +samples/**/*.java @googleapis/java-samples-reviewers diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..5b1a7ed3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,51 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +Please run down the following list and make sure you've tried the usual "quick fixes": + + - Search the issues already opened: https://github.com/googleapis/java-private-catalog/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. private-catalog version(s): + +#### Steps to reproduce + + 1. ? + 2. ? + +#### Code example + +```java +// example +``` + +#### Stack trace +``` +Any relevant stacktrace here. +``` + +#### External references such as API reference guides + +- ? + +#### Any additional information below + + +Following these steps guarantees the quickest resolution possible. + +Thanks! diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..754e30c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +**Is your feature request related to a problem? Please describe.** +What the problem is. Example: I'm always frustrated when [...] + +**Describe the solution you'd like** +What you want to happen. + +**Describe alternatives you've considered** +Any alternative solutions or features you've considered. + +**Additional context** +Any other context or screenshots about the feature request. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 00000000..99586903 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,7 @@ +--- +name: Support request +about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. + +--- + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..70eb6580 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: +- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-private-catalog/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Ensure the tests and linter pass +- [ ] Code coverage does not decrease (if any source code was changed) +- [ ] Appropriate docs were updated (if necessary) + +Fixes # ☕️ diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml new file mode 100644 index 00000000..1a23ea42 --- /dev/null +++ b/.github/blunderbuss.yml @@ -0,0 +1,7 @@ +# Configuration for the Blunderbuss GitHub app. For more info see +# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss +assign_prs_by: +- labels: + - samples + to: + - googleapis/java-samples-reviewers \ No newline at end of file diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml new file mode 100644 index 00000000..c644a24e --- /dev/null +++ b/.github/generated-files-bot.yml @@ -0,0 +1,12 @@ +externalManifests: +- type: json + file: 'synth.metadata' + jsonpath: '$.generatedFiles[*]' +- type: json + file: '.github/readme/synth.metadata/synth.metadata' + jsonpath: '$.generatedFiles[*]' +ignoreAuthors: +- 'renovate-bot' +- 'yoshi-automation' +- 'release-please[bot]' +- 'gcf-owl-bot[bot]' diff --git a/.github/readme/synth.py b/.github/readme/synth.py new file mode 100644 index 00000000..7b48cc28 --- /dev/null +++ b/.github/readme/synth.py @@ -0,0 +1,19 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This script is used to synthesize generated the README for this library.""" + +from synthtool.languages import java + +java.custom_templates(["java_library/README.md"]) diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..8ca7f9ca --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,3 @@ +bumpMinorPreMajor: true +handleGHRelease: true +releaseType: java-yoshi diff --git a/.github/snippet-bot.yml b/.github/snippet-bot.yml new file mode 100644 index 00000000..e69de29b diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml new file mode 100644 index 00000000..e100454f --- /dev/null +++ b/.github/sync-repo-settings.yaml @@ -0,0 +1,49 @@ + +# Whether or not rebase-merging is enabled on this repository. +# Defaults to `true` +rebaseMergeAllowed: false + +# Whether or not squash-merging is enabled on this repository. +# Defaults to `true` +squashMergeAllowed: true + +# Whether or not PRs are merged with a merge commit on this repository. +# Defaults to `false` +mergeCommitAllowed: false + +# Rules for master branch protection +branchProtectionRules: +# Identifies the protection rule pattern. Name of the branch to be protected. +# Defaults to `master` +- pattern: master + # Can admins overwrite branch protection. + # Defaults to `true` + isAdminEnforced: true + # Number of approving reviews required to update matching branches. + # Defaults to `1` + requiredApprovingReviewCount: 1 + # Are reviews from code owners required to update matching branches. + # Defaults to `false` + requiresCodeOwnerReviews: true + # Require up to date branches + requiresStrictStatusChecks: false + # List of required status check contexts that must pass for commits to be accepted to matching branches. + requiredStatusCheckContexts: + - "dependencies (8)" + - "dependencies (11)" + - "linkage-monitor" + - "lint" + - "clirr" + - "units (7)" + - "units (8)" + - "units (11)" + - "Kokoro - Test: Integration" + - "cla/google" +# List of explicit permissions to add (additive only) +permissionRules: +- team: yoshi-admins + permission: admin +- team: yoshi-java-admins + permission: admin +- team: yoshi-java + permission: push diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml new file mode 100644 index 00000000..f247d5c7 --- /dev/null +++ b/.github/trusted-contribution.yml @@ -0,0 +1,2 @@ +trustedContributors: +- renovate-bot \ No newline at end of file diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml new file mode 100644 index 00000000..7513acae --- /dev/null +++ b/.github/workflows/approve-readme.yaml @@ -0,0 +1,54 @@ +on: + pull_request: +name: auto-merge-readme +jobs: + approve: + runs-on: ubuntu-latest + if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' + steps: + - uses: actions/github-script@v3 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + script: | + // only approve PRs from yoshi-automation + if (context.payload.pull_request.user.login !== "yoshi-automation") { + return; + } + + // only approve PRs like "chore: release " + if (!context.payload.pull_request.title === "chore: regenerate README") { + return; + } + + // only approve PRs with README.md and synth.metadata changes + const files = new Set( + ( + await github.paginate( + github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }) + ) + ).map(file => file.filename) + ); + if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) { + return; + } + + // approve README regeneration PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped PR!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach automerge label + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['automerge'] + }); diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml new file mode 100644 index 00000000..9b4fd4d8 --- /dev/null +++ b/.github/workflows/auto-release.yaml @@ -0,0 +1,88 @@ +on: + pull_request: +name: auto-release +jobs: + approve: + runs-on: ubuntu-latest + if: contains(github.head_ref, 'release-please') + steps: + - uses: actions/github-script@v3 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + debug: true + script: | + // only approve PRs from release-please[bot] + if (context.payload.pull_request.user.login !== "release-please[bot]") { + return; + } + + // only approve PRs like "chore: release " + if ( !context.payload.pull_request.title.startsWith("chore: release") ) { + return; + } + + // only approve PRs with pom.xml and versions.txt changes + const filesPromise = github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }); + const changed_files = await github.paginate(filesPromise) + + if ( changed_files.length < 1 ) { + console.log( "Not proceeding since PR is empty!" ) + return; + } + + if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { + console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) + return; + } + + // trigger auto-release when + // 1) it is a SNAPSHOT release (auto-generated post regular release) + // 2) there are dependency updates only + // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) + if ( + context.payload.pull_request.body.includes("Fix") || + context.payload.pull_request.body.includes("Build") || + context.payload.pull_request.body.includes("Documentation") || + context.payload.pull_request.body.includes("BREAKING CHANGES") || + context.payload.pull_request.body.includes("Features") + ) { + console.log( "Not auto-releasing since it is not a dependency-update-only release." ); + return; + } + + const promise = github.pulls.list.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + }); + const open_pulls = await github.paginate(promise) + + if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { + for ( const pull of open_pulls ) { + if ( pull.title.startsWith("deps: update dependency") ) { + console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); + return; + } + } + } + + // approve release PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped release!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach kokoro:force-run and automerge labels + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['kokoro:force-run', 'automerge'] + }); diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..0195b32f --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,79 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + strategy: + matrix: + java: [7, 8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test + dependencies: + runs-on: ubuntu-latest + strategy: + matrix: + java: [8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh + linkage-monitor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - name: Install artifacts to local Maven repository + run: .kokoro/build.sh + shell: bash + - name: Validate any conflicts with regard to com.google.cloud:libraries-bom (latest release) + uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml new file mode 100644 index 00000000..c46230a7 --- /dev/null +++ b/.github/workflows/samples.yaml @@ -0,0 +1,14 @@ +on: + pull_request: +name: samples +jobs: + checkstyle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Run checkstyle + run: mvn -P lint --quiet --batch-mode checkstyle:check + working-directory: samples/snippets diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..069d08fc --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ + +.flattened-pom.xml diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 00000000..05826ad9 --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 00000000..f50eddd5 --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,125 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Maven & Java version +mvn -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V -ntp \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +RETURN_CODE=0 +set +e + +case ${JOB_TYPE} in +test) + mvn test -B -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +lint) + mvn com.coveo:fmt-maven-plugin:check + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -ntp \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +samples) + SAMPLES_DIR=samples + # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. + if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]] + then + SAMPLES_DIR=samples/snapshot + fi + + if [[ -f ${SAMPLES_DIR}/pom.xml ]] + then + for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do + [[ -f "$FILE" ]] || continue + source "$FILE" + done + + pushd ${SAMPLES_DIR} + mvn -B \ + -Penable-samples \ + -ntp \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + popd + else + echo "no sample pom.xml found - skipping sample tests" + fi + ;; +clirr) + mvn -B -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) + ;; +esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_BUILD_COP}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot + ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-private-catalog +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh new file mode 100755 index 00000000..5cf7ba49 --- /dev/null +++ b/.kokoro/coerce_logs.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + echo "processing ${xml}" + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg new file mode 100644 index 00000000..c021fb41 --- /dev/null +++ b/.kokoro/common.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# All builds use the trampoline script to run in docker. +build_file: "java-private-catalog/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-private-catalog/.kokoro/build.sh" +} diff --git a/.kokoro/common.sh b/.kokoro/common.sh new file mode 100644 index 00000000..ace89f45 --- /dev/null +++ b/.kokoro/common.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + + # store current flag state + flags=$- + + # allow a failures to continue + set +e + ${command} + exit_code=$? + + # restore "e" flag + if [[ ${flags} =~ e ]] + then set -e + else set +e + fi + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} + +## Helper functionss +function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } +function msg() { println "$*" >&2; } +function println() { printf '%s\n' "$(now) $*"; } \ No newline at end of file diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 00000000..22519879 --- /dev/null +++ b/.kokoro/continuous/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-private-catalog/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-private-catalog/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/continuous/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/continuous/readme.cfg b/.kokoro/continuous/readme.cfg new file mode 100644 index 00000000..03029171 --- /dev/null +++ b/.kokoro/continuous/readme.cfg @@ -0,0 +1,55 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-private-catalog/.kokoro/readme.sh" +} + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.log" + } +} + +# The github token is stored here. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + # TODO(theacodes): remove this after secrets have globally propagated + backend_type: FASTCONFIGPUSH + } + } +} + +# Common env vars for all repositories and builds. +env_vars: { + key: "GITHUB_USER" + value: "yoshi-automation" +} +env_vars: { + key: "GITHUB_EMAIL" + value: "yoshi-automation@google.com" +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh new file mode 100755 index 00000000..59d2aafc --- /dev/null +++ b/.kokoro/dependencies.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# this should run maven enforcer +retry_with_backoff 3 10 \ + mvn install -B -V -ntp \ + -DskipTests=true \ + -Dmaven.javadoc.skip=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true + +echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" +## Run dependency list completeness check +function completenessCheck() { + # Output dep list with compile scope generated using the original pom + # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. + # This is stripped from the output as it is not present in the flattened pom. + # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. + msg "Generating dependency list using original pom..." + mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt + + # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) + msg "Generating dependency list using flattened pom..." + mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt + + # Compare two dependency lists + msg "Comparing dependency lists..." + diff .org-list.txt .new-list.txt >.diff.txt + if [[ $? == 0 ]] + then + msg "Success. No diff!" + else + msg "Diff found. See below: " + msg "You can also check .diff.txt file located in $1." + cat .diff.txt + return 1 + fi +} + +# Allow failures to continue running the script +set +e + +error_count=0 +for path in $(find -name ".flattened-pom.xml") +do + # Check flattened pom in each dir that contains it for completeness + dir=$(dirname "$path") + pushd "$dir" + completenessCheck "$dir" + error_count=$(($error_count + $?)) + popd +done + +if [[ $error_count == 0 ]] +then + msg "All checks passed." + exit 0 +else + msg "Errors found. See log statements above." + exit 1 +fi diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg new file mode 100644 index 00000000..22519879 --- /dev/null +++ b/.kokoro/nightly/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-private-catalog/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-private-catalog/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 00000000..0048c8ec --- /dev/null +++ b/.kokoro/nightly/integration.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/nightly/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/nightly/java7.cfg b/.kokoro/nightly/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/nightly/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/nightly/java8-osx.cfg b/.kokoro/nightly/java8-osx.cfg new file mode 100644 index 00000000..2458a526 --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-private-catalog/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..2a9d72b4 --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-private-catalog/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/nightly/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg new file mode 100644 index 00000000..f2542931 --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh new file mode 100755 index 00000000..f5251425 --- /dev/null +++ b/.kokoro/populate-secrets.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright 2020 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} +function msg { println "$*" >&2 ;} +function println { printf '%s\n' "$(now) $*" ;} + + +# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: +# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com +SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" +msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" +mkdir -p ${SECRET_LOCATION} +for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") +do + msg "Retrieving secret ${key}" + docker run --entrypoint=gcloud \ + --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ + gcr.io/google.com/cloudsdktool/cloud-sdk \ + secrets versions access latest \ + --project cloud-devrel-kokoro-resources \ + --secret ${key} > \ + "${SECRET_LOCATION}/${key}" + if [[ $? == 0 ]]; then + msg "Secret written to ${SECRET_LOCATION}/${key}" + else + msg "Error retrieving secret ${key}" + fi +done diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg new file mode 100644 index 00000000..ec572442 --- /dev/null +++ b/.kokoro/presubmit/clirr.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "clirr" +} \ No newline at end of file diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg new file mode 100644 index 00000000..541ff9c6 --- /dev/null +++ b/.kokoro/presubmit/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-private-catalog/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-private-catalog/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} diff --git a/.kokoro/presubmit/dependencies.cfg b/.kokoro/presubmit/dependencies.cfg new file mode 100644 index 00000000..8b1d4044 --- /dev/null +++ b/.kokoro/presubmit/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-private-catalog/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 00000000..dded67a9 --- /dev/null +++ b/.kokoro/presubmit/integration.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/presubmit/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/presubmit/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg new file mode 100644 index 00000000..2458a526 --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-private-catalog/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..2a9d72b4 --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-private-catalog/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/presubmit/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 00000000..fc2dac08 --- /dev/null +++ b/.kokoro/presubmit/linkage-monitor.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-private-catalog/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/presubmit/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg new file mode 100644 index 00000000..01e09600 --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} \ No newline at end of file diff --git a/.kokoro/readme.sh b/.kokoro/readme.sh new file mode 100755 index 00000000..454ec795 --- /dev/null +++ b/.kokoro/readme.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +cd ${KOKORO_ARTIFACTS_DIR}/github/java-private-catalog + +# 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-private-catalog \ + --synth-file-name=.github/readme/synth.py \ + --metadata-path=.github/readme/synth.metadata \ + --pr-title="chore: regenerate README" \ + --branch-suffix="readme" + +# autosynth returns 28 to signal there are no changes +RETURN_CODE=$? +if [[ ${RETURN_CODE} -ne 0 && ${RETURN_CODE} -ne 28 ]] +then + exit ${RETURN_CODE} +fi diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 00000000..24a1b1de --- /dev/null +++ b/.kokoro/release/bump_snapshot.cfg @@ -0,0 +1,53 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-private-catalog/.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-private-catalog/.kokoro/release/bump_snapshot.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 00000000..182ce543 --- /dev/null +++ b/.kokoro/release/common.cfg @@ -0,0 +1,49 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-private-catalog/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-keyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-passphrase" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-pubkeyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "sonatype-credentials" + } + } +} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh new file mode 100755 index 00000000..6e3f6599 --- /dev/null +++ b/.kokoro/release/common.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_settings_xml_file() { + echo " + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 +} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg new file mode 100644 index 00000000..ff980a5c --- /dev/null +++ b/.kokoro/release/drop.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-private-catalog/.kokoro/release/drop.sh" +} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh new file mode 100755 index 00000000..5c4551ef --- /dev/null +++ b/.kokoro/release/drop.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:drop -B \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg new file mode 100644 index 00000000..f5aeeb4d --- /dev/null +++ b/.kokoro/release/promote.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-private-catalog/.kokoro/release/promote.sh" +} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh new file mode 100755 index 00000000..1fa95fa5 --- /dev/null +++ b/.kokoro/release/promote.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 00000000..3e6df7ed --- /dev/null +++ b/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,23 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" + +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-private-catalog/.kokoro/release/publish_javadoc.sh" +} + + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh new file mode 100755 index 00000000..a142f0b4 --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Copyright 2019 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET}" ]]; then + echo "Need to set STAGING_BUCKET environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-private-catalog +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B -q + +pushd target/site/apidocs + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET} diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg new file mode 100644 index 00000000..2551aeed --- /dev/null +++ b/.kokoro/release/publish_javadoc11.cfg @@ -0,0 +1,30 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# cloud-rad production +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2" +} + +# Configure the docker image for kokoro-trampoline +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-private-catalog/.kokoro/release/publish_javadoc11.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh new file mode 100755 index 00000000..0f7a152c --- /dev/null +++ b/.kokoro/release/publish_javadoc11.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# Copyright 2021 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-private-catalog +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# V3 generates docfx yml from javadoc +# generate yml +mvn clean site -B -q -P docFX + +# copy README to docfx-yml dir and rename index.md +cp README.md target/docfx-yml/index.md +# copy CHANGELOG to docfx-yml dir and rename history.md +cp CHANGELOG.md target/docfx-yml/history.md + +pushd target/docfx-yml + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --xrefs devsite://java/gax \ + --xrefs devsite://java/google-cloud-core \ + --xrefs devsite://java/api-common \ + --xrefs devsite://java/proto-google-common-protos \ + --xrefs devsite://java/google-api-client \ + --xrefs devsite://java/google-http-client \ + --xrefs devsite://java/protobuf \ + --language java + +# upload yml to production bucket +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} \ + --destination-prefix docfx diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg new file mode 100644 index 00000000..b0803baf --- /dev/null +++ b/.kokoro/release/snapshot.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-private-catalog/.kokoro/release/snapshot.sh" +} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh new file mode 100755 index 00000000..1f55b770 --- /dev/null +++ b/.kokoro/release/snapshot.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +# ensure we're trying to push a snapshot (no-result returns non-zero exit code) +grep SNAPSHOT versions.txt + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg new file mode 100644 index 00000000..d534984e --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-private-catalog/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-private-catalog/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-private-catalog" + } +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh new file mode 100755 index 00000000..8a103384 --- /dev/null +++ b/.kokoro/release/stage.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Start the releasetool reporter +python3 -m pip install gcp-releasetool +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script + +source $(dirname "$0")/common.sh +source $(dirname "$0")/../common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +# attempt to stage 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn clean deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DskipTests=true \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} + +if [[ -n "${AUTORELEASE_PR}" ]] +then + mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml +fi \ No newline at end of file diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh new file mode 100644 index 00000000..9da0f839 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT + +$(dirname $0)/populate-secrets.sh # Secret Manager secrets. +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 00000000..844fde1e --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "private-catalog", + "name_pretty": "Private Catalog", + "product_documentation": "https://cloud.google.com/private-catalog/docs", + "api_description": "allows developers and cloud admins to make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions.", + "client_documentation": "https://googleapis.dev/java/google-cloud-private-catalog/latest/index.html", + "release_level": "beta", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-private-catalog", + "repo_short": "java-private-catalog", + "distribution_name": "com.google.cloud:google-cloud-private-catalog", + "api_id": "private-catalog.googleapis.com", + "requires_billing": true +} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..2add2547 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..f2dbdee0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,139 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). + +## Building the project + +To build, package, and run all unit tests run the command + +``` +mvn clean verify +``` + +### Running Integration tests + +To include integration tests when building the project, you need access to +a GCP Project with a valid service account. + +For instructions on how to generate a service account and corresponding +credentials JSON see: [Creating a Service Account][1]. + +Then run the following to build, package, run all unit tests and run all +integration tests. + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-integration-tests clean verify +``` + +## Code Samples + +Code Samples must be bundled in separate Maven modules, and guarded by a +Maven profile with the name `enable-samples`. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 7 whereas samples have + a minimum Java version of Java 8. Due to this we need the ability to + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn -Penable-samples clean verify +``` + +Some samples require access to GCP services and require a service account: + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-samples clean verify +``` + +### Profile Config + +1. To add samples in a profile to your Maven project, add the following to your +`pom.xml` + + ```xml + + [...] + + + enable-samples + + sample + + + + [...] + + ``` + +2. [Activate](#profile-activation) the profile. +3. Define your samples in a normal Maven project in the `samples/` directory. + +### Code Formatting + +Code in this repo is formatted with +[google-java-format](https://github.com/google/google-java-format). +To run formatting on your project, you can run: +``` +mvn com.coveo:fmt-maven-plugin:format +``` + +### Profile Activation + +To include code samples when building and testing the project, enable the +`enable-samples` Maven profile. + +#### Command line + +To activate the Maven profile on the command line add `-Penable-samples` to your +Maven command. + +#### Maven `settings.xml` + +To activate the Maven profile in your `~/.m2/settings.xml` add an entry of +`enable-samples` following the instructions in [Active Profiles][2]. + +This method has the benefit of applying to all projects you build (and is +respected by IntelliJ IDEA) and is recommended if you are going to be +contributing samples to several projects. + +#### IntelliJ IDEA + +To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in +[Activate Maven profiles][3] to activate `enable-samples`. + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..5724ea94 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/google-cloud-private-catalog-bom/pom.xml b/google-cloud-private-catalog-bom/pom.xml new file mode 100644 index 00000000..079a4e78 --- /dev/null +++ b/google-cloud-private-catalog-bom/pom.xml @@ -0,0 +1,85 @@ + + + 4.0.0 + com.google.cloud + google-cloud-private-catalog-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.11.0 + + + Google Private Catalog BOM + https://github.com/googleapis/java-private-catalog + + BOM for Private Catalog + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-private-catalog.git + scm:git:git@github.com:googleapis/java-private-catalog.git + https://github.com/googleapis/java-private-catalog + + + + true + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.cloud + google-cloud-private-catalog + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-private-catalog-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-private-catalog-v1beta1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + diff --git a/google-cloud-private-catalog/pom.xml b/google-cloud-private-catalog/pom.xml new file mode 100644 index 00000000..110ffe11 --- /dev/null +++ b/google-cloud-private-catalog/pom.xml @@ -0,0 +1,111 @@ + + + 4.0.0 + com.google.cloud + google-cloud-private-catalog + 0.0.1-SNAPSHOT + jar + Google Private Catalog + https://github.com/googleapis/java-private-catalog + Private Catalog allows developers and cloud admins to make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions. + + com.google.cloud + google-cloud-private-catalog-parent + 0.0.1-SNAPSHOT + + + google-cloud-private-catalog + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-private-catalog-v1beta1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + + + junit + junit + test + 4.13.2 + + + + com.google.api.grpc + grpc-google-cloud-private-catalog-v1beta1 + test + + + + com.google.api + gax-grpc + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogClient.java b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogClient.java new file mode 100644 index 00000000..cedc4b7b --- /dev/null +++ b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogClient.java @@ -0,0 +1,734 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.privatecatalog.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.privatecatalog.v1beta1.stub.PrivateCatalogStub; +import com.google.cloud.privatecatalog.v1beta1.stub.PrivateCatalogStubSettings; +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: `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` + * and `Version` resources under a target resource context. + * + *

`Catalog` is computed based on the [Association][]s linked to the target resource and its + * ancestors. Each association's [google.cloud.privatecatalogproducer.v1beta.Catalog][] is + * transformed into a `Catalog`. If multiple associations have the same parent + * [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are de-duplicated into one + * `Catalog`. Users must have `cloudprivatecatalog.catalogTargets.get` IAM permission on the + * resource context in order to access catalogs. `Catalog` contains the resource name and a subset + * of data of the original [google.cloud.privatecatalogproducer.v1beta.Catalog][]. + * + *

`Product` is child resource of the catalog. A `Product` contains the resource name and a + * subset of the data of the original [google.cloud.privatecatalogproducer.v1beta.Product][]. + * + *

`Version` is child resource of the product. A `Version` contains the resource name and a + * subset of the data of the original [google.cloud.privatecatalogproducer.v1beta.Version][]. + * + *

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

{@code
+ * try (PrivateCatalogClient privateCatalogClient = PrivateCatalogClient.create()) {
+ *   SearchCatalogsRequest request =
+ *       SearchCatalogsRequest.newBuilder()
+ *           .setResource("resource-341064690")
+ *           .setQuery("query107944136")
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .build();
+ *   for (Catalog element : privateCatalogClient.searchCatalogs(request).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * + *

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

To customize credentials: + * + *

{@code
+ * PrivateCatalogSettings privateCatalogSettings =
+ *     PrivateCatalogSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * PrivateCatalogClient privateCatalogClient = PrivateCatalogClient.create(privateCatalogSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * PrivateCatalogSettings privateCatalogSettings =
+ *     PrivateCatalogSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * PrivateCatalogClient privateCatalogClient = PrivateCatalogClient.create(privateCatalogSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class PrivateCatalogClient implements BackgroundResource { + private final PrivateCatalogSettings settings; + private final PrivateCatalogStub stub; + + /** Constructs an instance of PrivateCatalogClient with default settings. */ + public static final PrivateCatalogClient create() throws IOException { + return create(PrivateCatalogSettings.newBuilder().build()); + } + + /** + * Constructs an instance of PrivateCatalogClient, 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 PrivateCatalogClient create(PrivateCatalogSettings settings) + throws IOException { + return new PrivateCatalogClient(settings); + } + + /** + * Constructs an instance of PrivateCatalogClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(PrivateCatalogSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final PrivateCatalogClient create(PrivateCatalogStub stub) { + return new PrivateCatalogClient(stub); + } + + /** + * Constructs an instance of PrivateCatalogClient, 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 PrivateCatalogClient(PrivateCatalogSettings settings) throws IOException { + this.settings = settings; + this.stub = ((PrivateCatalogStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected PrivateCatalogClient(PrivateCatalogStub stub) { + this.settings = null; + this.stub = stub; + } + + public final PrivateCatalogSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public PrivateCatalogStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have + * access to, within the scope of the consumer cloud resource hierarchy context. + * + *

Sample code: + * + *

{@code
+   * try (PrivateCatalogClient privateCatalogClient = PrivateCatalogClient.create()) {
+   *   SearchCatalogsRequest request =
+   *       SearchCatalogsRequest.newBuilder()
+   *           .setResource("resource-341064690")
+   *           .setQuery("query107944136")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Catalog element : privateCatalogClient.searchCatalogs(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 SearchCatalogsPagedResponse searchCatalogs(SearchCatalogsRequest request) { + return searchCatalogsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have + * access to, within the scope of the consumer cloud resource hierarchy context. + * + *

Sample code: + * + *

{@code
+   * try (PrivateCatalogClient privateCatalogClient = PrivateCatalogClient.create()) {
+   *   SearchCatalogsRequest request =
+   *       SearchCatalogsRequest.newBuilder()
+   *           .setResource("resource-341064690")
+   *           .setQuery("query107944136")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       privateCatalogClient.searchCatalogsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Catalog element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchCatalogsPagedCallable() { + return stub.searchCatalogsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have + * access to, within the scope of the consumer cloud resource hierarchy context. + * + *

Sample code: + * + *

{@code
+   * try (PrivateCatalogClient privateCatalogClient = PrivateCatalogClient.create()) {
+   *   SearchCatalogsRequest request =
+   *       SearchCatalogsRequest.newBuilder()
+   *           .setResource("resource-341064690")
+   *           .setQuery("query107944136")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     SearchCatalogsResponse response =
+   *         privateCatalogClient.searchCatalogsCallable().call(request);
+   *     for (Catalog element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchCatalogsCallable() { + return stub.searchCatalogsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have + * access to, within the scope of the consumer cloud resource hierarchy context. + * + *

Sample code: + * + *

{@code
+   * try (PrivateCatalogClient privateCatalogClient = PrivateCatalogClient.create()) {
+   *   SearchProductsRequest request =
+   *       SearchProductsRequest.newBuilder()
+   *           .setResource("resource-341064690")
+   *           .setQuery("query107944136")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Product element : privateCatalogClient.searchProducts(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 SearchProductsPagedResponse searchProducts(SearchProductsRequest request) { + return searchProductsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have + * access to, within the scope of the consumer cloud resource hierarchy context. + * + *

Sample code: + * + *

{@code
+   * try (PrivateCatalogClient privateCatalogClient = PrivateCatalogClient.create()) {
+   *   SearchProductsRequest request =
+   *       SearchProductsRequest.newBuilder()
+   *           .setResource("resource-341064690")
+   *           .setQuery("query107944136")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       privateCatalogClient.searchProductsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Product element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchProductsPagedCallable() { + return stub.searchProductsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have + * access to, within the scope of the consumer cloud resource hierarchy context. + * + *

Sample code: + * + *

{@code
+   * try (PrivateCatalogClient privateCatalogClient = PrivateCatalogClient.create()) {
+   *   SearchProductsRequest request =
+   *       SearchProductsRequest.newBuilder()
+   *           .setResource("resource-341064690")
+   *           .setQuery("query107944136")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     SearchProductsResponse response =
+   *         privateCatalogClient.searchProductsCallable().call(request);
+   *     for (Product element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchProductsCallable() { + return stub.searchProductsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have + * access to, within the scope of the consumer cloud resource hierarchy context. + * + *

Sample code: + * + *

{@code
+   * try (PrivateCatalogClient privateCatalogClient = PrivateCatalogClient.create()) {
+   *   SearchVersionsRequest request =
+   *       SearchVersionsRequest.newBuilder()
+   *           .setResource("resource-341064690")
+   *           .setQuery("query107944136")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Version element : privateCatalogClient.searchVersions(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 SearchVersionsPagedResponse searchVersions(SearchVersionsRequest request) { + return searchVersionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have + * access to, within the scope of the consumer cloud resource hierarchy context. + * + *

Sample code: + * + *

{@code
+   * try (PrivateCatalogClient privateCatalogClient = PrivateCatalogClient.create()) {
+   *   SearchVersionsRequest request =
+   *       SearchVersionsRequest.newBuilder()
+   *           .setResource("resource-341064690")
+   *           .setQuery("query107944136")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       privateCatalogClient.searchVersionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Version element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchVersionsPagedCallable() { + return stub.searchVersionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have + * access to, within the scope of the consumer cloud resource hierarchy context. + * + *

Sample code: + * + *

{@code
+   * try (PrivateCatalogClient privateCatalogClient = PrivateCatalogClient.create()) {
+   *   SearchVersionsRequest request =
+   *       SearchVersionsRequest.newBuilder()
+   *           .setResource("resource-341064690")
+   *           .setQuery("query107944136")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     SearchVersionsResponse response =
+   *         privateCatalogClient.searchVersionsCallable().call(request);
+   *     for (Version element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchVersionsCallable() { + return stub.searchVersionsCallable(); + } + + @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 SearchCatalogsPagedResponse + extends AbstractPagedListResponse< + SearchCatalogsRequest, + SearchCatalogsResponse, + Catalog, + SearchCatalogsPage, + SearchCatalogsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SearchCatalogsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public SearchCatalogsPagedResponse apply(SearchCatalogsPage input) { + return new SearchCatalogsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private SearchCatalogsPagedResponse(SearchCatalogsPage page) { + super(page, SearchCatalogsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SearchCatalogsPage + extends AbstractPage< + SearchCatalogsRequest, SearchCatalogsResponse, Catalog, SearchCatalogsPage> { + + private SearchCatalogsPage( + PageContext context, + SearchCatalogsResponse response) { + super(context, response); + } + + private static SearchCatalogsPage createEmptyPage() { + return new SearchCatalogsPage(null, null); + } + + @Override + protected SearchCatalogsPage createPage( + PageContext context, + SearchCatalogsResponse response) { + return new SearchCatalogsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SearchCatalogsFixedSizeCollection + extends AbstractFixedSizeCollection< + SearchCatalogsRequest, + SearchCatalogsResponse, + Catalog, + SearchCatalogsPage, + SearchCatalogsFixedSizeCollection> { + + private SearchCatalogsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SearchCatalogsFixedSizeCollection createEmptyCollection() { + return new SearchCatalogsFixedSizeCollection(null, 0); + } + + @Override + protected SearchCatalogsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SearchCatalogsFixedSizeCollection(pages, collectionSize); + } + } + + public static class SearchProductsPagedResponse + extends AbstractPagedListResponse< + SearchProductsRequest, + SearchProductsResponse, + Product, + SearchProductsPage, + SearchProductsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SearchProductsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public SearchProductsPagedResponse apply(SearchProductsPage input) { + return new SearchProductsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private SearchProductsPagedResponse(SearchProductsPage page) { + super(page, SearchProductsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SearchProductsPage + extends AbstractPage< + SearchProductsRequest, SearchProductsResponse, Product, SearchProductsPage> { + + private SearchProductsPage( + PageContext context, + SearchProductsResponse response) { + super(context, response); + } + + private static SearchProductsPage createEmptyPage() { + return new SearchProductsPage(null, null); + } + + @Override + protected SearchProductsPage createPage( + PageContext context, + SearchProductsResponse response) { + return new SearchProductsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SearchProductsFixedSizeCollection + extends AbstractFixedSizeCollection< + SearchProductsRequest, + SearchProductsResponse, + Product, + SearchProductsPage, + SearchProductsFixedSizeCollection> { + + private SearchProductsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SearchProductsFixedSizeCollection createEmptyCollection() { + return new SearchProductsFixedSizeCollection(null, 0); + } + + @Override + protected SearchProductsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SearchProductsFixedSizeCollection(pages, collectionSize); + } + } + + public static class SearchVersionsPagedResponse + extends AbstractPagedListResponse< + SearchVersionsRequest, + SearchVersionsResponse, + Version, + SearchVersionsPage, + SearchVersionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SearchVersionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public SearchVersionsPagedResponse apply(SearchVersionsPage input) { + return new SearchVersionsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private SearchVersionsPagedResponse(SearchVersionsPage page) { + super(page, SearchVersionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SearchVersionsPage + extends AbstractPage< + SearchVersionsRequest, SearchVersionsResponse, Version, SearchVersionsPage> { + + private SearchVersionsPage( + PageContext context, + SearchVersionsResponse response) { + super(context, response); + } + + private static SearchVersionsPage createEmptyPage() { + return new SearchVersionsPage(null, null); + } + + @Override + protected SearchVersionsPage createPage( + PageContext context, + SearchVersionsResponse response) { + return new SearchVersionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SearchVersionsFixedSizeCollection + extends AbstractFixedSizeCollection< + SearchVersionsRequest, + SearchVersionsResponse, + Version, + SearchVersionsPage, + SearchVersionsFixedSizeCollection> { + + private SearchVersionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SearchVersionsFixedSizeCollection createEmptyCollection() { + return new SearchVersionsFixedSizeCollection(null, 0); + } + + @Override + protected SearchVersionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SearchVersionsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogSettings.java b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogSettings.java new file mode 100644 index 00000000..1ea562f0 --- /dev/null +++ b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogSettings.java @@ -0,0 +1,221 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.privatecatalog.v1beta1; + +import static com.google.cloud.privatecatalog.v1beta1.PrivateCatalogClient.SearchCatalogsPagedResponse; +import static com.google.cloud.privatecatalog.v1beta1.PrivateCatalogClient.SearchProductsPagedResponse; +import static com.google.cloud.privatecatalog.v1beta1.PrivateCatalogClient.SearchVersionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.privatecatalog.v1beta1.stub.PrivateCatalogStubSettings; +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 PrivateCatalogClient}. + * + *

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

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

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

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

{@code
+ * PrivateCatalogSettings.Builder privateCatalogSettingsBuilder =
+ *     PrivateCatalogSettings.newBuilder();
+ * privateCatalogSettingsBuilder
+ *     .searchCatalogsSettings()
+ *     .setRetrySettings(
+ *         privateCatalogSettingsBuilder
+ *             .searchCatalogsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PrivateCatalogSettings privateCatalogSettings = privateCatalogSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class PrivateCatalogSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to searchCatalogs. */ + public PagedCallSettings< + SearchCatalogsRequest, SearchCatalogsResponse, SearchCatalogsPagedResponse> + searchCatalogsSettings() { + return ((PrivateCatalogStubSettings) getStubSettings()).searchCatalogsSettings(); + } + + /** Returns the object with the settings used for calls to searchProducts. */ + public PagedCallSettings< + SearchProductsRequest, SearchProductsResponse, SearchProductsPagedResponse> + searchProductsSettings() { + return ((PrivateCatalogStubSettings) getStubSettings()).searchProductsSettings(); + } + + /** Returns the object with the settings used for calls to searchVersions. */ + public PagedCallSettings< + SearchVersionsRequest, SearchVersionsResponse, SearchVersionsPagedResponse> + searchVersionsSettings() { + return ((PrivateCatalogStubSettings) getStubSettings()).searchVersionsSettings(); + } + + public static final PrivateCatalogSettings create(PrivateCatalogStubSettings stub) + throws IOException { + return new PrivateCatalogSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return PrivateCatalogStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return PrivateCatalogStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return PrivateCatalogStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return PrivateCatalogStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return PrivateCatalogStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return PrivateCatalogStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return PrivateCatalogStubSettings.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 PrivateCatalogSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for PrivateCatalogSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(PrivateCatalogStubSettings.newBuilder(clientContext)); + } + + protected Builder(PrivateCatalogSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(PrivateCatalogStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(PrivateCatalogStubSettings.newBuilder()); + } + + public PrivateCatalogStubSettings.Builder getStubSettingsBuilder() { + return ((PrivateCatalogStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to searchCatalogs. */ + public PagedCallSettings.Builder< + SearchCatalogsRequest, SearchCatalogsResponse, SearchCatalogsPagedResponse> + searchCatalogsSettings() { + return getStubSettingsBuilder().searchCatalogsSettings(); + } + + /** Returns the builder for the settings used for calls to searchProducts. */ + public PagedCallSettings.Builder< + SearchProductsRequest, SearchProductsResponse, SearchProductsPagedResponse> + searchProductsSettings() { + return getStubSettingsBuilder().searchProductsSettings(); + } + + /** Returns the builder for the settings used for calls to searchVersions. */ + public PagedCallSettings.Builder< + SearchVersionsRequest, SearchVersionsResponse, SearchVersionsPagedResponse> + searchVersionsSettings() { + return getStubSettingsBuilder().searchVersionsSettings(); + } + + @Override + public PrivateCatalogSettings build() throws IOException { + return new PrivateCatalogSettings(this); + } + } +} diff --git a/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/gapic_metadata.json b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/gapic_metadata.json new file mode 100644 index 00000000..13140dcf --- /dev/null +++ b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/gapic_metadata.json @@ -0,0 +1,27 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.privatecatalog.v1beta1", + "libraryPackage": "com.google.cloud.privatecatalog.v1beta1", + "services": { + "PrivateCatalog": { + "clients": { + "grpc": { + "libraryClient": "PrivateCatalogClient", + "rpcs": { + "SearchCatalogs": { + "methods": ["searchCatalogs", "searchCatalogsPagedCallable", "searchCatalogsCallable"] + }, + "SearchProducts": { + "methods": ["searchProducts", "searchProductsPagedCallable", "searchProductsCallable"] + }, + "SearchVersions": { + "methods": ["searchVersions", "searchVersionsPagedCallable", "searchVersionsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/package-info.java b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/package-info.java new file mode 100644 index 00000000..f85de0f2 --- /dev/null +++ b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/package-info.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= PrivateCatalogClient ======================= + * + *

Service Description: `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, + * `Product` and `Version` resources under a target resource context. + * + *

`Catalog` is computed based on the [Association][]s linked to the target resource and its + * ancestors. Each association's [google.cloud.privatecatalogproducer.v1beta.Catalog][] is + * transformed into a `Catalog`. If multiple associations have the same parent + * [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are de-duplicated into one + * `Catalog`. Users must have `cloudprivatecatalog.catalogTargets.get` IAM permission on the + * resource context in order to access catalogs. `Catalog` contains the resource name and a subset + * of data of the original [google.cloud.privatecatalogproducer.v1beta.Catalog][]. + * + *

`Product` is child resource of the catalog. A `Product` contains the resource name and a + * subset of the data of the original [google.cloud.privatecatalogproducer.v1beta.Product][]. + * + *

`Version` is child resource of the product. A `Version` contains the resource name and a + * subset of the data of the original [google.cloud.privatecatalogproducer.v1beta.Version][]. + * + *

Sample for PrivateCatalogClient: + * + *

{@code
+ * try (PrivateCatalogClient privateCatalogClient = PrivateCatalogClient.create()) {
+ *   SearchCatalogsRequest request =
+ *       SearchCatalogsRequest.newBuilder()
+ *           .setResource("resource-341064690")
+ *           .setQuery("query107944136")
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .build();
+ *   for (Catalog element : privateCatalogClient.searchCatalogs(request).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.privatecatalog.v1beta1; + +import javax.annotation.Generated; diff --git a/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/stub/GrpcPrivateCatalogCallableFactory.java b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/stub/GrpcPrivateCatalogCallableFactory.java new file mode 100644 index 00000000..4828bb96 --- /dev/null +++ b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/stub/GrpcPrivateCatalogCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.privatecatalog.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 PrivateCatalog service API. + * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcPrivateCatalogStub extends PrivateCatalogStub { + private static final MethodDescriptor + searchCatalogsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchCatalogs") + .setRequestMarshaller( + ProtoUtils.marshaller(SearchCatalogsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SearchCatalogsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + searchProductsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchProducts") + .setRequestMarshaller( + ProtoUtils.marshaller(SearchProductsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SearchProductsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + searchVersionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchVersions") + .setRequestMarshaller( + ProtoUtils.marshaller(SearchVersionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SearchVersionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable searchCatalogsCallable; + private final UnaryCallable + searchCatalogsPagedCallable; + private final UnaryCallable searchProductsCallable; + private final UnaryCallable + searchProductsPagedCallable; + private final UnaryCallable searchVersionsCallable; + private final UnaryCallable + searchVersionsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcPrivateCatalogStub create(PrivateCatalogStubSettings settings) + throws IOException { + return new GrpcPrivateCatalogStub(settings, ClientContext.create(settings)); + } + + public static final GrpcPrivateCatalogStub create(ClientContext clientContext) + throws IOException { + return new GrpcPrivateCatalogStub( + PrivateCatalogStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcPrivateCatalogStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcPrivateCatalogStub( + PrivateCatalogStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcPrivateCatalogStub, 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 GrpcPrivateCatalogStub(PrivateCatalogStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcPrivateCatalogCallableFactory()); + } + + /** + * Constructs an instance of GrpcPrivateCatalogStub, 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 GrpcPrivateCatalogStub( + PrivateCatalogStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + searchCatalogsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchCatalogsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SearchCatalogsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + searchProductsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchProductsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SearchProductsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + searchVersionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchVersionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SearchVersionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + + this.searchCatalogsCallable = + callableFactory.createUnaryCallable( + searchCatalogsTransportSettings, settings.searchCatalogsSettings(), clientContext); + this.searchCatalogsPagedCallable = + callableFactory.createPagedCallable( + searchCatalogsTransportSettings, settings.searchCatalogsSettings(), clientContext); + this.searchProductsCallable = + callableFactory.createUnaryCallable( + searchProductsTransportSettings, settings.searchProductsSettings(), clientContext); + this.searchProductsPagedCallable = + callableFactory.createPagedCallable( + searchProductsTransportSettings, settings.searchProductsSettings(), clientContext); + this.searchVersionsCallable = + callableFactory.createUnaryCallable( + searchVersionsTransportSettings, settings.searchVersionsSettings(), clientContext); + this.searchVersionsPagedCallable = + callableFactory.createPagedCallable( + searchVersionsTransportSettings, settings.searchVersionsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable searchCatalogsCallable() { + return searchCatalogsCallable; + } + + @Override + public UnaryCallable + searchCatalogsPagedCallable() { + return searchCatalogsPagedCallable; + } + + @Override + public UnaryCallable searchProductsCallable() { + return searchProductsCallable; + } + + @Override + public UnaryCallable + searchProductsPagedCallable() { + return searchProductsPagedCallable; + } + + @Override + public UnaryCallable searchVersionsCallable() { + return searchVersionsCallable; + } + + @Override + public UnaryCallable + searchVersionsPagedCallable() { + return searchVersionsPagedCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/stub/PrivateCatalogStub.java b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/stub/PrivateCatalogStub.java new file mode 100644 index 00000000..51ddcaed --- /dev/null +++ b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/stub/PrivateCatalogStub.java @@ -0,0 +1,73 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.privatecatalog.v1beta1.stub; + +import static com.google.cloud.privatecatalog.v1beta1.PrivateCatalogClient.SearchCatalogsPagedResponse; +import static com.google.cloud.privatecatalog.v1beta1.PrivateCatalogClient.SearchProductsPagedResponse; +import static com.google.cloud.privatecatalog.v1beta1.PrivateCatalogClient.SearchVersionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest; +import com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse; +import com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest; +import com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse; +import com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest; +import com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the PrivateCatalog service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class PrivateCatalogStub implements BackgroundResource { + + public UnaryCallable + searchCatalogsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: searchCatalogsPagedCallable()"); + } + + public UnaryCallable searchCatalogsCallable() { + throw new UnsupportedOperationException("Not implemented: searchCatalogsCallable()"); + } + + public UnaryCallable + searchProductsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: searchProductsPagedCallable()"); + } + + public UnaryCallable searchProductsCallable() { + throw new UnsupportedOperationException("Not implemented: searchProductsCallable()"); + } + + public UnaryCallable + searchVersionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: searchVersionsPagedCallable()"); + } + + public UnaryCallable searchVersionsCallable() { + throw new UnsupportedOperationException("Not implemented: searchVersionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/stub/PrivateCatalogStubSettings.java b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/stub/PrivateCatalogStubSettings.java new file mode 100644 index 00000000..59704883 --- /dev/null +++ b/google-cloud-private-catalog/src/main/java/com/google/cloud/privatecatalog/v1beta1/stub/PrivateCatalogStubSettings.java @@ -0,0 +1,502 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.privatecatalog.v1beta1.stub; + +import static com.google.cloud.privatecatalog.v1beta1.PrivateCatalogClient.SearchCatalogsPagedResponse; +import static com.google.cloud.privatecatalog.v1beta1.PrivateCatalogClient.SearchProductsPagedResponse; +import static com.google.cloud.privatecatalog.v1beta1.PrivateCatalogClient.SearchVersionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.privatecatalog.v1beta1.Catalog; +import com.google.cloud.privatecatalog.v1beta1.Product; +import com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest; +import com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse; +import com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest; +import com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse; +import com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest; +import com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse; +import com.google.cloud.privatecatalog.v1beta1.Version; +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 PrivateCatalogStub}. + * + *

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

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

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

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

{@code
+ * PrivateCatalogStubSettings.Builder privateCatalogSettingsBuilder =
+ *     PrivateCatalogStubSettings.newBuilder();
+ * privateCatalogSettingsBuilder
+ *     .searchCatalogsSettings()
+ *     .setRetrySettings(
+ *         privateCatalogSettingsBuilder
+ *             .searchCatalogsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PrivateCatalogStubSettings privateCatalogSettings = privateCatalogSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class PrivateCatalogStubSettings 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< + SearchCatalogsRequest, SearchCatalogsResponse, SearchCatalogsPagedResponse> + searchCatalogsSettings; + private final PagedCallSettings< + SearchProductsRequest, SearchProductsResponse, SearchProductsPagedResponse> + searchProductsSettings; + private final PagedCallSettings< + SearchVersionsRequest, SearchVersionsResponse, SearchVersionsPagedResponse> + searchVersionsSettings; + + private static final PagedListDescriptor + SEARCH_CATALOGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchCatalogsRequest injectToken(SearchCatalogsRequest payload, String token) { + return SearchCatalogsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchCatalogsRequest injectPageSize( + SearchCatalogsRequest payload, int pageSize) { + return SearchCatalogsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchCatalogsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchCatalogsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(SearchCatalogsResponse payload) { + return payload.getCatalogsList() == null + ? ImmutableList.of() + : payload.getCatalogsList(); + } + }; + + private static final PagedListDescriptor + SEARCH_PRODUCTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchProductsRequest injectToken(SearchProductsRequest payload, String token) { + return SearchProductsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchProductsRequest injectPageSize( + SearchProductsRequest payload, int pageSize) { + return SearchProductsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchProductsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchProductsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(SearchProductsResponse payload) { + return payload.getProductsList() == null + ? ImmutableList.of() + : payload.getProductsList(); + } + }; + + private static final PagedListDescriptor + SEARCH_VERSIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchVersionsRequest injectToken(SearchVersionsRequest payload, String token) { + return SearchVersionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchVersionsRequest injectPageSize( + SearchVersionsRequest payload, int pageSize) { + return SearchVersionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchVersionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchVersionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(SearchVersionsResponse payload) { + return payload.getVersionsList() == null + ? ImmutableList.of() + : payload.getVersionsList(); + } + }; + + private static final PagedListResponseFactory< + SearchCatalogsRequest, SearchCatalogsResponse, SearchCatalogsPagedResponse> + SEARCH_CATALOGS_PAGE_STR_FACT = + new PagedListResponseFactory< + SearchCatalogsRequest, SearchCatalogsResponse, SearchCatalogsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchCatalogsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, SEARCH_CATALOGS_PAGE_STR_DESC, request, context); + return SearchCatalogsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + SearchProductsRequest, SearchProductsResponse, SearchProductsPagedResponse> + SEARCH_PRODUCTS_PAGE_STR_FACT = + new PagedListResponseFactory< + SearchProductsRequest, SearchProductsResponse, SearchProductsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchProductsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, SEARCH_PRODUCTS_PAGE_STR_DESC, request, context); + return SearchProductsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + SearchVersionsRequest, SearchVersionsResponse, SearchVersionsPagedResponse> + SEARCH_VERSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + SearchVersionsRequest, SearchVersionsResponse, SearchVersionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchVersionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, SEARCH_VERSIONS_PAGE_STR_DESC, request, context); + return SearchVersionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to searchCatalogs. */ + public PagedCallSettings< + SearchCatalogsRequest, SearchCatalogsResponse, SearchCatalogsPagedResponse> + searchCatalogsSettings() { + return searchCatalogsSettings; + } + + /** Returns the object with the settings used for calls to searchProducts. */ + public PagedCallSettings< + SearchProductsRequest, SearchProductsResponse, SearchProductsPagedResponse> + searchProductsSettings() { + return searchProductsSettings; + } + + /** Returns the object with the settings used for calls to searchVersions. */ + public PagedCallSettings< + SearchVersionsRequest, SearchVersionsResponse, SearchVersionsPagedResponse> + searchVersionsSettings() { + return searchVersionsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public PrivateCatalogStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcPrivateCatalogStub.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 "cloudprivatecatalog.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(PrivateCatalogStubSettings.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 PrivateCatalogStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + searchCatalogsSettings = settingsBuilder.searchCatalogsSettings().build(); + searchProductsSettings = settingsBuilder.searchProductsSettings().build(); + searchVersionsSettings = settingsBuilder.searchVersionsSettings().build(); + } + + /** Builder for PrivateCatalogStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + SearchCatalogsRequest, SearchCatalogsResponse, SearchCatalogsPagedResponse> + searchCatalogsSettings; + private final PagedCallSettings.Builder< + SearchProductsRequest, SearchProductsResponse, SearchProductsPagedResponse> + searchProductsSettings; + private final PagedCallSettings.Builder< + SearchVersionsRequest, SearchVersionsResponse, SearchVersionsPagedResponse> + searchVersionsSettings; + 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); + + searchCatalogsSettings = PagedCallSettings.newBuilder(SEARCH_CATALOGS_PAGE_STR_FACT); + searchProductsSettings = PagedCallSettings.newBuilder(SEARCH_PRODUCTS_PAGE_STR_FACT); + searchVersionsSettings = PagedCallSettings.newBuilder(SEARCH_VERSIONS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + searchCatalogsSettings, searchProductsSettings, searchVersionsSettings); + initDefaults(this); + } + + protected Builder(PrivateCatalogStubSettings settings) { + super(settings); + + searchCatalogsSettings = settings.searchCatalogsSettings.toBuilder(); + searchProductsSettings = settings.searchProductsSettings.toBuilder(); + searchVersionsSettings = settings.searchVersionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + searchCatalogsSettings, searchProductsSettings, searchVersionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .searchCatalogsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .searchProductsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .searchVersionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to searchCatalogs. */ + public PagedCallSettings.Builder< + SearchCatalogsRequest, SearchCatalogsResponse, SearchCatalogsPagedResponse> + searchCatalogsSettings() { + return searchCatalogsSettings; + } + + /** Returns the builder for the settings used for calls to searchProducts. */ + public PagedCallSettings.Builder< + SearchProductsRequest, SearchProductsResponse, SearchProductsPagedResponse> + searchProductsSettings() { + return searchProductsSettings; + } + + /** Returns the builder for the settings used for calls to searchVersions. */ + public PagedCallSettings.Builder< + SearchVersionsRequest, SearchVersionsResponse, SearchVersionsPagedResponse> + searchVersionsSettings() { + return searchVersionsSettings; + } + + @Override + public PrivateCatalogStubSettings build() throws IOException { + return new PrivateCatalogStubSettings(this); + } + } +} diff --git a/google-cloud-private-catalog/src/test/java/com/google/cloud/privatecatalog/v1beta1/MockPrivateCatalog.java b/google-cloud-private-catalog/src/test/java/com/google/cloud/privatecatalog/v1beta1/MockPrivateCatalog.java new file mode 100644 index 00000000..3052803e --- /dev/null +++ b/google-cloud-private-catalog/src/test/java/com/google/cloud/privatecatalog/v1beta1/MockPrivateCatalog.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.privatecatalog.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 MockPrivateCatalog implements MockGrpcService { + private final MockPrivateCatalogImpl serviceImpl; + + public MockPrivateCatalog() { + serviceImpl = new MockPrivateCatalogImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-private-catalog/src/test/java/com/google/cloud/privatecatalog/v1beta1/MockPrivateCatalogImpl.java b/google-cloud-private-catalog/src/test/java/com/google/cloud/privatecatalog/v1beta1/MockPrivateCatalogImpl.java new file mode 100644 index 00000000..c7e02698 --- /dev/null +++ b/google-cloud-private-catalog/src/test/java/com/google/cloud/privatecatalog/v1beta1/MockPrivateCatalogImpl.java @@ -0,0 +1,123 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.privatecatalog.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.privatecatalog.v1beta1.PrivateCatalogGrpc.PrivateCatalogImplBase; +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 MockPrivateCatalogImpl extends PrivateCatalogImplBase { + private List requests; + private Queue responses; + + public MockPrivateCatalogImpl() { + 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 searchCatalogs( + SearchCatalogsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchCatalogsResponse) { + requests.add(request); + responseObserver.onNext(((SearchCatalogsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SearchCatalogs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchCatalogsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void searchProducts( + SearchProductsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchProductsResponse) { + requests.add(request); + responseObserver.onNext(((SearchProductsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SearchProducts, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchProductsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void searchVersions( + SearchVersionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchVersionsResponse) { + requests.add(request); + responseObserver.onNext(((SearchVersionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SearchVersions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchVersionsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-private-catalog/src/test/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogClientTest.java b/google-cloud-private-catalog/src/test/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogClientTest.java new file mode 100644 index 00000000..d1883726 --- /dev/null +++ b/google-cloud-private-catalog/src/test/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogClientTest.java @@ -0,0 +1,259 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.privatecatalog.v1beta1; + +import static com.google.cloud.privatecatalog.v1beta1.PrivateCatalogClient.SearchCatalogsPagedResponse; +import static com.google.cloud.privatecatalog.v1beta1.PrivateCatalogClient.SearchProductsPagedResponse; +import static com.google.cloud.privatecatalog.v1beta1.PrivateCatalogClient.SearchVersionsPagedResponse; + +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 PrivateCatalogClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockPrivateCatalog mockPrivateCatalog; + private PrivateCatalogClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPrivateCatalog = new MockPrivateCatalog(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockPrivateCatalog)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + PrivateCatalogSettings settings = + PrivateCatalogSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = PrivateCatalogClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void searchCatalogsTest() throws Exception { + Catalog responsesElement = Catalog.newBuilder().build(); + SearchCatalogsResponse expectedResponse = + SearchCatalogsResponse.newBuilder() + .setNextPageToken("") + .addAllCatalogs(Arrays.asList(responsesElement)) + .build(); + mockPrivateCatalog.addResponse(expectedResponse); + + SearchCatalogsRequest request = + SearchCatalogsRequest.newBuilder() + .setResource("resource-341064690") + .setQuery("query107944136") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + SearchCatalogsPagedResponse pagedListResponse = client.searchCatalogs(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCatalogsList().get(0), resources.get(0)); + + List actualRequests = mockPrivateCatalog.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchCatalogsRequest actualRequest = ((SearchCatalogsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchCatalogsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPrivateCatalog.addException(exception); + + try { + SearchCatalogsRequest request = + SearchCatalogsRequest.newBuilder() + .setResource("resource-341064690") + .setQuery("query107944136") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.searchCatalogs(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchProductsTest() throws Exception { + Product responsesElement = Product.newBuilder().build(); + SearchProductsResponse expectedResponse = + SearchProductsResponse.newBuilder() + .setNextPageToken("") + .addAllProducts(Arrays.asList(responsesElement)) + .build(); + mockPrivateCatalog.addResponse(expectedResponse); + + SearchProductsRequest request = + SearchProductsRequest.newBuilder() + .setResource("resource-341064690") + .setQuery("query107944136") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + SearchProductsPagedResponse pagedListResponse = client.searchProducts(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProductsList().get(0), resources.get(0)); + + List actualRequests = mockPrivateCatalog.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchProductsRequest actualRequest = ((SearchProductsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchProductsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPrivateCatalog.addException(exception); + + try { + SearchProductsRequest request = + SearchProductsRequest.newBuilder() + .setResource("resource-341064690") + .setQuery("query107944136") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.searchProducts(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchVersionsTest() throws Exception { + Version responsesElement = Version.newBuilder().build(); + SearchVersionsResponse expectedResponse = + SearchVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllVersions(Arrays.asList(responsesElement)) + .build(); + mockPrivateCatalog.addResponse(expectedResponse); + + SearchVersionsRequest request = + SearchVersionsRequest.newBuilder() + .setResource("resource-341064690") + .setQuery("query107944136") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + SearchVersionsPagedResponse pagedListResponse = client.searchVersions(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getVersionsList().get(0), resources.get(0)); + + List actualRequests = mockPrivateCatalog.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchVersionsRequest actualRequest = ((SearchVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchVersionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPrivateCatalog.addException(exception); + + try { + SearchVersionsRequest request = + SearchVersionsRequest.newBuilder() + .setResource("resource-341064690") + .setQuery("query107944136") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.searchVersions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/grpc-google-cloud-private-catalog-v1beta1/pom.xml b/grpc-google-cloud-private-catalog-v1beta1/pom.xml new file mode 100644 index 00000000..2acf7978 --- /dev/null +++ b/grpc-google-cloud-private-catalog-v1beta1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-private-catalog-v1beta1 + 0.0.1-SNAPSHOT + grpc-google-cloud-private-catalog-v1beta1 + GRPC library for google-cloud-private-catalog + + com.google.cloud + google-cloud-private-catalog-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-private-catalog-v1beta1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogGrpc.java b/grpc-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogGrpc.java new file mode 100644 index 00000000..0251a10b --- /dev/null +++ b/grpc-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogGrpc.java @@ -0,0 +1,704 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.privatecatalog.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product`
+ * and `Version` resources under a target resource context.
+ * `Catalog` is computed based on the [Association][]s linked to the target
+ * resource and its ancestors. Each association's
+ * [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a
+ * `Catalog`. If multiple associations have the same parent
+ * [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are
+ * de-duplicated into one `Catalog`. Users must have
+ * `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource
+ * context in order to access catalogs. `Catalog` contains the resource name and
+ * a subset of data of the original
+ * [google.cloud.privatecatalogproducer.v1beta.Catalog][].
+ * `Product` is child resource of the catalog. A `Product` contains the resource
+ * name and a subset of the data of the original
+ * [google.cloud.privatecatalogproducer.v1beta.Product][].
+ * `Version` is child resource of the product. A `Version` contains the resource
+ * name and a subset of the data of the original
+ * [google.cloud.privatecatalogproducer.v1beta.Version][].
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/privatecatalog/v1beta1/private_catalog.proto") +public final class PrivateCatalogGrpc { + + private PrivateCatalogGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.privatecatalog.v1beta1.PrivateCatalog"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest, + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse> + getSearchCatalogsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchCatalogs", + requestType = com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.class, + responseType = com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest, + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse> + getSearchCatalogsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest, + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse> + getSearchCatalogsMethod; + if ((getSearchCatalogsMethod = PrivateCatalogGrpc.getSearchCatalogsMethod) == null) { + synchronized (PrivateCatalogGrpc.class) { + if ((getSearchCatalogsMethod = PrivateCatalogGrpc.getSearchCatalogsMethod) == null) { + PrivateCatalogGrpc.getSearchCatalogsMethod = + getSearchCatalogsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchCatalogs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PrivateCatalogMethodDescriptorSupplier("SearchCatalogs")) + .build(); + } + } + } + return getSearchCatalogsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest, + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse> + getSearchProductsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchProducts", + requestType = com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest.class, + responseType = com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest, + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse> + getSearchProductsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest, + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse> + getSearchProductsMethod; + if ((getSearchProductsMethod = PrivateCatalogGrpc.getSearchProductsMethod) == null) { + synchronized (PrivateCatalogGrpc.class) { + if ((getSearchProductsMethod = PrivateCatalogGrpc.getSearchProductsMethod) == null) { + PrivateCatalogGrpc.getSearchProductsMethod = + getSearchProductsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchProducts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PrivateCatalogMethodDescriptorSupplier("SearchProducts")) + .build(); + } + } + } + return getSearchProductsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest, + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse> + getSearchVersionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchVersions", + requestType = com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest.class, + responseType = com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest, + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse> + getSearchVersionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest, + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse> + getSearchVersionsMethod; + if ((getSearchVersionsMethod = PrivateCatalogGrpc.getSearchVersionsMethod) == null) { + synchronized (PrivateCatalogGrpc.class) { + if ((getSearchVersionsMethod = PrivateCatalogGrpc.getSearchVersionsMethod) == null) { + PrivateCatalogGrpc.getSearchVersionsMethod = + getSearchVersionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchVersions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PrivateCatalogMethodDescriptorSupplier("SearchVersions")) + .build(); + } + } + } + return getSearchVersionsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static PrivateCatalogStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PrivateCatalogStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrivateCatalogStub(channel, callOptions); + } + }; + return PrivateCatalogStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static PrivateCatalogBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PrivateCatalogBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrivateCatalogBlockingStub(channel, callOptions); + } + }; + return PrivateCatalogBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PrivateCatalogFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PrivateCatalogFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrivateCatalogFutureStub(channel, callOptions); + } + }; + return PrivateCatalogFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product`
+   * and `Version` resources under a target resource context.
+   * `Catalog` is computed based on the [Association][]s linked to the target
+   * resource and its ancestors. Each association's
+   * [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a
+   * `Catalog`. If multiple associations have the same parent
+   * [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are
+   * de-duplicated into one `Catalog`. Users must have
+   * `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource
+   * context in order to access catalogs. `Catalog` contains the resource name and
+   * a subset of data of the original
+   * [google.cloud.privatecatalogproducer.v1beta.Catalog][].
+   * `Product` is child resource of the catalog. A `Product` contains the resource
+   * name and a subset of the data of the original
+   * [google.cloud.privatecatalogproducer.v1beta.Product][].
+   * `Version` is child resource of the product. A `Version` contains the resource
+   * name and a subset of the data of the original
+   * [google.cloud.privatecatalogproducer.v1beta.Version][].
+   * 
+ */ + public abstract static class PrivateCatalogImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the
+     * scope of the consumer cloud resource hierarchy context.
+     * 
+ */ + public void searchCatalogs( + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchCatalogsMethod(), responseObserver); + } + + /** + * + * + *
+     * Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the
+     * scope of the consumer cloud resource hierarchy context.
+     * 
+ */ + public void searchProducts( + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchProductsMethod(), responseObserver); + } + + /** + * + * + *
+     * Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the
+     * scope of the consumer cloud resource hierarchy context.
+     * 
+ */ + public void searchVersions( + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchVersionsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getSearchCatalogsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest, + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse>( + this, METHODID_SEARCH_CATALOGS))) + .addMethod( + getSearchProductsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest, + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse>( + this, METHODID_SEARCH_PRODUCTS))) + .addMethod( + getSearchVersionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest, + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse>( + this, METHODID_SEARCH_VERSIONS))) + .build(); + } + } + + /** + * + * + *
+   * `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product`
+   * and `Version` resources under a target resource context.
+   * `Catalog` is computed based on the [Association][]s linked to the target
+   * resource and its ancestors. Each association's
+   * [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a
+   * `Catalog`. If multiple associations have the same parent
+   * [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are
+   * de-duplicated into one `Catalog`. Users must have
+   * `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource
+   * context in order to access catalogs. `Catalog` contains the resource name and
+   * a subset of data of the original
+   * [google.cloud.privatecatalogproducer.v1beta.Catalog][].
+   * `Product` is child resource of the catalog. A `Product` contains the resource
+   * name and a subset of the data of the original
+   * [google.cloud.privatecatalogproducer.v1beta.Product][].
+   * `Version` is child resource of the product. A `Version` contains the resource
+   * name and a subset of the data of the original
+   * [google.cloud.privatecatalogproducer.v1beta.Version][].
+   * 
+ */ + public static final class PrivateCatalogStub + extends io.grpc.stub.AbstractAsyncStub { + private PrivateCatalogStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PrivateCatalogStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrivateCatalogStub(channel, callOptions); + } + + /** + * + * + *
+     * Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the
+     * scope of the consumer cloud resource hierarchy context.
+     * 
+ */ + public void searchCatalogs( + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchCatalogsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the
+     * scope of the consumer cloud resource hierarchy context.
+     * 
+ */ + public void searchProducts( + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchProductsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the
+     * scope of the consumer cloud resource hierarchy context.
+     * 
+ */ + public void searchVersions( + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchVersionsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product`
+   * and `Version` resources under a target resource context.
+   * `Catalog` is computed based on the [Association][]s linked to the target
+   * resource and its ancestors. Each association's
+   * [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a
+   * `Catalog`. If multiple associations have the same parent
+   * [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are
+   * de-duplicated into one `Catalog`. Users must have
+   * `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource
+   * context in order to access catalogs. `Catalog` contains the resource name and
+   * a subset of data of the original
+   * [google.cloud.privatecatalogproducer.v1beta.Catalog][].
+   * `Product` is child resource of the catalog. A `Product` contains the resource
+   * name and a subset of the data of the original
+   * [google.cloud.privatecatalogproducer.v1beta.Product][].
+   * `Version` is child resource of the product. A `Version` contains the resource
+   * name and a subset of the data of the original
+   * [google.cloud.privatecatalogproducer.v1beta.Version][].
+   * 
+ */ + public static final class PrivateCatalogBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private PrivateCatalogBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PrivateCatalogBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrivateCatalogBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the
+     * scope of the consumer cloud resource hierarchy context.
+     * 
+ */ + public com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse searchCatalogs( + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchCatalogsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the
+     * scope of the consumer cloud resource hierarchy context.
+     * 
+ */ + public com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse searchProducts( + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchProductsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the
+     * scope of the consumer cloud resource hierarchy context.
+     * 
+ */ + public com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse searchVersions( + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchVersionsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product`
+   * and `Version` resources under a target resource context.
+   * `Catalog` is computed based on the [Association][]s linked to the target
+   * resource and its ancestors. Each association's
+   * [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a
+   * `Catalog`. If multiple associations have the same parent
+   * [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are
+   * de-duplicated into one `Catalog`. Users must have
+   * `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource
+   * context in order to access catalogs. `Catalog` contains the resource name and
+   * a subset of data of the original
+   * [google.cloud.privatecatalogproducer.v1beta.Catalog][].
+   * `Product` is child resource of the catalog. A `Product` contains the resource
+   * name and a subset of the data of the original
+   * [google.cloud.privatecatalogproducer.v1beta.Product][].
+   * `Version` is child resource of the product. A `Version` contains the resource
+   * name and a subset of the data of the original
+   * [google.cloud.privatecatalogproducer.v1beta.Version][].
+   * 
+ */ + public static final class PrivateCatalogFutureStub + extends io.grpc.stub.AbstractFutureStub { + private PrivateCatalogFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PrivateCatalogFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrivateCatalogFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the
+     * scope of the consumer cloud resource hierarchy context.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse> + searchCatalogs(com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchCatalogsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the
+     * scope of the consumer cloud resource hierarchy context.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse> + searchProducts(com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchProductsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the
+     * scope of the consumer cloud resource hierarchy context.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse> + searchVersions(com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchVersionsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_SEARCH_CATALOGS = 0; + private static final int METHODID_SEARCH_PRODUCTS = 1; + private static final int METHODID_SEARCH_VERSIONS = 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 PrivateCatalogImplBase serviceImpl; + private final int methodId; + + MethodHandlers(PrivateCatalogImplBase 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_SEARCH_CATALOGS: + serviceImpl.searchCatalogs( + (com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse>) + responseObserver); + break; + case METHODID_SEARCH_PRODUCTS: + serviceImpl.searchProducts( + (com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse>) + responseObserver); + break; + case METHODID_SEARCH_VERSIONS: + serviceImpl.searchVersions( + (com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class PrivateCatalogBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + PrivateCatalogBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("PrivateCatalog"); + } + } + + private static final class PrivateCatalogFileDescriptorSupplier + extends PrivateCatalogBaseDescriptorSupplier { + PrivateCatalogFileDescriptorSupplier() {} + } + + private static final class PrivateCatalogMethodDescriptorSupplier + extends PrivateCatalogBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + PrivateCatalogMethodDescriptorSupplier(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 (PrivateCatalogGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new PrivateCatalogFileDescriptorSupplier()) + .addMethod(getSearchCatalogsMethod()) + .addMethod(getSearchProductsMethod()) + .addMethod(getSearchVersionsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java.header b/java.header new file mode 100644 index 00000000..3a9b503a --- /dev/null +++ b/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \*$ +^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ +^ \* you may not use this file except in compliance with the License\.$ +^ \* You may obtain a copy of the License at$ +^ \*$ +^ \*[ ]+https?://www.apache.org/licenses/LICENSE-2\.0$ +^ \*$ +^ \* Unless required by applicable law or agreed to in writing, software$ +^ \* distributed under the License is distributed on an "AS IS" BASIS,$ +^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$ +^ \* See the License for the specific language governing permissions and$ +^ \* limitations under the License\.$ +^ \*/$ diff --git a/license-checks.xml b/license-checks.xml new file mode 100644 index 00000000..6597fced --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/owlbot.py b/owlbot.py new file mode 100644 index 00000000..77243461 --- /dev/null +++ b/owlbot.py @@ -0,0 +1,24 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates() \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..d476bc7d --- /dev/null +++ b/pom.xml @@ -0,0 +1,179 @@ + + + 4.0.0 + com.google.cloud + google-cloud-private-catalog-parent + pom + 0.0.1-SNAPSHOT + Google Private Catalog Parent + https://github.com/googleapis/java-private-catalog + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.11.0 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-private-catalog.git + scm:git:git@github.com:googleapis/java-private-catalog.git + https://github.com/googleapis/java-private-catalog + HEAD + + + https://github.com/googleapis/java-private-catalog/issues + GitHub Issues + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-private-catalog-parent + + + + + + com.google.cloud + google-cloud-private-catalog + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-private-catalog-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-private-catalog-v1beta1 + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 0.20.1 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.objenesis:objenesis + javax.annotation:javax.annotation-api + + + + + + + + + google-cloud-private-catalog + grpc-google-cloud-private-catalog-v1beta1 + proto-google-cloud-private-catalog-v1beta1 + google-cloud-private-catalog-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.1.1 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + \ No newline at end of file diff --git a/proto-google-cloud-private-catalog-v1beta1/clirr-ignored-differences.xml b/proto-google-cloud-private-catalog-v1beta1/clirr-ignored-differences.xml new file mode 100644 index 00000000..580ece38 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/privatecatalog/v1beta1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/privatecatalog/v1beta1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/privatecatalog/v1beta1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-private-catalog-v1beta1/pom.xml b/proto-google-cloud-private-catalog-v1beta1/pom.xml new file mode 100644 index 00000000..66053924 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-private-catalog-v1beta1 + 0.0.1-SNAPSHOT + proto-google-cloud-private-catalog-v1beta1 + Proto library for google-cloud-private-catalog + + com.google.cloud + google-cloud-private-catalog-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/AssetReference.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/AssetReference.java new file mode 100644 index 00000000..9d80c493 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/AssetReference.java @@ -0,0 +1,3762 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +/** + * + * + *
+ * Defines the reference of an asset belonging to a product.
+ * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.AssetReference} + */ +public final class AssetReference extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.privatecatalog.v1beta1.AssetReference) + AssetReferenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use AssetReference.newBuilder() to construct. + private AssetReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AssetReference() { + id_ = ""; + description_ = ""; + validationStatus_ = 0; + version_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AssetReference(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AssetReference( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 50: + { + com.google.cloud.privatecatalog.v1beta1.Inputs.Builder subBuilder = null; + if (inputs_ != null) { + subBuilder = inputs_.toBuilder(); + } + inputs_ = + input.readMessage( + com.google.cloud.privatecatalog.v1beta1.Inputs.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputs_); + inputs_ = subBuilder.buildPartial(); + } + + break; + } + case 56: + { + int rawValue = input.readEnum(); + + validationStatus_ = rawValue; + break; + } + case 66: + { + com.google.longrunning.Operation.Builder subBuilder = null; + if (validationOperation_ != null) { + subBuilder = validationOperation_.toBuilder(); + } + validationOperation_ = + input.readMessage(com.google.longrunning.Operation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(validationOperation_); + validationOperation_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 10; + source_ = s; + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 11; + source_ = s; + break; + } + case 98: + { + 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 106: + { + 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 114: + { + java.lang.String s = input.readStringRequireUtf8(); + + version_ = s; + break; + } + case 122: + { + com.google.cloud.privatecatalog.v1beta1.GitSource.Builder subBuilder = null; + if (sourceCase_ == 15) { + subBuilder = + ((com.google.cloud.privatecatalog.v1beta1.GitSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.privatecatalog.v1beta1.GitSource.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.privatecatalog.v1beta1.GitSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 15; + break; + } + case 130: + { + com.google.cloud.privatecatalog.v1beta1.GcsSource.Builder subBuilder = null; + if (gcsSource_ != null) { + subBuilder = gcsSource_.toBuilder(); + } + gcsSource_ = + input.readMessage( + com.google.cloud.privatecatalog.v1beta1.GcsSource.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(gcsSource_); + gcsSource_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_AssetReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_AssetReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.AssetReference.class, + com.google.cloud.privatecatalog.v1beta1.AssetReference.Builder.class); + } + + /** + * + * + *
+   * Possible validation steates of an asset reference.
+   * 
+ * + * Protobuf enum {@code google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState} + */ + public enum AssetValidationState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown state.
+     * 
+ * + * ASSET_VALIDATION_STATE_UNSPECIFIED = 0; + */ + ASSET_VALIDATION_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The validation is still in process.
+     * 
+ * + * PENDING = 1; + */ + PENDING(1), + /** + * + * + *
+     * The validation is done and the asset reference is valid.
+     * 
+ * + * VALID = 2; + */ + VALID(2), + /** + * + * + *
+     * The validation is done and the asset reference is invalid.
+     * 
+ * + * INVALID = 3; + */ + INVALID(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unknown state.
+     * 
+ * + * ASSET_VALIDATION_STATE_UNSPECIFIED = 0; + */ + public static final int ASSET_VALIDATION_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The validation is still in process.
+     * 
+ * + * PENDING = 1; + */ + public static final int PENDING_VALUE = 1; + /** + * + * + *
+     * The validation is done and the asset reference is valid.
+     * 
+ * + * VALID = 2; + */ + public static final int VALID_VALUE = 2; + /** + * + * + *
+     * The validation is done and the asset reference is invalid.
+     * 
+ * + * INVALID = 3; + */ + public static final int INVALID_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 AssetValidationState 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 AssetValidationState forNumber(int value) { + switch (value) { + case 0: + return ASSET_VALIDATION_STATE_UNSPECIFIED; + case 1: + return PENDING; + case 2: + return VALID; + case 3: + return INVALID; + 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 AssetValidationState findValueByNumber(int number) { + return AssetValidationState.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.cloud.privatecatalog.v1beta1.AssetReference.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final AssetValidationState[] VALUES = values(); + + public static AssetValidationState 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 AssetValidationState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState) + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ASSET(10), + @java.lang.Deprecated + GCS_PATH(11), + GIT_SOURCE(15), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(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 SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 10: + return ASSET; + case 11: + return GCS_PATH; + case 15: + return GIT_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+   * Output only. A unique identifier among asset references in a product.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. A unique identifier among asset references in a product.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Output only. The human-readable description of the referenced asset. Maximum 256
+   * characters in length.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The human-readable description of the referenced asset. Maximum 256
+   * characters in length.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 INPUTS_FIELD_NUMBER = 6; + private com.google.cloud.privatecatalog.v1beta1.Inputs inputs_; + /** + * + * + *
+   * Output only. The definition of input parameters to hydrate the asset template.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the inputs field is set. + */ + @java.lang.Override + public boolean hasInputs() { + return inputs_ != null; + } + /** + * + * + *
+   * Output only. The definition of input parameters to hydrate the asset template.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The inputs. + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Inputs getInputs() { + return inputs_ == null + ? com.google.cloud.privatecatalog.v1beta1.Inputs.getDefaultInstance() + : inputs_; + } + /** + * + * + *
+   * Output only. The definition of input parameters to hydrate the asset template.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.InputsOrBuilder getInputsOrBuilder() { + return getInputs(); + } + + public static final int VALIDATION_STATUS_FIELD_NUMBER = 7; + private int validationStatus_; + /** + * + * + *
+   * Output only. The current state of the asset reference.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for validationStatus. + */ + @java.lang.Override + public int getValidationStatusValue() { + return validationStatus_; + } + /** + * + * + *
+   * Output only. The current state of the asset reference.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The validationStatus. + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState + getValidationStatus() { + @SuppressWarnings("deprecation") + com.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState result = + com.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState.valueOf( + validationStatus_); + return result == null + ? com.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState.UNRECOGNIZED + : result; + } + + public static final int VALIDATION_OPERATION_FIELD_NUMBER = 8; + private com.google.longrunning.Operation validationOperation_; + /** + * + * + *
+   * Output only. The validation process metadata.
+   * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the validationOperation field is set. + */ + @java.lang.Override + public boolean hasValidationOperation() { + return validationOperation_ != null; + } + /** + * + * + *
+   * Output only. The validation process metadata.
+   * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The validationOperation. + */ + @java.lang.Override + public com.google.longrunning.Operation getValidationOperation() { + return validationOperation_ == null + ? com.google.longrunning.Operation.getDefaultInstance() + : validationOperation_; + } + /** + * + * + *
+   * Output only. The validation process metadata.
+   * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.longrunning.OperationOrBuilder getValidationOperationOrBuilder() { + return getValidationOperation(); + } + + public static final int ASSET_FIELD_NUMBER = 10; + /** + * + * + *
+   * Output only. The asset resource name if an asset is hosted by Private Catalog.
+   * 
+ * + * string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the asset field is set. + */ + public boolean hasAsset() { + return sourceCase_ == 10; + } + /** + * + * + *
+   * Output only. The asset resource name if an asset is hosted by Private Catalog.
+   * 
+ * + * string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The asset. + */ + public java.lang.String getAsset() { + java.lang.Object ref = ""; + if (sourceCase_ == 10) { + ref = source_; + } + if (ref instanceof java.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 (sourceCase_ == 10) { + source_ = s; + } + return s; + } + } + /** + * + * + *
+   * Output only. The asset resource name if an asset is hosted by Private Catalog.
+   * 
+ * + * string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for asset. + */ + public com.google.protobuf.ByteString getAssetBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 10) { + ref = source_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 10) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GCS_PATH_FIELD_NUMBER = 11; + /** + * + * + *
+   * Output only. The cloud storage object path.
+   * 
+ * + * string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the gcsPath field is set. + */ + @java.lang.Deprecated + public boolean hasGcsPath() { + return sourceCase_ == 11; + } + /** + * + * + *
+   * Output only. The cloud storage object path.
+   * 
+ * + * string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The gcsPath. + */ + @java.lang.Deprecated + public java.lang.String getGcsPath() { + java.lang.Object ref = ""; + if (sourceCase_ == 11) { + ref = source_; + } + if (ref instanceof java.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 (sourceCase_ == 11) { + source_ = s; + } + return s; + } + } + /** + * + * + *
+   * Output only. The cloud storage object path.
+   * 
+ * + * string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for gcsPath. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getGcsPathBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 11) { + ref = source_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 11) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GIT_SOURCE_FIELD_NUMBER = 15; + /** + * + * + *
+   * Output only. The git source.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the gitSource field is set. + */ + @java.lang.Override + public boolean hasGitSource() { + return sourceCase_ == 15; + } + /** + * + * + *
+   * Output only. The git source.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The gitSource. + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GitSource getGitSource() { + if (sourceCase_ == 15) { + return (com.google.cloud.privatecatalog.v1beta1.GitSource) source_; + } + return com.google.cloud.privatecatalog.v1beta1.GitSource.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. The git source.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GitSourceOrBuilder getGitSourceOrBuilder() { + if (sourceCase_ == 15) { + return (com.google.cloud.privatecatalog.v1beta1.GitSource) source_; + } + return com.google.cloud.privatecatalog.v1beta1.GitSource.getDefaultInstance(); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 16; + private com.google.cloud.privatecatalog.v1beta1.GcsSource gcsSource_; + /** + * + * + *
+   * Output only. The cloud storage source.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return gcsSource_ != null; + } + /** + * + * + *
+   * Output only. The cloud storage source.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GcsSource getGcsSource() { + return gcsSource_ == null + ? com.google.cloud.privatecatalog.v1beta1.GcsSource.getDefaultInstance() + : gcsSource_; + } + /** + * + * + *
+   * Output only. The cloud storage source.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + return getGcsSource(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 12; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The creation timestamp of the asset reference.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The creation timestamp of the asset reference.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The creation timestamp of the asset reference.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 12 [(.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 = 13; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last update timestamp of the asset reference.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last update timestamp of the asset reference.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last update timestamp of the asset reference.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int VERSION_FIELD_NUMBER = 14; + private volatile java.lang.Object version_; + /** + * + * + *
+   * The version of the source used for this asset reference.
+   * 
+ * + * string version = 14 [deprecated = true]; + * + * @return The version. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } + } + /** + * + * + *
+   * The version of the source used for this asset reference.
+   * 
+ * + * string version = 14 [deprecated = true]; + * + * @return The bytes for version. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = 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 (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (inputs_ != null) { + output.writeMessage(6, getInputs()); + } + if (validationStatus_ + != com.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState + .ASSET_VALIDATION_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, validationStatus_); + } + if (validationOperation_ != null) { + output.writeMessage(8, getValidationOperation()); + } + if (sourceCase_ == 10) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, source_); + } + if (sourceCase_ == 11) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, source_); + } + if (createTime_ != null) { + output.writeMessage(12, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(13, getUpdateTime()); + } + if (!getVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, version_); + } + if (sourceCase_ == 15) { + output.writeMessage(15, (com.google.cloud.privatecatalog.v1beta1.GitSource) source_); + } + if (gcsSource_ != null) { + output.writeMessage(16, getGcsSource()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (inputs_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getInputs()); + } + if (validationStatus_ + != com.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState + .ASSET_VALIDATION_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, validationStatus_); + } + if (validationOperation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getValidationOperation()); + } + if (sourceCase_ == 10) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, source_); + } + if (sourceCase_ == 11) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, source_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getUpdateTime()); + } + if (!getVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, version_); + } + if (sourceCase_ == 15) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 15, (com.google.cloud.privatecatalog.v1beta1.GitSource) source_); + } + if (gcsSource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getGcsSource()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.privatecatalog.v1beta1.AssetReference)) { + return super.equals(obj); + } + com.google.cloud.privatecatalog.v1beta1.AssetReference other = + (com.google.cloud.privatecatalog.v1beta1.AssetReference) obj; + + if (!getId().equals(other.getId())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasInputs() != other.hasInputs()) return false; + if (hasInputs()) { + if (!getInputs().equals(other.getInputs())) return false; + } + if (validationStatus_ != other.validationStatus_) return false; + if (hasValidationOperation() != other.hasValidationOperation()) return false; + if (hasValidationOperation()) { + if (!getValidationOperation().equals(other.getValidationOperation())) return false; + } + if (hasGcsSource() != other.hasGcsSource()) return false; + if (hasGcsSource()) { + if (!getGcsSource().equals(other.getGcsSource())) 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 (!getVersion().equals(other.getVersion())) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 10: + if (!getAsset().equals(other.getAsset())) return false; + break; + case 11: + if (!getGcsPath().equals(other.getGcsPath())) return false; + break; + case 15: + if (!getGitSource().equals(other.getGitSource())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasInputs()) { + hash = (37 * hash) + INPUTS_FIELD_NUMBER; + hash = (53 * hash) + getInputs().hashCode(); + } + hash = (37 * hash) + VALIDATION_STATUS_FIELD_NUMBER; + hash = (53 * hash) + validationStatus_; + if (hasValidationOperation()) { + hash = (37 * hash) + VALIDATION_OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getValidationOperation().hashCode(); + } + if (hasGcsSource()) { + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + switch (sourceCase_) { + case 10: + hash = (37 * hash) + ASSET_FIELD_NUMBER; + hash = (53 * hash) + getAsset().hashCode(); + break; + case 11: + hash = (37 * hash) + GCS_PATH_FIELD_NUMBER; + hash = (53 * hash) + getGcsPath().hashCode(); + break; + case 15: + hash = (37 * hash) + GIT_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGitSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.privatecatalog.v1beta1.AssetReference parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.AssetReference parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.AssetReference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.AssetReference parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.AssetReference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.AssetReference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.AssetReference parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.AssetReference parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.AssetReference parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.AssetReference parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.AssetReference parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.AssetReference parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.privatecatalog.v1beta1.AssetReference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Defines the reference of an asset belonging to a product.
+   * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.AssetReference} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.privatecatalog.v1beta1.AssetReference) + com.google.cloud.privatecatalog.v1beta1.AssetReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_AssetReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_AssetReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.AssetReference.class, + com.google.cloud.privatecatalog.v1beta1.AssetReference.Builder.class); + } + + // Construct using com.google.cloud.privatecatalog.v1beta1.AssetReference.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = ""; + + description_ = ""; + + if (inputsBuilder_ == null) { + inputs_ = null; + } else { + inputs_ = null; + inputsBuilder_ = null; + } + validationStatus_ = 0; + + if (validationOperationBuilder_ == null) { + validationOperation_ = null; + } else { + validationOperation_ = null; + validationOperationBuilder_ = null; + } + if (gcsSourceBuilder_ == null) { + gcsSource_ = null; + } else { + gcsSource_ = null; + gcsSourceBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + version_ = ""; + + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_AssetReference_descriptor; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.AssetReference getDefaultInstanceForType() { + return com.google.cloud.privatecatalog.v1beta1.AssetReference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.AssetReference build() { + com.google.cloud.privatecatalog.v1beta1.AssetReference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.AssetReference buildPartial() { + com.google.cloud.privatecatalog.v1beta1.AssetReference result = + new com.google.cloud.privatecatalog.v1beta1.AssetReference(this); + result.id_ = id_; + result.description_ = description_; + if (inputsBuilder_ == null) { + result.inputs_ = inputs_; + } else { + result.inputs_ = inputsBuilder_.build(); + } + result.validationStatus_ = validationStatus_; + if (validationOperationBuilder_ == null) { + result.validationOperation_ = validationOperation_; + } else { + result.validationOperation_ = validationOperationBuilder_.build(); + } + if (sourceCase_ == 10) { + result.source_ = source_; + } + if (sourceCase_ == 11) { + result.source_ = source_; + } + if (sourceCase_ == 15) { + if (gitSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = gitSourceBuilder_.build(); + } + } + if (gcsSourceBuilder_ == null) { + result.gcsSource_ = gcsSource_; + } else { + result.gcsSource_ = gcsSourceBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.version_ = version_; + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.privatecatalog.v1beta1.AssetReference) { + return mergeFrom((com.google.cloud.privatecatalog.v1beta1.AssetReference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.privatecatalog.v1beta1.AssetReference other) { + if (other == com.google.cloud.privatecatalog.v1beta1.AssetReference.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasInputs()) { + mergeInputs(other.getInputs()); + } + if (other.validationStatus_ != 0) { + setValidationStatusValue(other.getValidationStatusValue()); + } + if (other.hasValidationOperation()) { + mergeValidationOperation(other.getValidationOperation()); + } + if (other.hasGcsSource()) { + mergeGcsSource(other.getGcsSource()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + switch (other.getSourceCase()) { + case ASSET: + { + sourceCase_ = 10; + source_ = other.source_; + onChanged(); + break; + } + case GCS_PATH: + { + sourceCase_ = 11; + source_ = other.source_; + onChanged(); + break; + } + case GIT_SOURCE: + { + mergeGitSource(other.getGitSource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.privatecatalog.v1beta1.AssetReference parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.privatecatalog.v1beta1.AssetReference) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * Output only. A unique identifier among asset references in a product.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. A unique identifier among asset references in a product.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. A unique identifier among asset references in a product.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A unique identifier among asset references in a product.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A unique identifier among asset references in a product.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Output only. The human-readable description of the referenced asset. Maximum 256
+     * characters in length.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The human-readable description of the referenced asset. Maximum 256
+     * characters in length.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The human-readable description of the referenced asset. Maximum 256
+     * characters in length.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. The human-readable description of the referenced asset. Maximum 256
+     * characters in length.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The human-readable description of the referenced asset. Maximum 256
+     * characters in length.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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.cloud.privatecatalog.v1beta1.Inputs inputs_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.Inputs, + com.google.cloud.privatecatalog.v1beta1.Inputs.Builder, + com.google.cloud.privatecatalog.v1beta1.InputsOrBuilder> + inputsBuilder_; + /** + * + * + *
+     * Output only. The definition of input parameters to hydrate the asset template.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the inputs field is set. + */ + public boolean hasInputs() { + return inputsBuilder_ != null || inputs_ != null; + } + /** + * + * + *
+     * Output only. The definition of input parameters to hydrate the asset template.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The inputs. + */ + public com.google.cloud.privatecatalog.v1beta1.Inputs getInputs() { + if (inputsBuilder_ == null) { + return inputs_ == null + ? com.google.cloud.privatecatalog.v1beta1.Inputs.getDefaultInstance() + : inputs_; + } else { + return inputsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The definition of input parameters to hydrate the asset template.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setInputs(com.google.cloud.privatecatalog.v1beta1.Inputs value) { + if (inputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputs_ = value; + onChanged(); + } else { + inputsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The definition of input parameters to hydrate the asset template.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setInputs( + com.google.cloud.privatecatalog.v1beta1.Inputs.Builder builderForValue) { + if (inputsBuilder_ == null) { + inputs_ = builderForValue.build(); + onChanged(); + } else { + inputsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The definition of input parameters to hydrate the asset template.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeInputs(com.google.cloud.privatecatalog.v1beta1.Inputs value) { + if (inputsBuilder_ == null) { + if (inputs_ != null) { + inputs_ = + com.google.cloud.privatecatalog.v1beta1.Inputs.newBuilder(inputs_) + .mergeFrom(value) + .buildPartial(); + } else { + inputs_ = value; + } + onChanged(); + } else { + inputsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The definition of input parameters to hydrate the asset template.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearInputs() { + if (inputsBuilder_ == null) { + inputs_ = null; + onChanged(); + } else { + inputs_ = null; + inputsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The definition of input parameters to hydrate the asset template.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.privatecatalog.v1beta1.Inputs.Builder getInputsBuilder() { + + onChanged(); + return getInputsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The definition of input parameters to hydrate the asset template.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.privatecatalog.v1beta1.InputsOrBuilder getInputsOrBuilder() { + if (inputsBuilder_ != null) { + return inputsBuilder_.getMessageOrBuilder(); + } else { + return inputs_ == null + ? com.google.cloud.privatecatalog.v1beta1.Inputs.getDefaultInstance() + : inputs_; + } + } + /** + * + * + *
+     * Output only. The definition of input parameters to hydrate the asset template.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.Inputs, + com.google.cloud.privatecatalog.v1beta1.Inputs.Builder, + com.google.cloud.privatecatalog.v1beta1.InputsOrBuilder> + getInputsFieldBuilder() { + if (inputsBuilder_ == null) { + inputsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.Inputs, + com.google.cloud.privatecatalog.v1beta1.Inputs.Builder, + com.google.cloud.privatecatalog.v1beta1.InputsOrBuilder>( + getInputs(), getParentForChildren(), isClean()); + inputs_ = null; + } + return inputsBuilder_; + } + + private int validationStatus_ = 0; + /** + * + * + *
+     * Output only. The current state of the asset reference.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for validationStatus. + */ + @java.lang.Override + public int getValidationStatusValue() { + return validationStatus_; + } + /** + * + * + *
+     * Output only. The current state of the asset reference.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for validationStatus to set. + * @return This builder for chaining. + */ + public Builder setValidationStatusValue(int value) { + + validationStatus_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the asset reference.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The validationStatus. + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState + getValidationStatus() { + @SuppressWarnings("deprecation") + com.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState result = + com.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState.valueOf( + validationStatus_); + return result == null + ? com.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The current state of the asset reference.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The validationStatus to set. + * @return This builder for chaining. + */ + public Builder setValidationStatus( + com.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState value) { + if (value == null) { + throw new NullPointerException(); + } + + validationStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the asset reference.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearValidationStatus() { + + validationStatus_ = 0; + onChanged(); + return this; + } + + private com.google.longrunning.Operation validationOperation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.longrunning.Operation, + com.google.longrunning.Operation.Builder, + com.google.longrunning.OperationOrBuilder> + validationOperationBuilder_; + /** + * + * + *
+     * Output only. The validation process metadata.
+     * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the validationOperation field is set. + */ + public boolean hasValidationOperation() { + return validationOperationBuilder_ != null || validationOperation_ != null; + } + /** + * + * + *
+     * Output only. The validation process metadata.
+     * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The validationOperation. + */ + public com.google.longrunning.Operation getValidationOperation() { + if (validationOperationBuilder_ == null) { + return validationOperation_ == null + ? com.google.longrunning.Operation.getDefaultInstance() + : validationOperation_; + } else { + return validationOperationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The validation process metadata.
+     * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setValidationOperation(com.google.longrunning.Operation value) { + if (validationOperationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + validationOperation_ = value; + onChanged(); + } else { + validationOperationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The validation process metadata.
+     * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setValidationOperation( + com.google.longrunning.Operation.Builder builderForValue) { + if (validationOperationBuilder_ == null) { + validationOperation_ = builderForValue.build(); + onChanged(); + } else { + validationOperationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The validation process metadata.
+     * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeValidationOperation(com.google.longrunning.Operation value) { + if (validationOperationBuilder_ == null) { + if (validationOperation_ != null) { + validationOperation_ = + com.google.longrunning.Operation.newBuilder(validationOperation_) + .mergeFrom(value) + .buildPartial(); + } else { + validationOperation_ = value; + } + onChanged(); + } else { + validationOperationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The validation process metadata.
+     * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearValidationOperation() { + if (validationOperationBuilder_ == null) { + validationOperation_ = null; + onChanged(); + } else { + validationOperation_ = null; + validationOperationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The validation process metadata.
+     * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.longrunning.Operation.Builder getValidationOperationBuilder() { + + onChanged(); + return getValidationOperationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The validation process metadata.
+     * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.longrunning.OperationOrBuilder getValidationOperationOrBuilder() { + if (validationOperationBuilder_ != null) { + return validationOperationBuilder_.getMessageOrBuilder(); + } else { + return validationOperation_ == null + ? com.google.longrunning.Operation.getDefaultInstance() + : validationOperation_; + } + } + /** + * + * + *
+     * Output only. The validation process metadata.
+     * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.longrunning.Operation, + com.google.longrunning.Operation.Builder, + com.google.longrunning.OperationOrBuilder> + getValidationOperationFieldBuilder() { + if (validationOperationBuilder_ == null) { + validationOperationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.longrunning.Operation, + com.google.longrunning.Operation.Builder, + com.google.longrunning.OperationOrBuilder>( + getValidationOperation(), getParentForChildren(), isClean()); + validationOperation_ = null; + } + return validationOperationBuilder_; + } + + /** + * + * + *
+     * Output only. The asset resource name if an asset is hosted by Private Catalog.
+     * 
+ * + * string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the asset field is set. + */ + @java.lang.Override + public boolean hasAsset() { + return sourceCase_ == 10; + } + /** + * + * + *
+     * Output only. The asset resource name if an asset is hosted by Private Catalog.
+     * 
+ * + * string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The asset. + */ + @java.lang.Override + public java.lang.String getAsset() { + java.lang.Object ref = ""; + if (sourceCase_ == 10) { + ref = source_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 10) { + source_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The asset resource name if an asset is hosted by Private Catalog.
+     * 
+ * + * string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for asset. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAssetBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 10) { + ref = source_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 10) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The asset resource name if an asset is hosted by Private Catalog.
+     * 
+ * + * string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The asset to set. + * @return This builder for chaining. + */ + public Builder setAsset(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCase_ = 10; + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The asset resource name if an asset is hosted by Private Catalog.
+     * 
+ * + * string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAsset() { + if (sourceCase_ == 10) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The asset resource name if an asset is hosted by Private Catalog.
+     * 
+ * + * string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for asset to set. + * @return This builder for chaining. + */ + public Builder setAssetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCase_ = 10; + source_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The cloud storage object path.
+     * 
+ * + * string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the gcsPath field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasGcsPath() { + return sourceCase_ == 11; + } + /** + * + * + *
+     * Output only. The cloud storage object path.
+     * 
+ * + * string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The gcsPath. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getGcsPath() { + java.lang.Object ref = ""; + if (sourceCase_ == 11) { + ref = source_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 11) { + source_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The cloud storage object path.
+     * 
+ * + * string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for gcsPath. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getGcsPathBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 11) { + ref = source_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 11) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The cloud storage object path.
+     * 
+ * + * string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The gcsPath to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setGcsPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCase_ = 11; + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The cloud storage object path.
+     * 
+ * + * string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearGcsPath() { + if (sourceCase_ == 11) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The cloud storage object path.
+     * 
+ * + * string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for gcsPath to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setGcsPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCase_ = 11; + source_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.GitSource, + com.google.cloud.privatecatalog.v1beta1.GitSource.Builder, + com.google.cloud.privatecatalog.v1beta1.GitSourceOrBuilder> + gitSourceBuilder_; + /** + * + * + *
+     * Output only. The git source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the gitSource field is set. + */ + @java.lang.Override + public boolean hasGitSource() { + return sourceCase_ == 15; + } + /** + * + * + *
+     * Output only. The git source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The gitSource. + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GitSource getGitSource() { + if (gitSourceBuilder_ == null) { + if (sourceCase_ == 15) { + return (com.google.cloud.privatecatalog.v1beta1.GitSource) source_; + } + return com.google.cloud.privatecatalog.v1beta1.GitSource.getDefaultInstance(); + } else { + if (sourceCase_ == 15) { + return gitSourceBuilder_.getMessage(); + } + return com.google.cloud.privatecatalog.v1beta1.GitSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. The git source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setGitSource(com.google.cloud.privatecatalog.v1beta1.GitSource value) { + if (gitSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gitSourceBuilder_.setMessage(value); + } + sourceCase_ = 15; + return this; + } + /** + * + * + *
+     * Output only. The git source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setGitSource( + com.google.cloud.privatecatalog.v1beta1.GitSource.Builder builderForValue) { + if (gitSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gitSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 15; + return this; + } + /** + * + * + *
+     * Output only. The git source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeGitSource(com.google.cloud.privatecatalog.v1beta1.GitSource value) { + if (gitSourceBuilder_ == null) { + if (sourceCase_ == 15 + && source_ != com.google.cloud.privatecatalog.v1beta1.GitSource.getDefaultInstance()) { + source_ = + com.google.cloud.privatecatalog.v1beta1.GitSource.newBuilder( + (com.google.cloud.privatecatalog.v1beta1.GitSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 15) { + gitSourceBuilder_.mergeFrom(value); + } + gitSourceBuilder_.setMessage(value); + } + sourceCase_ = 15; + return this; + } + /** + * + * + *
+     * Output only. The git source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearGitSource() { + if (gitSourceBuilder_ == null) { + if (sourceCase_ == 15) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 15) { + sourceCase_ = 0; + source_ = null; + } + gitSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. The git source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.privatecatalog.v1beta1.GitSource.Builder getGitSourceBuilder() { + return getGitSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The git source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GitSourceOrBuilder getGitSourceOrBuilder() { + if ((sourceCase_ == 15) && (gitSourceBuilder_ != null)) { + return gitSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 15) { + return (com.google.cloud.privatecatalog.v1beta1.GitSource) source_; + } + return com.google.cloud.privatecatalog.v1beta1.GitSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. The git source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.GitSource, + com.google.cloud.privatecatalog.v1beta1.GitSource.Builder, + com.google.cloud.privatecatalog.v1beta1.GitSourceOrBuilder> + getGitSourceFieldBuilder() { + if (gitSourceBuilder_ == null) { + if (!(sourceCase_ == 15)) { + source_ = com.google.cloud.privatecatalog.v1beta1.GitSource.getDefaultInstance(); + } + gitSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.GitSource, + com.google.cloud.privatecatalog.v1beta1.GitSource.Builder, + com.google.cloud.privatecatalog.v1beta1.GitSourceOrBuilder>( + (com.google.cloud.privatecatalog.v1beta1.GitSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 15; + onChanged(); + ; + return gitSourceBuilder_; + } + + private com.google.cloud.privatecatalog.v1beta1.GcsSource gcsSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.GcsSource, + com.google.cloud.privatecatalog.v1beta1.GcsSource.Builder, + com.google.cloud.privatecatalog.v1beta1.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Output only. The cloud storage source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the gcsSource field is set. + */ + public boolean hasGcsSource() { + return gcsSourceBuilder_ != null || gcsSource_ != null; + } + /** + * + * + *
+     * Output only. The cloud storage source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The gcsSource. + */ + public com.google.cloud.privatecatalog.v1beta1.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + return gcsSource_ == null + ? com.google.cloud.privatecatalog.v1beta1.GcsSource.getDefaultInstance() + : gcsSource_; + } else { + return gcsSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The cloud storage source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setGcsSource(com.google.cloud.privatecatalog.v1beta1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcsSource_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The cloud storage source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setGcsSource( + com.google.cloud.privatecatalog.v1beta1.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + gcsSource_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The cloud storage source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeGcsSource(com.google.cloud.privatecatalog.v1beta1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (gcsSource_ != null) { + gcsSource_ = + com.google.cloud.privatecatalog.v1beta1.GcsSource.newBuilder(gcsSource_) + .mergeFrom(value) + .buildPartial(); + } else { + gcsSource_ = value; + } + onChanged(); + } else { + gcsSourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The cloud storage source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + gcsSource_ = null; + onChanged(); + } else { + gcsSource_ = null; + gcsSourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The cloud storage source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.privatecatalog.v1beta1.GcsSource.Builder getGcsSourceBuilder() { + + onChanged(); + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The cloud storage source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.privatecatalog.v1beta1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (gcsSourceBuilder_ != null) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + return gcsSource_ == null + ? com.google.cloud.privatecatalog.v1beta1.GcsSource.getDefaultInstance() + : gcsSource_; + } + } + /** + * + * + *
+     * Output only. The cloud storage source.
+     * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.GcsSource, + com.google.cloud.privatecatalog.v1beta1.GcsSource.Builder, + com.google.cloud.privatecatalog.v1beta1.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.GcsSource, + com.google.cloud.privatecatalog.v1beta1.GcsSource.Builder, + com.google.cloud.privatecatalog.v1beta1.GcsSourceOrBuilder>( + getGcsSource(), getParentForChildren(), isClean()); + gcsSource_ = null; + } + return gcsSourceBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The creation timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The creation timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The creation timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 12 [(.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; + } + /** + * + * + *
+     * Output only. The creation timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 12 [(.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; + } + /** + * + * + *
+     * Output only. The creation timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 12 [(.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; + } + /** + * + * + *
+     * Output only. The creation timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The creation timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The creation timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The creation timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last update timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last update timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last update timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.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; + } + /** + * + * + *
+     * Output only. The last update timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.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; + } + /** + * + * + *
+     * Output only. The last update timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.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; + } + /** + * + * + *
+     * Output only. The last update timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last update timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last update timestamp of the asset reference.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+     * The version of the source used for this asset reference.
+     * 
+ * + * string version = 14 [deprecated = true]; + * + * @return The version. + */ + @java.lang.Deprecated + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The version of the source used for this asset reference.
+     * 
+ * + * string version = 14 [deprecated = true]; + * + * @return The bytes for version. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The version of the source used for this asset reference.
+     * 
+ * + * string version = 14 [deprecated = true]; + * + * @param value The version to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The version of the source used for this asset reference.
+     * 
+ * + * string version = 14 [deprecated = true]; + * + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * The version of the source used for this asset reference.
+     * 
+ * + * string version = 14 [deprecated = true]; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.privatecatalog.v1beta1.AssetReference) + } + + // @@protoc_insertion_point(class_scope:google.cloud.privatecatalog.v1beta1.AssetReference) + private static final com.google.cloud.privatecatalog.v1beta1.AssetReference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.privatecatalog.v1beta1.AssetReference(); + } + + public static com.google.cloud.privatecatalog.v1beta1.AssetReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AssetReference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AssetReference(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.AssetReference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/AssetReferenceOrBuilder.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/AssetReferenceOrBuilder.java new file mode 100644 index 00000000..6cdd1b8a --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/AssetReferenceOrBuilder.java @@ -0,0 +1,455 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public interface AssetReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.privatecatalog.v1beta1.AssetReference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. A unique identifier among asset references in a product.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Output only. A unique identifier among asset references in a product.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Output only. The human-readable description of the referenced asset. Maximum 256
+   * characters in length.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. The human-readable description of the referenced asset. Maximum 256
+   * characters in length.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The definition of input parameters to hydrate the asset template.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the inputs field is set. + */ + boolean hasInputs(); + /** + * + * + *
+   * Output only. The definition of input parameters to hydrate the asset template.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The inputs. + */ + com.google.cloud.privatecatalog.v1beta1.Inputs getInputs(); + /** + * + * + *
+   * Output only. The definition of input parameters to hydrate the asset template.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.privatecatalog.v1beta1.InputsOrBuilder getInputsOrBuilder(); + + /** + * + * + *
+   * Output only. The current state of the asset reference.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for validationStatus. + */ + int getValidationStatusValue(); + /** + * + * + *
+   * Output only. The current state of the asset reference.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The validationStatus. + */ + com.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState getValidationStatus(); + + /** + * + * + *
+   * Output only. The validation process metadata.
+   * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the validationOperation field is set. + */ + boolean hasValidationOperation(); + /** + * + * + *
+   * Output only. The validation process metadata.
+   * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The validationOperation. + */ + com.google.longrunning.Operation getValidationOperation(); + /** + * + * + *
+   * Output only. The validation process metadata.
+   * 
+ * + * + * .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.longrunning.OperationOrBuilder getValidationOperationOrBuilder(); + + /** + * + * + *
+   * Output only. The asset resource name if an asset is hosted by Private Catalog.
+   * 
+ * + * string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the asset field is set. + */ + boolean hasAsset(); + /** + * + * + *
+   * Output only. The asset resource name if an asset is hosted by Private Catalog.
+   * 
+ * + * string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The asset. + */ + java.lang.String getAsset(); + /** + * + * + *
+   * Output only. The asset resource name if an asset is hosted by Private Catalog.
+   * 
+ * + * string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for asset. + */ + com.google.protobuf.ByteString getAssetBytes(); + + /** + * + * + *
+   * Output only. The cloud storage object path.
+   * 
+ * + * string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the gcsPath field is set. + */ + @java.lang.Deprecated + boolean hasGcsPath(); + /** + * + * + *
+   * Output only. The cloud storage object path.
+   * 
+ * + * string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The gcsPath. + */ + @java.lang.Deprecated + java.lang.String getGcsPath(); + /** + * + * + *
+   * Output only. The cloud storage object path.
+   * 
+ * + * string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for gcsPath. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getGcsPathBytes(); + + /** + * + * + *
+   * Output only. The git source.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the gitSource field is set. + */ + boolean hasGitSource(); + /** + * + * + *
+   * Output only. The git source.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The gitSource. + */ + com.google.cloud.privatecatalog.v1beta1.GitSource getGitSource(); + /** + * + * + *
+   * Output only. The git source.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.privatecatalog.v1beta1.GitSourceOrBuilder getGitSourceOrBuilder(); + + /** + * + * + *
+   * Output only. The cloud storage source.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * Output only. The cloud storage source.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The gcsSource. + */ + com.google.cloud.privatecatalog.v1beta1.GcsSource getGcsSource(); + /** + * + * + *
+   * Output only. The cloud storage source.
+   * 
+ * + * + * .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.privatecatalog.v1beta1.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * Output only. The creation timestamp of the asset reference.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The creation timestamp of the asset reference.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The creation timestamp of the asset reference.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last update timestamp of the asset reference.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of the asset reference.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of the asset reference.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The version of the source used for this asset reference.
+   * 
+ * + * string version = 14 [deprecated = true]; + * + * @return The version. + */ + @java.lang.Deprecated + java.lang.String getVersion(); + /** + * + * + *
+   * The version of the source used for this asset reference.
+   * 
+ * + * string version = 14 [deprecated = true]; + * + * @return The bytes for version. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getVersionBytes(); + + public com.google.cloud.privatecatalog.v1beta1.AssetReference.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Catalog.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Catalog.java new file mode 100644 index 00000000..f7504b36 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Catalog.java @@ -0,0 +1,1588 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +/** + * + * + *
+ * The readonly representation of a catalog computed with a given resource
+ * context.
+ * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.Catalog} + */ +public final class Catalog extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.privatecatalog.v1beta1.Catalog) + CatalogOrBuilder { + private static final long serialVersionUID = 0L; + // Use Catalog.newBuilder() to construct. + private Catalog(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Catalog() { + name_ = ""; + displayName_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Catalog(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Catalog( + 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 (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Catalog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Catalog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.Catalog.class, + com.google.cloud.privatecatalog.v1beta1.Catalog.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the target catalog, in the format of
+   * `catalogs/{catalog}'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the target catalog, in the format of
+   * `catalogs/{catalog}'.
+   * 
+ * + * 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 DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Output only. The descriptive name of the catalog as it appears in UIs.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The descriptive name of the catalog as it appears in UIs.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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_; + /** + * + * + *
+   * Output only. The description of the catalog.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The description of the catalog.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the catalog 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; + } + /** + * + * + *
+   * Output only. The time when the catalog 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_; + } + /** + * + * + *
+   * Output only. The time when the catalog 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_; + /** + * + * + *
+   * Output only. The time when the catalog was last 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; + } + /** + * + * + *
+   * Output only. The time when the catalog was last 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_; + } + /** + * + * + *
+   * Output only. The time when the catalog was last 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.privatecatalog.v1beta1.Catalog)) { + return super.equals(obj); + } + com.google.cloud.privatecatalog.v1beta1.Catalog other = + (com.google.cloud.privatecatalog.v1beta1.Catalog) 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.cloud.privatecatalog.v1beta1.Catalog parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.Catalog parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Catalog parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.Catalog parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Catalog parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.Catalog parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Catalog parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.Catalog parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Catalog parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.Catalog parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Catalog parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.Catalog parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.privatecatalog.v1beta1.Catalog prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 readonly representation of a catalog computed with a given resource
+   * context.
+   * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.Catalog} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.privatecatalog.v1beta1.Catalog) + com.google.cloud.privatecatalog.v1beta1.CatalogOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Catalog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Catalog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.Catalog.class, + com.google.cloud.privatecatalog.v1beta1.Catalog.Builder.class); + } + + // Construct using com.google.cloud.privatecatalog.v1beta1.Catalog.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.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Catalog_descriptor; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Catalog getDefaultInstanceForType() { + return com.google.cloud.privatecatalog.v1beta1.Catalog.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Catalog build() { + com.google.cloud.privatecatalog.v1beta1.Catalog result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Catalog buildPartial() { + com.google.cloud.privatecatalog.v1beta1.Catalog result = + new com.google.cloud.privatecatalog.v1beta1.Catalog(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.cloud.privatecatalog.v1beta1.Catalog) { + return mergeFrom((com.google.cloud.privatecatalog.v1beta1.Catalog) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.privatecatalog.v1beta1.Catalog other) { + if (other == com.google.cloud.privatecatalog.v1beta1.Catalog.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.cloud.privatecatalog.v1beta1.Catalog parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.privatecatalog.v1beta1.Catalog) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the target catalog, in the format of
+     * `catalogs/{catalog}'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the target catalog, in the format of
+     * `catalogs/{catalog}'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the target catalog, in the format of
+     * `catalogs/{catalog}'.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Output only. The resource name of the target catalog, in the format of
+     * `catalogs/{catalog}'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the target catalog, in the format of
+     * `catalogs/{catalog}'.
+     * 
+ * + * 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 displayName_ = ""; + /** + * + * + *
+     * Output only. The descriptive name of the catalog as it appears in UIs.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The descriptive name of the catalog as it appears in UIs.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The descriptive name of the catalog as it appears in UIs.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. The descriptive name of the catalog as it appears in UIs.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The descriptive name of the catalog as it appears in UIs.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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_ = ""; + /** + * + * + *
+     * Output only. The description of the catalog.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The description of the catalog.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The description of the catalog.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. The description of the catalog.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The description of the catalog.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the catalog 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; + } + /** + * + * + *
+     * Output only. The time when the catalog 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(); + } + } + /** + * + * + *
+     * Output only. The time when the catalog 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; + } + /** + * + * + *
+     * Output only. The time when the catalog 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; + } + /** + * + * + *
+     * Output only. The time when the catalog 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; + } + /** + * + * + *
+     * Output only. The time when the catalog 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; + } + /** + * + * + *
+     * Output only. The time when the catalog 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(); + } + /** + * + * + *
+     * Output only. The time when the catalog 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_; + } + } + /** + * + * + *
+     * Output only. The time when the catalog 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_; + /** + * + * + *
+     * Output only. The time when the catalog was last 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; + } + /** + * + * + *
+     * Output only. The time when the catalog was last 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(); + } + } + /** + * + * + *
+     * Output only. The time when the catalog was last 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; + } + /** + * + * + *
+     * Output only. The time when the catalog was last 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; + } + /** + * + * + *
+     * Output only. The time when the catalog was last 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; + } + /** + * + * + *
+     * Output only. The time when the catalog was last 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; + } + /** + * + * + *
+     * Output only. The time when the catalog was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the catalog was last 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_; + } + } + /** + * + * + *
+     * Output only. The time when the catalog was last 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.cloud.privatecatalog.v1beta1.Catalog) + } + + // @@protoc_insertion_point(class_scope:google.cloud.privatecatalog.v1beta1.Catalog) + private static final com.google.cloud.privatecatalog.v1beta1.Catalog DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.privatecatalog.v1beta1.Catalog(); + } + + public static com.google.cloud.privatecatalog.v1beta1.Catalog getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Catalog parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Catalog(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Catalog getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/CatalogName.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/CatalogName.java new file mode 100644 index 00000000..5808d174 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/CatalogName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.privatecatalog.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 CatalogName implements ResourceName { + private static final PathTemplate CATALOG = + PathTemplate.createWithoutUrlEncoding("catalogs/{catalog}"); + private volatile Map fieldValuesMap; + private final String catalog; + + @Deprecated + protected CatalogName() { + catalog = null; + } + + private CatalogName(Builder builder) { + catalog = Preconditions.checkNotNull(builder.getCatalog()); + } + + public String getCatalog() { + return catalog; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CatalogName of(String catalog) { + return newBuilder().setCatalog(catalog).build(); + } + + public static String format(String catalog) { + return newBuilder().setCatalog(catalog).build().toString(); + } + + public static CatalogName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + CATALOG.validatedMatch( + formattedString, "CatalogName.parse: formattedString not in valid format"); + return of(matchMap.get("catalog")); + } + + 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 (CatalogName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return CATALOG.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (catalog != null) { + fieldMapBuilder.put("catalog", catalog); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return CATALOG.instantiate("catalog", catalog); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CatalogName that = ((CatalogName) o); + return Objects.equals(this.catalog, that.catalog); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(catalog); + return h; + } + + /** Builder for catalogs/{catalog}. */ + public static class Builder { + private String catalog; + + protected Builder() {} + + public String getCatalog() { + return catalog; + } + + public Builder setCatalog(String catalog) { + this.catalog = catalog; + return this; + } + + private Builder(CatalogName catalogName) { + catalog = catalogName.catalog; + } + + public CatalogName build() { + return new CatalogName(this); + } + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/CatalogOrBuilder.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/CatalogOrBuilder.java new file mode 100644 index 00000000..ca9ca5af --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/CatalogOrBuilder.java @@ -0,0 +1,178 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public interface CatalogOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.privatecatalog.v1beta1.Catalog) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the target catalog, in the format of
+   * `catalogs/{catalog}'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the target catalog, in the format of
+   * `catalogs/{catalog}'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The descriptive name of the catalog as it appears in UIs.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Output only. The descriptive name of the catalog as it appears in UIs.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The description of the catalog.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. The description of the catalog.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The time when the catalog was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time when the catalog was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time when the catalog was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the catalog was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time when the catalog was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time when the catalog was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GcsSource.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GcsSource.java new file mode 100644 index 00000000..49c19e07 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GcsSource.java @@ -0,0 +1,1023 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +/** + * + * + *
+ * Defines how to access Cloud Storage source.
+ * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.GcsSource} + */ +public final class GcsSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.privatecatalog.v1beta1.GcsSource) + GcsSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsSource.newBuilder() to construct. + private GcsSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsSource() { + gcsPath_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GcsSource( + 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(); + + gcsPath_ = s; + break; + } + case 16: + { + generation_ = input.readInt64(); + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.GcsSource.class, + com.google.cloud.privatecatalog.v1beta1.GcsSource.Builder.class); + } + + public static final int GCS_PATH_FIELD_NUMBER = 1; + private volatile java.lang.Object gcsPath_; + /** + * + * + *
+   * Output only. the cloud storage object path.
+   * 
+ * + * string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The gcsPath. + */ + @java.lang.Override + public java.lang.String getGcsPath() { + java.lang.Object ref = gcsPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gcsPath_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. the cloud storage object path.
+   * 
+ * + * string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for gcsPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGcsPathBytes() { + java.lang.Object ref = gcsPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gcsPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GENERATION_FIELD_NUMBER = 2; + private long generation_; + /** + * + * + *
+   * Output only. Generation of the object, which is set when the content of an object starts
+   * being written.
+   * 
+ * + * int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time when the object metadata was last changed.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the object metadata was last changed.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.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 object metadata was last changed.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.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 (!getGcsPathBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gcsPath_); + } + if (generation_ != 0L) { + output.writeInt64(2, generation_); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getGcsPathBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gcsPath_); + } + if (generation_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, generation_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, 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.cloud.privatecatalog.v1beta1.GcsSource)) { + return super.equals(obj); + } + com.google.cloud.privatecatalog.v1beta1.GcsSource other = + (com.google.cloud.privatecatalog.v1beta1.GcsSource) obj; + + if (!getGcsPath().equals(other.getGcsPath())) return false; + if (getGeneration() != other.getGeneration()) 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) + GCS_PATH_FIELD_NUMBER; + hash = (53 * hash) + getGcsPath().hashCode(); + hash = (37 * hash) + GENERATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration()); + 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.cloud.privatecatalog.v1beta1.GcsSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.GcsSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.GcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.GcsSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.GcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.GcsSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.GcsSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.GcsSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.GcsSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.GcsSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.GcsSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.GcsSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.privatecatalog.v1beta1.GcsSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Defines how to access Cloud Storage source.
+   * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.GcsSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.privatecatalog.v1beta1.GcsSource) + com.google.cloud.privatecatalog.v1beta1.GcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.GcsSource.class, + com.google.cloud.privatecatalog.v1beta1.GcsSource.Builder.class); + } + + // Construct using com.google.cloud.privatecatalog.v1beta1.GcsSource.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(); + gcsPath_ = ""; + + generation_ = 0L; + + 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.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_GcsSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GcsSource getDefaultInstanceForType() { + return com.google.cloud.privatecatalog.v1beta1.GcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GcsSource build() { + com.google.cloud.privatecatalog.v1beta1.GcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GcsSource buildPartial() { + com.google.cloud.privatecatalog.v1beta1.GcsSource result = + new com.google.cloud.privatecatalog.v1beta1.GcsSource(this); + result.gcsPath_ = gcsPath_; + result.generation_ = generation_; + 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.cloud.privatecatalog.v1beta1.GcsSource) { + return mergeFrom((com.google.cloud.privatecatalog.v1beta1.GcsSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.privatecatalog.v1beta1.GcsSource other) { + if (other == com.google.cloud.privatecatalog.v1beta1.GcsSource.getDefaultInstance()) + return this; + if (!other.getGcsPath().isEmpty()) { + gcsPath_ = other.gcsPath_; + onChanged(); + } + if (other.getGeneration() != 0L) { + setGeneration(other.getGeneration()); + } + 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.cloud.privatecatalog.v1beta1.GcsSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.privatecatalog.v1beta1.GcsSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object gcsPath_ = ""; + /** + * + * + *
+     * Output only. the cloud storage object path.
+     * 
+ * + * string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The gcsPath. + */ + public java.lang.String getGcsPath() { + java.lang.Object ref = gcsPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gcsPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. the cloud storage object path.
+     * 
+ * + * string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for gcsPath. + */ + public com.google.protobuf.ByteString getGcsPathBytes() { + java.lang.Object ref = gcsPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gcsPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. the cloud storage object path.
+     * 
+ * + * string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The gcsPath to set. + * @return This builder for chaining. + */ + public Builder setGcsPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + gcsPath_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. the cloud storage object path.
+     * 
+ * + * string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearGcsPath() { + + gcsPath_ = getDefaultInstance().getGcsPath(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. the cloud storage object path.
+     * 
+ * + * string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for gcsPath to set. + * @return This builder for chaining. + */ + public Builder setGcsPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + gcsPath_ = value; + onChanged(); + return this; + } + + private long generation_; + /** + * + * + *
+     * Output only. Generation of the object, which is set when the content of an object starts
+     * being written.
+     * 
+ * + * int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + /** + * + * + *
+     * Output only. Generation of the object, which is set when the content of an object starts
+     * being written.
+     * 
+ * + * int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The generation to set. + * @return This builder for chaining. + */ + public Builder setGeneration(long value) { + + generation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Generation of the object, which is set when the content of an object starts
+     * being written.
+     * 
+ * + * int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearGeneration() { + + generation_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the object metadata was last changed.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the object metadata was last changed.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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 object metadata was last changed.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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; + } + /** + * + * + *
+     * Output only. The time when the object metadata was last changed.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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; + } + /** + * + * + *
+     * Output only. The time when the object metadata was last changed.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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; + } + /** + * + * + *
+     * Output only. The time when the object metadata was last changed.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the object metadata was last changed.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the object metadata was last changed.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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 object metadata was last changed.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + 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.cloud.privatecatalog.v1beta1.GcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.privatecatalog.v1beta1.GcsSource) + private static final com.google.cloud.privatecatalog.v1beta1.GcsSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.privatecatalog.v1beta1.GcsSource(); + } + + public static com.google.cloud.privatecatalog.v1beta1.GcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GcsSource(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GcsSourceOrBuilder.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GcsSourceOrBuilder.java new file mode 100644 index 00000000..220ae453 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GcsSourceOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public interface GcsSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.privatecatalog.v1beta1.GcsSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. the cloud storage object path.
+   * 
+ * + * string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The gcsPath. + */ + java.lang.String getGcsPath(); + /** + * + * + *
+   * Output only. the cloud storage object path.
+   * 
+ * + * string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for gcsPath. + */ + com.google.protobuf.ByteString getGcsPathBytes(); + + /** + * + * + *
+   * Output only. Generation of the object, which is set when the content of an object starts
+   * being written.
+   * 
+ * + * int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The generation. + */ + long getGeneration(); + + /** + * + * + *
+   * Output only. The time when the object metadata was last changed.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time when the object metadata was last changed.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time when the object metadata was last changed.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GitSource.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GitSource.java new file mode 100644 index 00000000..a311c2e7 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GitSource.java @@ -0,0 +1,1613 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +/** + * + * + *
+ * Defines how to access a Git Source.
+ * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.GitSource} + */ +public final class GitSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.privatecatalog.v1beta1.GitSource) + GitSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use GitSource.newBuilder() to construct. + private GitSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GitSource() { + repo_ = ""; + dir_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GitSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GitSource( + 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(); + + repo_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + dir_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + refCase_ = 3; + ref_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + refCase_ = 4; + ref_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + refCase_ = 5; + ref_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_GitSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_GitSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.GitSource.class, + com.google.cloud.privatecatalog.v1beta1.GitSource.Builder.class); + } + + private int refCase_ = 0; + private java.lang.Object ref_; + + public enum RefCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + COMMIT(3), + BRANCH(4), + TAG(5), + REF_NOT_SET(0); + private final int value; + + private RefCase(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 RefCase valueOf(int value) { + return forNumber(value); + } + + public static RefCase forNumber(int value) { + switch (value) { + case 3: + return COMMIT; + case 4: + return BRANCH; + case 5: + return TAG; + case 0: + return REF_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RefCase getRefCase() { + return RefCase.forNumber(refCase_); + } + + public static final int REPO_FIELD_NUMBER = 1; + private volatile java.lang.Object repo_; + /** + * + * + *
+   * Location of the Git repo to build.
+   * 
+ * + * string repo = 1; + * + * @return The repo. + */ + @java.lang.Override + public java.lang.String getRepo() { + java.lang.Object ref = repo_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repo_ = s; + return s; + } + } + /** + * + * + *
+   * Location of the Git repo to build.
+   * 
+ * + * string repo = 1; + * + * @return The bytes for repo. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRepoBytes() { + java.lang.Object ref = repo_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIR_FIELD_NUMBER = 2; + private volatile java.lang.Object dir_; + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * 
+ * + * string dir = 2; + * + * @return The dir. + */ + @java.lang.Override + public java.lang.String getDir() { + java.lang.Object ref = dir_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dir_ = s; + return s; + } + } + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * 
+ * + * string dir = 2; + * + * @return The bytes for dir. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDirBytes() { + java.lang.Object ref = dir_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMMIT_FIELD_NUMBER = 3; + /** + * + * + *
+   * The revision commit to use.
+   * 
+ * + * string commit = 3; + * + * @return Whether the commit field is set. + */ + public boolean hasCommit() { + return refCase_ == 3; + } + /** + * + * + *
+   * The revision commit to use.
+   * 
+ * + * string commit = 3; + * + * @return The commit. + */ + public java.lang.String getCommit() { + java.lang.Object ref = ""; + if (refCase_ == 3) { + ref = ref_; + } + if (ref instanceof java.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 (refCase_ == 3) { + ref_ = s; + } + return s; + } + } + /** + * + * + *
+   * The revision commit to use.
+   * 
+ * + * string commit = 3; + * + * @return The bytes for commit. + */ + public com.google.protobuf.ByteString getCommitBytes() { + java.lang.Object ref = ""; + if (refCase_ == 3) { + ref = ref_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (refCase_ == 3) { + ref_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BRANCH_FIELD_NUMBER = 4; + /** + * + * + *
+   * The revision branch to use.
+   * 
+ * + * string branch = 4; + * + * @return Whether the branch field is set. + */ + public boolean hasBranch() { + return refCase_ == 4; + } + /** + * + * + *
+   * The revision branch to use.
+   * 
+ * + * string branch = 4; + * + * @return The branch. + */ + public java.lang.String getBranch() { + java.lang.Object ref = ""; + if (refCase_ == 4) { + ref = ref_; + } + if (ref instanceof java.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 (refCase_ == 4) { + ref_ = s; + } + return s; + } + } + /** + * + * + *
+   * The revision branch to use.
+   * 
+ * + * string branch = 4; + * + * @return The bytes for branch. + */ + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = ""; + if (refCase_ == 4) { + ref = ref_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (refCase_ == 4) { + ref_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TAG_FIELD_NUMBER = 5; + /** + * + * + *
+   * The revision tag to use.
+   * 
+ * + * string tag = 5; + * + * @return Whether the tag field is set. + */ + public boolean hasTag() { + return refCase_ == 5; + } + /** + * + * + *
+   * The revision tag to use.
+   * 
+ * + * string tag = 5; + * + * @return The tag. + */ + public java.lang.String getTag() { + java.lang.Object ref = ""; + if (refCase_ == 5) { + ref = ref_; + } + if (ref instanceof java.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 (refCase_ == 5) { + ref_ = s; + } + return s; + } + } + /** + * + * + *
+   * The revision tag to use.
+   * 
+ * + * string tag = 5; + * + * @return The bytes for tag. + */ + public com.google.protobuf.ByteString getTagBytes() { + java.lang.Object ref = ""; + if (refCase_ == 5) { + ref = ref_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (refCase_ == 5) { + ref_ = 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 (!getRepoBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, repo_); + } + if (!getDirBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, dir_); + } + if (refCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, ref_); + } + if (refCase_ == 4) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, ref_); + } + if (refCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, ref_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getRepoBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, repo_); + } + if (!getDirBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, dir_); + } + if (refCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, ref_); + } + if (refCase_ == 4) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, ref_); + } + if (refCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, ref_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.privatecatalog.v1beta1.GitSource)) { + return super.equals(obj); + } + com.google.cloud.privatecatalog.v1beta1.GitSource other = + (com.google.cloud.privatecatalog.v1beta1.GitSource) obj; + + if (!getRepo().equals(other.getRepo())) return false; + if (!getDir().equals(other.getDir())) return false; + if (!getRefCase().equals(other.getRefCase())) return false; + switch (refCase_) { + case 3: + if (!getCommit().equals(other.getCommit())) return false; + break; + case 4: + if (!getBranch().equals(other.getBranch())) return false; + break; + case 5: + if (!getTag().equals(other.getTag())) 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) + REPO_FIELD_NUMBER; + hash = (53 * hash) + getRepo().hashCode(); + hash = (37 * hash) + DIR_FIELD_NUMBER; + hash = (53 * hash) + getDir().hashCode(); + switch (refCase_) { + case 3: + hash = (37 * hash) + COMMIT_FIELD_NUMBER; + hash = (53 * hash) + getCommit().hashCode(); + break; + case 4: + hash = (37 * hash) + BRANCH_FIELD_NUMBER; + hash = (53 * hash) + getBranch().hashCode(); + break; + case 5: + hash = (37 * hash) + TAG_FIELD_NUMBER; + hash = (53 * hash) + getTag().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.privatecatalog.v1beta1.GitSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.GitSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.GitSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.GitSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.GitSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.GitSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.GitSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.GitSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.GitSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.GitSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.GitSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.GitSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.privatecatalog.v1beta1.GitSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Defines how to access a Git Source.
+   * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.GitSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.privatecatalog.v1beta1.GitSource) + com.google.cloud.privatecatalog.v1beta1.GitSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_GitSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_GitSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.GitSource.class, + com.google.cloud.privatecatalog.v1beta1.GitSource.Builder.class); + } + + // Construct using com.google.cloud.privatecatalog.v1beta1.GitSource.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(); + repo_ = ""; + + dir_ = ""; + + refCase_ = 0; + ref_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_GitSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GitSource getDefaultInstanceForType() { + return com.google.cloud.privatecatalog.v1beta1.GitSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GitSource build() { + com.google.cloud.privatecatalog.v1beta1.GitSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GitSource buildPartial() { + com.google.cloud.privatecatalog.v1beta1.GitSource result = + new com.google.cloud.privatecatalog.v1beta1.GitSource(this); + result.repo_ = repo_; + result.dir_ = dir_; + if (refCase_ == 3) { + result.ref_ = ref_; + } + if (refCase_ == 4) { + result.ref_ = ref_; + } + if (refCase_ == 5) { + result.ref_ = ref_; + } + result.refCase_ = refCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.privatecatalog.v1beta1.GitSource) { + return mergeFrom((com.google.cloud.privatecatalog.v1beta1.GitSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.privatecatalog.v1beta1.GitSource other) { + if (other == com.google.cloud.privatecatalog.v1beta1.GitSource.getDefaultInstance()) + return this; + if (!other.getRepo().isEmpty()) { + repo_ = other.repo_; + onChanged(); + } + if (!other.getDir().isEmpty()) { + dir_ = other.dir_; + onChanged(); + } + switch (other.getRefCase()) { + case COMMIT: + { + refCase_ = 3; + ref_ = other.ref_; + onChanged(); + break; + } + case BRANCH: + { + refCase_ = 4; + ref_ = other.ref_; + onChanged(); + break; + } + case TAG: + { + refCase_ = 5; + ref_ = other.ref_; + onChanged(); + break; + } + case REF_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.privatecatalog.v1beta1.GitSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.privatecatalog.v1beta1.GitSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int refCase_ = 0; + private java.lang.Object ref_; + + public RefCase getRefCase() { + return RefCase.forNumber(refCase_); + } + + public Builder clearRef() { + refCase_ = 0; + ref_ = null; + onChanged(); + return this; + } + + private java.lang.Object repo_ = ""; + /** + * + * + *
+     * Location of the Git repo to build.
+     * 
+ * + * string repo = 1; + * + * @return The repo. + */ + public java.lang.String getRepo() { + java.lang.Object ref = repo_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repo_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Location of the Git repo to build.
+     * 
+ * + * string repo = 1; + * + * @return The bytes for repo. + */ + public com.google.protobuf.ByteString getRepoBytes() { + java.lang.Object ref = repo_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Location of the Git repo to build.
+     * 
+ * + * string repo = 1; + * + * @param value The repo to set. + * @return This builder for chaining. + */ + public Builder setRepo(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + repo_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Location of the Git repo to build.
+     * 
+ * + * string repo = 1; + * + * @return This builder for chaining. + */ + public Builder clearRepo() { + + repo_ = getDefaultInstance().getRepo(); + onChanged(); + return this; + } + /** + * + * + *
+     * Location of the Git repo to build.
+     * 
+ * + * string repo = 1; + * + * @param value The bytes for repo to set. + * @return This builder for chaining. + */ + public Builder setRepoBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + repo_ = value; + onChanged(); + return this; + } + + private java.lang.Object dir_ = ""; + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * 
+ * + * string dir = 2; + * + * @return The dir. + */ + public java.lang.String getDir() { + java.lang.Object ref = dir_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dir_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * 
+ * + * string dir = 2; + * + * @return The bytes for dir. + */ + public com.google.protobuf.ByteString getDirBytes() { + java.lang.Object ref = dir_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * 
+ * + * string dir = 2; + * + * @param value The dir to set. + * @return This builder for chaining. + */ + public Builder setDir(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dir_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * 
+ * + * string dir = 2; + * + * @return This builder for chaining. + */ + public Builder clearDir() { + + dir_ = getDefaultInstance().getDir(); + onChanged(); + return this; + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * 
+ * + * string dir = 2; + * + * @param value The bytes for dir to set. + * @return This builder for chaining. + */ + public Builder setDirBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dir_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The revision commit to use.
+     * 
+ * + * string commit = 3; + * + * @return Whether the commit field is set. + */ + @java.lang.Override + public boolean hasCommit() { + return refCase_ == 3; + } + /** + * + * + *
+     * The revision commit to use.
+     * 
+ * + * string commit = 3; + * + * @return The commit. + */ + @java.lang.Override + public java.lang.String getCommit() { + java.lang.Object ref = ""; + if (refCase_ == 3) { + ref = ref_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (refCase_ == 3) { + ref_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The revision commit to use.
+     * 
+ * + * string commit = 3; + * + * @return The bytes for commit. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCommitBytes() { + java.lang.Object ref = ""; + if (refCase_ == 3) { + ref = ref_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (refCase_ == 3) { + ref_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The revision commit to use.
+     * 
+ * + * string commit = 3; + * + * @param value The commit to set. + * @return This builder for chaining. + */ + public Builder setCommit(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + refCase_ = 3; + ref_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The revision commit to use.
+     * 
+ * + * string commit = 3; + * + * @return This builder for chaining. + */ + public Builder clearCommit() { + if (refCase_ == 3) { + refCase_ = 0; + ref_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The revision commit to use.
+     * 
+ * + * string commit = 3; + * + * @param value The bytes for commit to set. + * @return This builder for chaining. + */ + public Builder setCommitBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + refCase_ = 3; + ref_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The revision branch to use.
+     * 
+ * + * string branch = 4; + * + * @return Whether the branch field is set. + */ + @java.lang.Override + public boolean hasBranch() { + return refCase_ == 4; + } + /** + * + * + *
+     * The revision branch to use.
+     * 
+ * + * string branch = 4; + * + * @return The branch. + */ + @java.lang.Override + public java.lang.String getBranch() { + java.lang.Object ref = ""; + if (refCase_ == 4) { + ref = ref_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (refCase_ == 4) { + ref_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The revision branch to use.
+     * 
+ * + * string branch = 4; + * + * @return The bytes for branch. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = ""; + if (refCase_ == 4) { + ref = ref_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (refCase_ == 4) { + ref_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The revision branch to use.
+     * 
+ * + * string branch = 4; + * + * @param value The branch to set. + * @return This builder for chaining. + */ + public Builder setBranch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + refCase_ = 4; + ref_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The revision branch to use.
+     * 
+ * + * string branch = 4; + * + * @return This builder for chaining. + */ + public Builder clearBranch() { + if (refCase_ == 4) { + refCase_ = 0; + ref_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The revision branch to use.
+     * 
+ * + * string branch = 4; + * + * @param value The bytes for branch to set. + * @return This builder for chaining. + */ + public Builder setBranchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + refCase_ = 4; + ref_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The revision tag to use.
+     * 
+ * + * string tag = 5; + * + * @return Whether the tag field is set. + */ + @java.lang.Override + public boolean hasTag() { + return refCase_ == 5; + } + /** + * + * + *
+     * The revision tag to use.
+     * 
+ * + * string tag = 5; + * + * @return The tag. + */ + @java.lang.Override + public java.lang.String getTag() { + java.lang.Object ref = ""; + if (refCase_ == 5) { + ref = ref_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (refCase_ == 5) { + ref_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The revision tag to use.
+     * 
+ * + * string tag = 5; + * + * @return The bytes for tag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTagBytes() { + java.lang.Object ref = ""; + if (refCase_ == 5) { + ref = ref_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (refCase_ == 5) { + ref_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The revision tag to use.
+     * 
+ * + * string tag = 5; + * + * @param value The tag to set. + * @return This builder for chaining. + */ + public Builder setTag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + refCase_ = 5; + ref_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The revision tag to use.
+     * 
+ * + * string tag = 5; + * + * @return This builder for chaining. + */ + public Builder clearTag() { + if (refCase_ == 5) { + refCase_ = 0; + ref_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The revision tag to use.
+     * 
+ * + * string tag = 5; + * + * @param value The bytes for tag to set. + * @return This builder for chaining. + */ + public Builder setTagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + refCase_ = 5; + ref_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.privatecatalog.v1beta1.GitSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.privatecatalog.v1beta1.GitSource) + private static final com.google.cloud.privatecatalog.v1beta1.GitSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.privatecatalog.v1beta1.GitSource(); + } + + public static com.google.cloud.privatecatalog.v1beta1.GitSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GitSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GitSource(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.GitSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GitSourceOrBuilder.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GitSourceOrBuilder.java new file mode 100644 index 00000000..7f4cf9a6 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/GitSourceOrBuilder.java @@ -0,0 +1,192 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public interface GitSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.privatecatalog.v1beta1.GitSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Location of the Git repo to build.
+   * 
+ * + * string repo = 1; + * + * @return The repo. + */ + java.lang.String getRepo(); + /** + * + * + *
+   * Location of the Git repo to build.
+   * 
+ * + * string repo = 1; + * + * @return The bytes for repo. + */ + com.google.protobuf.ByteString getRepoBytes(); + + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * 
+ * + * string dir = 2; + * + * @return The dir. + */ + java.lang.String getDir(); + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * 
+ * + * string dir = 2; + * + * @return The bytes for dir. + */ + com.google.protobuf.ByteString getDirBytes(); + + /** + * + * + *
+   * The revision commit to use.
+   * 
+ * + * string commit = 3; + * + * @return Whether the commit field is set. + */ + boolean hasCommit(); + /** + * + * + *
+   * The revision commit to use.
+   * 
+ * + * string commit = 3; + * + * @return The commit. + */ + java.lang.String getCommit(); + /** + * + * + *
+   * The revision commit to use.
+   * 
+ * + * string commit = 3; + * + * @return The bytes for commit. + */ + com.google.protobuf.ByteString getCommitBytes(); + + /** + * + * + *
+   * The revision branch to use.
+   * 
+ * + * string branch = 4; + * + * @return Whether the branch field is set. + */ + boolean hasBranch(); + /** + * + * + *
+   * The revision branch to use.
+   * 
+ * + * string branch = 4; + * + * @return The branch. + */ + java.lang.String getBranch(); + /** + * + * + *
+   * The revision branch to use.
+   * 
+ * + * string branch = 4; + * + * @return The bytes for branch. + */ + com.google.protobuf.ByteString getBranchBytes(); + + /** + * + * + *
+   * The revision tag to use.
+   * 
+ * + * string tag = 5; + * + * @return Whether the tag field is set. + */ + boolean hasTag(); + /** + * + * + *
+   * The revision tag to use.
+   * 
+ * + * string tag = 5; + * + * @return The tag. + */ + java.lang.String getTag(); + /** + * + * + *
+   * The revision tag to use.
+   * 
+ * + * string tag = 5; + * + * @return The bytes for tag. + */ + com.google.protobuf.ByteString getTagBytes(); + + public com.google.cloud.privatecatalog.v1beta1.GitSource.RefCase getRefCase(); +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Inputs.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Inputs.java new file mode 100644 index 00000000..a3c0f83d --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Inputs.java @@ -0,0 +1,734 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +/** + * + * + *
+ * Defines definition of input parameters of asset templates.
+ * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.Inputs} + */ +public final class Inputs extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.privatecatalog.v1beta1.Inputs) + InputsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Inputs.newBuilder() to construct. + private Inputs(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Inputs() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Inputs(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Inputs( + 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.Struct.Builder subBuilder = null; + if (parameters_ != null) { + subBuilder = parameters_.toBuilder(); + } + parameters_ = + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(parameters_); + parameters_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Inputs_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Inputs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.Inputs.class, + com.google.cloud.privatecatalog.v1beta1.Inputs.Builder.class); + } + + public static final int PARAMETERS_FIELD_NUMBER = 1; + private com.google.protobuf.Struct parameters_; + /** + * + * + *
+   * Output only. The JSON schema defining the inputs and their formats.
+   * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return parameters_ != null; + } + /** + * + * + *
+   * Output only. The JSON schema defining the inputs and their formats.
+   * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The parameters. + */ + @java.lang.Override + public com.google.protobuf.Struct getParameters() { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } + /** + * + * + *
+   * Output only. The JSON schema defining the inputs and their formats.
+   * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getParametersOrBuilder() { + return getParameters(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (parameters_ != null) { + output.writeMessage(1, getParameters()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (parameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getParameters()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.privatecatalog.v1beta1.Inputs)) { + return super.equals(obj); + } + com.google.cloud.privatecatalog.v1beta1.Inputs other = + (com.google.cloud.privatecatalog.v1beta1.Inputs) obj; + + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) 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 (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.privatecatalog.v1beta1.Inputs parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.Inputs parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Inputs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.Inputs parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Inputs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.Inputs parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Inputs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.Inputs parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Inputs parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.Inputs parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Inputs parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.Inputs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.privatecatalog.v1beta1.Inputs prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Defines definition of input parameters of asset templates.
+   * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.Inputs} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.privatecatalog.v1beta1.Inputs) + com.google.cloud.privatecatalog.v1beta1.InputsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Inputs_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Inputs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.Inputs.class, + com.google.cloud.privatecatalog.v1beta1.Inputs.Builder.class); + } + + // Construct using com.google.cloud.privatecatalog.v1beta1.Inputs.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 (parametersBuilder_ == null) { + parameters_ = null; + } else { + parameters_ = null; + parametersBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Inputs_descriptor; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Inputs getDefaultInstanceForType() { + return com.google.cloud.privatecatalog.v1beta1.Inputs.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Inputs build() { + com.google.cloud.privatecatalog.v1beta1.Inputs result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Inputs buildPartial() { + com.google.cloud.privatecatalog.v1beta1.Inputs result = + new com.google.cloud.privatecatalog.v1beta1.Inputs(this); + if (parametersBuilder_ == null) { + 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); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.privatecatalog.v1beta1.Inputs) { + return mergeFrom((com.google.cloud.privatecatalog.v1beta1.Inputs) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.privatecatalog.v1beta1.Inputs other) { + if (other == com.google.cloud.privatecatalog.v1beta1.Inputs.getDefaultInstance()) return this; + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.privatecatalog.v1beta1.Inputs parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.privatecatalog.v1beta1.Inputs) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Struct parameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + parametersBuilder_; + /** + * + * + *
+     * Output only. The JSON schema defining the inputs and their formats.
+     * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return parametersBuilder_ != null || parameters_ != null; + } + /** + * + * + *
+     * Output only. The JSON schema defining the inputs and their formats.
+     * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The parameters. + */ + public com.google.protobuf.Struct getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The JSON schema defining the inputs and their formats.
+     * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setParameters(com.google.protobuf.Struct value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + onChanged(); + } else { + parametersBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The JSON schema defining the inputs and their formats.
+     * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setParameters(com.google.protobuf.Struct.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + onChanged(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The JSON schema defining the inputs and their formats.
+     * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeParameters(com.google.protobuf.Struct value) { + if (parametersBuilder_ == null) { + if (parameters_ != null) { + parameters_ = + com.google.protobuf.Struct.newBuilder(parameters_).mergeFrom(value).buildPartial(); + } else { + parameters_ = value; + } + onChanged(); + } else { + parametersBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The JSON schema defining the inputs and their formats.
+     * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearParameters() { + if (parametersBuilder_ == null) { + parameters_ = null; + onChanged(); + } else { + parameters_ = null; + parametersBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The JSON schema defining the inputs and their formats.
+     * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Struct.Builder getParametersBuilder() { + + onChanged(); + return getParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The JSON schema defining the inputs and their formats.
+     * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.StructOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } + } + /** + * + * + *
+     * Output only. The JSON schema defining the inputs and their formats.
+     * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getParameters(), 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.cloud.privatecatalog.v1beta1.Inputs) + } + + // @@protoc_insertion_point(class_scope:google.cloud.privatecatalog.v1beta1.Inputs) + private static final com.google.cloud.privatecatalog.v1beta1.Inputs DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.privatecatalog.v1beta1.Inputs(); + } + + public static com.google.cloud.privatecatalog.v1beta1.Inputs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Inputs parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Inputs(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Inputs getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/InputsOrBuilder.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/InputsOrBuilder.java new file mode 100644 index 00000000..463aad81 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/InputsOrBuilder.java @@ -0,0 +1,63 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public interface InputsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.privatecatalog.v1beta1.Inputs) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The JSON schema defining the inputs and their formats.
+   * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + /** + * + * + *
+   * Output only. The JSON schema defining the inputs and their formats.
+   * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The parameters. + */ + com.google.protobuf.Struct getParameters(); + /** + * + * + *
+   * Output only. The JSON schema defining the inputs and their formats.
+   * 
+ * + * .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.StructOrBuilder getParametersOrBuilder(); +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogProto.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogProto.java new file mode 100644 index 00000000..32889b3b --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/PrivateCatalogProto.java @@ -0,0 +1,360 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public final class PrivateCatalogProto { + private PrivateCatalogProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_privatecatalog_v1beta1_Catalog_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_privatecatalog_v1beta1_Catalog_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_privatecatalog_v1beta1_Product_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_privatecatalog_v1beta1_Product_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_privatecatalog_v1beta1_AssetReference_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_privatecatalog_v1beta1_AssetReference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_privatecatalog_v1beta1_Inputs_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_privatecatalog_v1beta1_Inputs_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_privatecatalog_v1beta1_GcsSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_privatecatalog_v1beta1_GcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_privatecatalog_v1beta1_GitSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_privatecatalog_v1beta1_GitSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_privatecatalog_v1beta1_Version_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_privatecatalog_v1beta1_Version_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n9google/cloud/privatecatalog/v1beta1/pr" + + "ivate_catalog.proto\022#google.cloud.privat" + + "ecatalog.v1beta1\032\034google/api/annotations" + + ".proto\032\027google/api/client.proto\032\037google/" + + "api/field_behavior.proto\032\031google/api/res" + + "ource.proto\032#google/longrunning/operatio" + + "ns.proto\032\031google/protobuf/any.proto\032\033goo" + + "gle/protobuf/empty.proto\032 google/protobu" + + "f/field_mask.proto\032\034google/protobuf/stru" + + "ct.proto\032\037google/protobuf/timestamp.prot" + + "o\"d\n\025SearchCatalogsRequest\022\025\n\010resource\030\001" + + " \001(\tB\003\340A\002\022\r\n\005query\030\002 \001(\t\022\021\n\tpage_size\030\003 " + + "\001(\005\022\022\n\npage_token\030\004 \001(\t\"q\n\026SearchCatalog" + + "sResponse\022>\n\010catalogs\030\001 \003(\0132,.google.clo" + + "ud.privatecatalog.v1beta1.Catalog\022\027\n\017nex" + + "t_page_token\030\002 \001(\t\"d\n\025SearchProductsRequ" + + "est\022\025\n\010resource\030\001 \001(\tB\003\340A\002\022\r\n\005query\030\002 \001(" + + "\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t" + + "\"q\n\026SearchProductsResponse\022>\n\010products\030\001" + + " \003(\0132,.google.cloud.privatecatalog.v1bet" + + "a1.Product\022\027\n\017next_page_token\030\002 \001(\t\"i\n\025S" + + "earchVersionsRequest\022\025\n\010resource\030\001 \001(\tB\003" + + "\340A\002\022\022\n\005query\030\002 \001(\tB\003\340A\002\022\021\n\tpage_size\030\003 \001" + + "(\005\022\022\n\npage_token\030\004 \001(\t\"q\n\026SearchVersions" + + "Response\022>\n\010versions\030\001 \003(\0132,.google.clou" + + "d.privatecatalog.v1beta1.Version\022\027\n\017next" + + "_page_token\030\002 \001(\t\"\202\002\n\007Catalog\022\021\n\004name\030\001 " + + "\001(\tB\003\340A\003\022\031\n\014display_name\030\002 \001(\tB\003\340A\003\022\030\n\013d" + + "escription\030\003 \001(\tB\003\340A\003\0224\n\013create_time\030\004 \001" + + "(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n\013u" + + "pdate_time\030\005 \001(\0132\032.google.protobuf.Times" + + "tampB\003\340A\003:C\352A@\n*cloudprivatecatalog.goog" + + "leapis.com/Catalog\022\022catalogs/{catalog}\"\214" + + "\003\n\007Product\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\027\n\nasset_t" + + "ype\030\002 \001(\tB\003\340A\003\0229\n\020display_metadata\030\003 \001(\013" + + "2\027.google.protobuf.StructB\006\340A\002\340A\003\022\025\n\010ico" + + "n_uri\030\004 \001(\tB\003\340A\003\022R\n\020asset_references\030\n \003" + + "(\01323.google.cloud.privatecatalog.v1beta1" + + ".AssetReferenceB\003\340A\003\0224\n\013create_time\030\005 \001(" + + "\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n\013up" + + "date_time\030\006 \001(\0132\032.google.protobuf.Timest" + + "ampB\003\340A\003:C\352A@\n*cloudprivatecatalog.googl" + + "eapis.com/Product\022\022products/{product}\"\336\005" + + "\n\016AssetReference\022\017\n\002id\030\001 \001(\tB\003\340A\003\022\030\n\013des" + + "cription\030\002 \001(\tB\003\340A\003\022@\n\006inputs\030\006 \001(\0132+.go" + + "ogle.cloud.privatecatalog.v1beta1.Inputs" + + "B\003\340A\003\022h\n\021validation_status\030\007 \001(\0162H.googl" + + "e.cloud.privatecatalog.v1beta1.AssetRefe" + + "rence.AssetValidationStateB\003\340A\003\022@\n\024valid" + + "ation_operation\030\010 \001(\0132\035.google.longrunni" + + "ng.OperationB\003\340A\003\022\024\n\005asset\030\n \001(\tB\003\340A\003H\000\022" + + "\031\n\010gcs_path\030\013 \001(\tB\005\030\001\340A\003H\000\022I\n\ngit_source" + + "\030\017 \001(\0132..google.cloud.privatecatalog.v1b" + + "eta1.GitSourceB\003\340A\003H\000\022G\n\ngcs_source\030\020 \001(" + + "\0132..google.cloud.privatecatalog.v1beta1." + + "GcsSourceB\003\340A\003\0224\n\013create_time\030\014 \001(\0132\032.go" + + "ogle.protobuf.TimestampB\003\340A\003\0224\n\013update_t" + + "ime\030\r \001(\0132\032.google.protobuf.TimestampB\003\340" + + "A\003\022\023\n\007version\030\016 \001(\tB\002\030\001\"c\n\024AssetValidati" + + "onState\022&\n\"ASSET_VALIDATION_STATE_UNSPEC" + + "IFIED\020\000\022\013\n\007PENDING\020\001\022\t\n\005VALID\020\002\022\013\n\007INVAL" + + "ID\020\003B\010\n\006source\":\n\006Inputs\0220\n\nparameters\030\001" + + " \001(\0132\027.google.protobuf.StructB\003\340A\003\"q\n\tGc" + + "sSource\022\025\n\010gcs_path\030\001 \001(\tB\003\340A\003\022\027\n\ngenera" + + "tion\030\002 \001(\003B\003\340A\003\0224\n\013update_time\030\003 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\003\340A\003\"`\n\tGitSour" + + "ce\022\014\n\004repo\030\001 \001(\t\022\013\n\003dir\030\002 \001(\t\022\020\n\006commit\030" + + "\003 \001(\tH\000\022\020\n\006branch\030\004 \001(\tH\000\022\r\n\003tag\030\005 \001(\tH\000" + + "B\005\n\003ref\"\272\002\n\007Version\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\030" + + "\n\013description\030\002 \001(\tB\003\340A\003\022+\n\005asset\030\003 \001(\0132" + + "\027.google.protobuf.StructB\003\340A\003\0224\n\013create_" + + "time\030\005 \001(\0132\032.google.protobuf.TimestampB\003" + + "\340A\003\0224\n\013update_time\030\006 \001(\0132\032.google.protob" + + "uf.TimestampB\003\340A\003:i\352Af\n*cloudprivatecata" + + "log.googleapis.com/Version\0228catalogs/{ca" + + "talog}/products/{product}/versions/{vers" + + "ion}2\362\007\n\016PrivateCatalog\022\253\002\n\016SearchCatalo" + + "gs\022:.google.cloud.privatecatalog.v1beta1" + + ".SearchCatalogsRequest\032;.google.cloud.pr" + + "ivatecatalog.v1beta1.SearchCatalogsRespo" + + "nse\"\237\001\202\323\344\223\002\230\001\022./v1beta1/{resource=projec" + + "ts/*}/catalogs:searchZ5\0223/v1beta1/{resou" + + "rce=organizations/*}/catalogs:searchZ/\022-" + + "/v1beta1/{resource=folders/*}/catalogs:s" + + "earch\022\253\002\n\016SearchProducts\022:.google.cloud." + + "privatecatalog.v1beta1.SearchProductsReq" + + "uest\032;.google.cloud.privatecatalog.v1bet" + + "a1.SearchProductsResponse\"\237\001\202\323\344\223\002\230\001\022./v1" + + "beta1/{resource=projects/*}/products:sea" + + "rchZ5\0223/v1beta1/{resource=organizations/" + + "*}/products:searchZ/\022-/v1beta1/{resource" + + "=folders/*}/products:search\022\253\002\n\016SearchVe" + + "rsions\022:.google.cloud.privatecatalog.v1b" + + "eta1.SearchVersionsRequest\032;.google.clou" + + "d.privatecatalog.v1beta1.SearchVersionsR" + + "esponse\"\237\001\202\323\344\223\002\230\001\022./v1beta1/{resource=pr" + + "ojects/*}/versions:searchZ5\0223/v1beta1/{r" + + "esource=organizations/*}/versions:search" + + "Z/\022-/v1beta1/{resource=folders/*}/versio" + + "ns:search\032V\312A\"cloudprivatecatalog.google" + + "apis.com\322A.https://www.googleapis.com/au" + + "th/cloud-platformB\210\002\n\'com.google.cloud.p" + + "rivatecatalog.v1beta1B\023PrivateCatalogPro" + + "toP\001ZQgoogle.golang.org/genproto/googlea" + + "pis/cloud/privatecatalog/v1beta1;private" + + "catalog\252\002#Google.Cloud.PrivateCatalog.V1" + + "Beta1\312\002#Google\\Cloud\\PrivateCatalog\\V1be" + + "ta1\352\002&Google::Cloud::PrivateCatalog::V1b" + + "eta1b\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.AnyProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsRequest_descriptor, + new java.lang.String[] { + "Resource", "Query", "PageSize", "PageToken", + }); + internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsResponse_descriptor, + new java.lang.String[] { + "Catalogs", "NextPageToken", + }); + internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsRequest_descriptor, + new java.lang.String[] { + "Resource", "Query", "PageSize", "PageToken", + }); + internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsResponse_descriptor, + new java.lang.String[] { + "Products", "NextPageToken", + }); + internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsRequest_descriptor, + new java.lang.String[] { + "Resource", "Query", "PageSize", "PageToken", + }); + internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsResponse_descriptor, + new java.lang.String[] { + "Versions", "NextPageToken", + }); + internal_static_google_cloud_privatecatalog_v1beta1_Catalog_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_privatecatalog_v1beta1_Catalog_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_privatecatalog_v1beta1_Catalog_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Description", "CreateTime", "UpdateTime", + }); + internal_static_google_cloud_privatecatalog_v1beta1_Product_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_privatecatalog_v1beta1_Product_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_privatecatalog_v1beta1_Product_descriptor, + new java.lang.String[] { + "Name", + "AssetType", + "DisplayMetadata", + "IconUri", + "AssetReferences", + "CreateTime", + "UpdateTime", + }); + internal_static_google_cloud_privatecatalog_v1beta1_AssetReference_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_privatecatalog_v1beta1_AssetReference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_privatecatalog_v1beta1_AssetReference_descriptor, + new java.lang.String[] { + "Id", + "Description", + "Inputs", + "ValidationStatus", + "ValidationOperation", + "Asset", + "GcsPath", + "GitSource", + "GcsSource", + "CreateTime", + "UpdateTime", + "Version", + "Source", + }); + internal_static_google_cloud_privatecatalog_v1beta1_Inputs_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_privatecatalog_v1beta1_Inputs_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_privatecatalog_v1beta1_Inputs_descriptor, + new java.lang.String[] { + "Parameters", + }); + internal_static_google_cloud_privatecatalog_v1beta1_GcsSource_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_privatecatalog_v1beta1_GcsSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_privatecatalog_v1beta1_GcsSource_descriptor, + new java.lang.String[] { + "GcsPath", "Generation", "UpdateTime", + }); + internal_static_google_cloud_privatecatalog_v1beta1_GitSource_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_privatecatalog_v1beta1_GitSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_privatecatalog_v1beta1_GitSource_descriptor, + new java.lang.String[] { + "Repo", "Dir", "Commit", "Branch", "Tag", "Ref", + }); + internal_static_google_cloud_privatecatalog_v1beta1_Version_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_privatecatalog_v1beta1_Version_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_privatecatalog_v1beta1_Version_descriptor, + new java.lang.String[] { + "Name", "Description", "Asset", "CreateTime", "UpdateTime", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + 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.AnyProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Product.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Product.java new file mode 100644 index 00000000..050d0a0f --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Product.java @@ -0,0 +1,4286 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +/** + * + * + *
+ * The readonly representation of a product computed with a given resource
+ * context.
+ * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.Product} + */ +public final class Product extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.privatecatalog.v1beta1.Product) + ProductOrBuilder { + private static final long serialVersionUID = 0L; + // Use Product.newBuilder() to construct. + private Product(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Product() { + name_ = ""; + assetType_ = ""; + iconUri_ = ""; + assetReferences_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Product(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Product( + 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(); + + assetType_ = s; + break; + } + case 26: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (displayMetadata_ != null) { + subBuilder = displayMetadata_.toBuilder(); + } + displayMetadata_ = + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(displayMetadata_); + displayMetadata_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + iconUri_ = s; + 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 82: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + assetReferences_ = + new java.util.ArrayList< + com.google.cloud.privatecatalog.v1beta1.AssetReference>(); + mutable_bitField0_ |= 0x00000001; + } + assetReferences_.add( + input.readMessage( + com.google.cloud.privatecatalog.v1beta1.AssetReference.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + assetReferences_ = java.util.Collections.unmodifiableList(assetReferences_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Product_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.Product.class, + com.google.cloud.privatecatalog.v1beta1.Product.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the target product, in the format of
+   * `products/[a-z][-a-z0-9]*[a-z0-9]'.
+   * A unique identifier for the product under a catalog.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the target product, in the format of
+   * `products/[a-z][-a-z0-9]*[a-z0-9]'.
+   * A unique identifier for the product under a catalog.
+   * 
+ * + * 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 ASSET_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object assetType_; + /** + * + * + *
+   * Output only. The type of the product asset. It can be one of the following values:
+   * * `google.deploymentmanager.Template`
+   * * `google.cloudprivatecatalog.ListingOnly`
+   * * `google.cloudprivatecatalog.Terraform`
+   * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The assetType. + */ + @java.lang.Override + public java.lang.String getAssetType() { + java.lang.Object ref = assetType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + assetType_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The type of the product asset. It can be one of the following values:
+   * * `google.deploymentmanager.Template`
+   * * `google.cloudprivatecatalog.ListingOnly`
+   * * `google.cloudprivatecatalog.Terraform`
+   * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for assetType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAssetTypeBytes() { + java.lang.Object ref = assetType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assetType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_METADATA_FIELD_NUMBER = 3; + private com.google.protobuf.Struct displayMetadata_; + /** + * + * + *
+   * Required. Output only. The display metadata to describe the product. The JSON schema of the
+   * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+   * When the type is `google.deploymentmanager.Template`, the schema is as
+   * follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   * required:
+   * - name
+   * - description
+   * additionalProperties: false
+   * ```
+   * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+   * is as follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   *   signup_url:
+   *     type: string
+   *     pattern:
+   *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   * required:
+   * - name
+   * - description
+   * - signup_url
+   * additionalProperties: false
+   * ```
+   * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+   * is as follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   * required:
+   * - name
+   * - description
+   * additionalProperties: true
+   * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the displayMetadata field is set. + */ + @java.lang.Override + public boolean hasDisplayMetadata() { + return displayMetadata_ != null; + } + /** + * + * + *
+   * Required. Output only. The display metadata to describe the product. The JSON schema of the
+   * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+   * When the type is `google.deploymentmanager.Template`, the schema is as
+   * follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   * required:
+   * - name
+   * - description
+   * additionalProperties: false
+   * ```
+   * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+   * is as follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   *   signup_url:
+   *     type: string
+   *     pattern:
+   *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   * required:
+   * - name
+   * - description
+   * - signup_url
+   * additionalProperties: false
+   * ```
+   * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+   * is as follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   * required:
+   * - name
+   * - description
+   * additionalProperties: true
+   * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The displayMetadata. + */ + @java.lang.Override + public com.google.protobuf.Struct getDisplayMetadata() { + return displayMetadata_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : displayMetadata_; + } + /** + * + * + *
+   * Required. Output only. The display metadata to describe the product. The JSON schema of the
+   * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+   * When the type is `google.deploymentmanager.Template`, the schema is as
+   * follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   * required:
+   * - name
+   * - description
+   * additionalProperties: false
+   * ```
+   * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+   * is as follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   *   signup_url:
+   *     type: string
+   *     pattern:
+   *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   * required:
+   * - name
+   * - description
+   * - signup_url
+   * additionalProperties: false
+   * ```
+   * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+   * is as follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   * required:
+   * - name
+   * - description
+   * additionalProperties: true
+   * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getDisplayMetadataOrBuilder() { + return getDisplayMetadata(); + } + + public static final int ICON_URI_FIELD_NUMBER = 4; + private volatile java.lang.Object iconUri_; + /** + * + * + *
+   * Output only. The icon URI of the product.
+   * 
+ * + * string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The iconUri. + */ + @java.lang.Override + public java.lang.String getIconUri() { + java.lang.Object ref = iconUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + iconUri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The icon URI of the product.
+   * 
+ * + * string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for iconUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIconUriBytes() { + java.lang.Object ref = iconUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iconUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ASSET_REFERENCES_FIELD_NUMBER = 10; + private java.util.List assetReferences_; + /** + * + * + *
+   * Output only. A collection of assets referred by a product.
+   * This field is set for Terraform Products only.
+   * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getAssetReferencesList() { + return assetReferences_; + } + /** + * + * + *
+   * Output only. A collection of assets referred by a product.
+   * This field is set for Terraform Products only.
+   * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getAssetReferencesOrBuilderList() { + return assetReferences_; + } + /** + * + * + *
+   * Output only. A collection of assets referred by a product.
+   * This field is set for Terraform Products only.
+   * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getAssetReferencesCount() { + return assetReferences_.size(); + } + /** + * + * + *
+   * Output only. A collection of assets referred by a product.
+   * This field is set for Terraform Products only.
+   * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.AssetReference getAssetReferences(int index) { + return assetReferences_.get(index); + } + /** + * + * + *
+   * Output only. A collection of assets referred by a product.
+   * This field is set for Terraform Products only.
+   * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.AssetReferenceOrBuilder + getAssetReferencesOrBuilder(int index) { + return assetReferences_.get(index); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the product 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; + } + /** + * + * + *
+   * Output only. The time when the product 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_; + } + /** + * + * + *
+   * Output only. The time when the product 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_; + /** + * + * + *
+   * Output only. The time when the product was last 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; + } + /** + * + * + *
+   * Output only. The time when the product was last 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_; + } + /** + * + * + *
+   * Output only. The time when the product was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getAssetTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, assetType_); + } + if (displayMetadata_ != null) { + output.writeMessage(3, getDisplayMetadata()); + } + if (!getIconUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, iconUri_); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } + for (int i = 0; i < assetReferences_.size(); i++) { + output.writeMessage(10, assetReferences_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getAssetTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, assetType_); + } + if (displayMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getDisplayMetadata()); + } + if (!getIconUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, iconUri_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + for (int i = 0; i < assetReferences_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, assetReferences_.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.cloud.privatecatalog.v1beta1.Product)) { + return super.equals(obj); + } + com.google.cloud.privatecatalog.v1beta1.Product other = + (com.google.cloud.privatecatalog.v1beta1.Product) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAssetType().equals(other.getAssetType())) return false; + if (hasDisplayMetadata() != other.hasDisplayMetadata()) return false; + if (hasDisplayMetadata()) { + if (!getDisplayMetadata().equals(other.getDisplayMetadata())) return false; + } + if (!getIconUri().equals(other.getIconUri())) return false; + if (!getAssetReferencesList().equals(other.getAssetReferencesList())) 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) + ASSET_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getAssetType().hashCode(); + if (hasDisplayMetadata()) { + hash = (37 * hash) + DISPLAY_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getDisplayMetadata().hashCode(); + } + hash = (37 * hash) + ICON_URI_FIELD_NUMBER; + hash = (53 * hash) + getIconUri().hashCode(); + if (getAssetReferencesCount() > 0) { + hash = (37 * hash) + ASSET_REFERENCES_FIELD_NUMBER; + hash = (53 * hash) + getAssetReferencesList().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.cloud.privatecatalog.v1beta1.Product parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.Product parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Product parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.Product parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Product parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.Product parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Product parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.Product parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Product parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.Product parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Product parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.Product parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.privatecatalog.v1beta1.Product prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 readonly representation of a product computed with a given resource
+   * context.
+   * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.Product} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.privatecatalog.v1beta1.Product) + com.google.cloud.privatecatalog.v1beta1.ProductOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Product_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.Product.class, + com.google.cloud.privatecatalog.v1beta1.Product.Builder.class); + } + + // Construct using com.google.cloud.privatecatalog.v1beta1.Product.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAssetReferencesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + assetType_ = ""; + + if (displayMetadataBuilder_ == null) { + displayMetadata_ = null; + } else { + displayMetadata_ = null; + displayMetadataBuilder_ = null; + } + iconUri_ = ""; + + if (assetReferencesBuilder_ == null) { + assetReferences_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + assetReferencesBuilder_.clear(); + } + 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.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Product_descriptor; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Product getDefaultInstanceForType() { + return com.google.cloud.privatecatalog.v1beta1.Product.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Product build() { + com.google.cloud.privatecatalog.v1beta1.Product result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Product buildPartial() { + com.google.cloud.privatecatalog.v1beta1.Product result = + new com.google.cloud.privatecatalog.v1beta1.Product(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.assetType_ = assetType_; + if (displayMetadataBuilder_ == null) { + result.displayMetadata_ = displayMetadata_; + } else { + result.displayMetadata_ = displayMetadataBuilder_.build(); + } + result.iconUri_ = iconUri_; + if (assetReferencesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + assetReferences_ = java.util.Collections.unmodifiableList(assetReferences_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.assetReferences_ = assetReferences_; + } else { + result.assetReferences_ = assetReferencesBuilder_.build(); + } + 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.cloud.privatecatalog.v1beta1.Product) { + return mergeFrom((com.google.cloud.privatecatalog.v1beta1.Product) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.privatecatalog.v1beta1.Product other) { + if (other == com.google.cloud.privatecatalog.v1beta1.Product.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getAssetType().isEmpty()) { + assetType_ = other.assetType_; + onChanged(); + } + if (other.hasDisplayMetadata()) { + mergeDisplayMetadata(other.getDisplayMetadata()); + } + if (!other.getIconUri().isEmpty()) { + iconUri_ = other.iconUri_; + onChanged(); + } + if (assetReferencesBuilder_ == null) { + if (!other.assetReferences_.isEmpty()) { + if (assetReferences_.isEmpty()) { + assetReferences_ = other.assetReferences_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAssetReferencesIsMutable(); + assetReferences_.addAll(other.assetReferences_); + } + onChanged(); + } + } else { + if (!other.assetReferences_.isEmpty()) { + if (assetReferencesBuilder_.isEmpty()) { + assetReferencesBuilder_.dispose(); + assetReferencesBuilder_ = null; + assetReferences_ = other.assetReferences_; + bitField0_ = (bitField0_ & ~0x00000001); + assetReferencesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAssetReferencesFieldBuilder() + : null; + } else { + assetReferencesBuilder_.addAllMessages(other.assetReferences_); + } + } + } + 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.cloud.privatecatalog.v1beta1.Product parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.privatecatalog.v1beta1.Product) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the target product, in the format of
+     * `products/[a-z][-a-z0-9]*[a-z0-9]'.
+     * A unique identifier for the product under a catalog.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the target product, in the format of
+     * `products/[a-z][-a-z0-9]*[a-z0-9]'.
+     * A unique identifier for the product under a catalog.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the target product, in the format of
+     * `products/[a-z][-a-z0-9]*[a-z0-9]'.
+     * A unique identifier for the product under a catalog.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Output only. The resource name of the target product, in the format of
+     * `products/[a-z][-a-z0-9]*[a-z0-9]'.
+     * A unique identifier for the product under a catalog.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the target product, in the format of
+     * `products/[a-z][-a-z0-9]*[a-z0-9]'.
+     * A unique identifier for the product under a catalog.
+     * 
+ * + * 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 assetType_ = ""; + /** + * + * + *
+     * Output only. The type of the product asset. It can be one of the following values:
+     * * `google.deploymentmanager.Template`
+     * * `google.cloudprivatecatalog.ListingOnly`
+     * * `google.cloudprivatecatalog.Terraform`
+     * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The assetType. + */ + public java.lang.String getAssetType() { + java.lang.Object ref = assetType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + assetType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The type of the product asset. It can be one of the following values:
+     * * `google.deploymentmanager.Template`
+     * * `google.cloudprivatecatalog.ListingOnly`
+     * * `google.cloudprivatecatalog.Terraform`
+     * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for assetType. + */ + public com.google.protobuf.ByteString getAssetTypeBytes() { + java.lang.Object ref = assetType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assetType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The type of the product asset. It can be one of the following values:
+     * * `google.deploymentmanager.Template`
+     * * `google.cloudprivatecatalog.ListingOnly`
+     * * `google.cloudprivatecatalog.Terraform`
+     * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The assetType to set. + * @return This builder for chaining. + */ + public Builder setAssetType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + assetType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of the product asset. It can be one of the following values:
+     * * `google.deploymentmanager.Template`
+     * * `google.cloudprivatecatalog.ListingOnly`
+     * * `google.cloudprivatecatalog.Terraform`
+     * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAssetType() { + + assetType_ = getDefaultInstance().getAssetType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of the product asset. It can be one of the following values:
+     * * `google.deploymentmanager.Template`
+     * * `google.cloudprivatecatalog.ListingOnly`
+     * * `google.cloudprivatecatalog.Terraform`
+     * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for assetType to set. + * @return This builder for chaining. + */ + public Builder setAssetTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + assetType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Struct displayMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + displayMetadataBuilder_; + /** + * + * + *
+     * Required. Output only. The display metadata to describe the product. The JSON schema of the
+     * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+     * When the type is `google.deploymentmanager.Template`, the schema is as
+     * follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     *   signup_url:
+     *     type: string
+     *     pattern:
+     *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     * required:
+     * - name
+     * - description
+     * - signup_url
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: true
+     * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the displayMetadata field is set. + */ + public boolean hasDisplayMetadata() { + return displayMetadataBuilder_ != null || displayMetadata_ != null; + } + /** + * + * + *
+     * Required. Output only. The display metadata to describe the product. The JSON schema of the
+     * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+     * When the type is `google.deploymentmanager.Template`, the schema is as
+     * follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     *   signup_url:
+     *     type: string
+     *     pattern:
+     *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     * required:
+     * - name
+     * - description
+     * - signup_url
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: true
+     * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The displayMetadata. + */ + public com.google.protobuf.Struct getDisplayMetadata() { + if (displayMetadataBuilder_ == null) { + return displayMetadata_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : displayMetadata_; + } else { + return displayMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Output only. The display metadata to describe the product. The JSON schema of the
+     * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+     * When the type is `google.deploymentmanager.Template`, the schema is as
+     * follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     *   signup_url:
+     *     type: string
+     *     pattern:
+     *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     * required:
+     * - name
+     * - description
+     * - signup_url
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: true
+     * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDisplayMetadata(com.google.protobuf.Struct value) { + if (displayMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + displayMetadata_ = value; + onChanged(); + } else { + displayMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Output only. The display metadata to describe the product. The JSON schema of the
+     * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+     * When the type is `google.deploymentmanager.Template`, the schema is as
+     * follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     *   signup_url:
+     *     type: string
+     *     pattern:
+     *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     * required:
+     * - name
+     * - description
+     * - signup_url
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: true
+     * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDisplayMetadata(com.google.protobuf.Struct.Builder builderForValue) { + if (displayMetadataBuilder_ == null) { + displayMetadata_ = builderForValue.build(); + onChanged(); + } else { + displayMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Output only. The display metadata to describe the product. The JSON schema of the
+     * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+     * When the type is `google.deploymentmanager.Template`, the schema is as
+     * follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     *   signup_url:
+     *     type: string
+     *     pattern:
+     *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     * required:
+     * - name
+     * - description
+     * - signup_url
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: true
+     * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDisplayMetadata(com.google.protobuf.Struct value) { + if (displayMetadataBuilder_ == null) { + if (displayMetadata_ != null) { + displayMetadata_ = + com.google.protobuf.Struct.newBuilder(displayMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + displayMetadata_ = value; + } + onChanged(); + } else { + displayMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Output only. The display metadata to describe the product. The JSON schema of the
+     * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+     * When the type is `google.deploymentmanager.Template`, the schema is as
+     * follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     *   signup_url:
+     *     type: string
+     *     pattern:
+     *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     * required:
+     * - name
+     * - description
+     * - signup_url
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: true
+     * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDisplayMetadata() { + if (displayMetadataBuilder_ == null) { + displayMetadata_ = null; + onChanged(); + } else { + displayMetadata_ = null; + displayMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Output only. The display metadata to describe the product. The JSON schema of the
+     * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+     * When the type is `google.deploymentmanager.Template`, the schema is as
+     * follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     *   signup_url:
+     *     type: string
+     *     pattern:
+     *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     * required:
+     * - name
+     * - description
+     * - signup_url
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: true
+     * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Struct.Builder getDisplayMetadataBuilder() { + + onChanged(); + return getDisplayMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Output only. The display metadata to describe the product. The JSON schema of the
+     * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+     * When the type is `google.deploymentmanager.Template`, the schema is as
+     * follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     *   signup_url:
+     *     type: string
+     *     pattern:
+     *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     * required:
+     * - name
+     * - description
+     * - signup_url
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: true
+     * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.StructOrBuilder getDisplayMetadataOrBuilder() { + if (displayMetadataBuilder_ != null) { + return displayMetadataBuilder_.getMessageOrBuilder(); + } else { + return displayMetadata_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : displayMetadata_; + } + } + /** + * + * + *
+     * Required. Output only. The display metadata to describe the product. The JSON schema of the
+     * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+     * When the type is `google.deploymentmanager.Template`, the schema is as
+     * follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     *   signup_url:
+     *     type: string
+     *     pattern:
+     *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     * required:
+     * - name
+     * - description
+     * - signup_url
+     * additionalProperties: false
+     * ```
+     * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+     * is as follows:
+     * ```
+     * "$schema": http://json-schema.org/draft-04/schema#
+     * type: object
+     * properties:
+     *   name:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 64
+     *   description:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   tagline:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   support_info:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 2048
+     *   creator:
+     *     type: string
+     *     minLength: 1
+     *     maxLength: 100
+     *   documentations:
+     *     type: array
+     *     items:
+     *       type: object
+     *       properties:
+     *         url:
+     *           type: string
+     *           pattern:
+     *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+     *         title:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 64
+     *         description:
+     *           type: string
+     *           minLength: 1
+     *           maxLength: 2048
+     * required:
+     * - name
+     * - description
+     * additionalProperties: true
+     * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getDisplayMetadataFieldBuilder() { + if (displayMetadataBuilder_ == null) { + displayMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getDisplayMetadata(), getParentForChildren(), isClean()); + displayMetadata_ = null; + } + return displayMetadataBuilder_; + } + + private java.lang.Object iconUri_ = ""; + /** + * + * + *
+     * Output only. The icon URI of the product.
+     * 
+ * + * string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The iconUri. + */ + public java.lang.String getIconUri() { + java.lang.Object ref = iconUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + iconUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The icon URI of the product.
+     * 
+ * + * string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for iconUri. + */ + public com.google.protobuf.ByteString getIconUriBytes() { + java.lang.Object ref = iconUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iconUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The icon URI of the product.
+     * 
+ * + * string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The iconUri to set. + * @return This builder for chaining. + */ + public Builder setIconUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + iconUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The icon URI of the product.
+     * 
+ * + * string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearIconUri() { + + iconUri_ = getDefaultInstance().getIconUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The icon URI of the product.
+     * 
+ * + * string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for iconUri to set. + * @return This builder for chaining. + */ + public Builder setIconUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + iconUri_ = value; + onChanged(); + return this; + } + + private java.util.List + assetReferences_ = java.util.Collections.emptyList(); + + private void ensureAssetReferencesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + assetReferences_ = + new java.util.ArrayList( + assetReferences_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.AssetReference, + com.google.cloud.privatecatalog.v1beta1.AssetReference.Builder, + com.google.cloud.privatecatalog.v1beta1.AssetReferenceOrBuilder> + assetReferencesBuilder_; + + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getAssetReferencesList() { + if (assetReferencesBuilder_ == null) { + return java.util.Collections.unmodifiableList(assetReferences_); + } else { + return assetReferencesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getAssetReferencesCount() { + if (assetReferencesBuilder_ == null) { + return assetReferences_.size(); + } else { + return assetReferencesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.privatecatalog.v1beta1.AssetReference getAssetReferences(int index) { + if (assetReferencesBuilder_ == null) { + return assetReferences_.get(index); + } else { + return assetReferencesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAssetReferences( + int index, com.google.cloud.privatecatalog.v1beta1.AssetReference value) { + if (assetReferencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetReferencesIsMutable(); + assetReferences_.set(index, value); + onChanged(); + } else { + assetReferencesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAssetReferences( + int index, com.google.cloud.privatecatalog.v1beta1.AssetReference.Builder builderForValue) { + if (assetReferencesBuilder_ == null) { + ensureAssetReferencesIsMutable(); + assetReferences_.set(index, builderForValue.build()); + onChanged(); + } else { + assetReferencesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAssetReferences( + com.google.cloud.privatecatalog.v1beta1.AssetReference value) { + if (assetReferencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetReferencesIsMutable(); + assetReferences_.add(value); + onChanged(); + } else { + assetReferencesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAssetReferences( + int index, com.google.cloud.privatecatalog.v1beta1.AssetReference value) { + if (assetReferencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetReferencesIsMutable(); + assetReferences_.add(index, value); + onChanged(); + } else { + assetReferencesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAssetReferences( + com.google.cloud.privatecatalog.v1beta1.AssetReference.Builder builderForValue) { + if (assetReferencesBuilder_ == null) { + ensureAssetReferencesIsMutable(); + assetReferences_.add(builderForValue.build()); + onChanged(); + } else { + assetReferencesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAssetReferences( + int index, com.google.cloud.privatecatalog.v1beta1.AssetReference.Builder builderForValue) { + if (assetReferencesBuilder_ == null) { + ensureAssetReferencesIsMutable(); + assetReferences_.add(index, builderForValue.build()); + onChanged(); + } else { + assetReferencesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllAssetReferences( + java.lang.Iterable + values) { + if (assetReferencesBuilder_ == null) { + ensureAssetReferencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, assetReferences_); + onChanged(); + } else { + assetReferencesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearAssetReferences() { + if (assetReferencesBuilder_ == null) { + assetReferences_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + assetReferencesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeAssetReferences(int index) { + if (assetReferencesBuilder_ == null) { + ensureAssetReferencesIsMutable(); + assetReferences_.remove(index); + onChanged(); + } else { + assetReferencesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.privatecatalog.v1beta1.AssetReference.Builder getAssetReferencesBuilder( + int index) { + return getAssetReferencesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.privatecatalog.v1beta1.AssetReferenceOrBuilder + getAssetReferencesOrBuilder(int index) { + if (assetReferencesBuilder_ == null) { + return assetReferences_.get(index); + } else { + return assetReferencesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getAssetReferencesOrBuilderList() { + if (assetReferencesBuilder_ != null) { + return assetReferencesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(assetReferences_); + } + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.privatecatalog.v1beta1.AssetReference.Builder + addAssetReferencesBuilder() { + return getAssetReferencesFieldBuilder() + .addBuilder(com.google.cloud.privatecatalog.v1beta1.AssetReference.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.privatecatalog.v1beta1.AssetReference.Builder addAssetReferencesBuilder( + int index) { + return getAssetReferencesFieldBuilder() + .addBuilder( + index, com.google.cloud.privatecatalog.v1beta1.AssetReference.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. A collection of assets referred by a product.
+     * This field is set for Terraform Products only.
+     * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getAssetReferencesBuilderList() { + return getAssetReferencesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.AssetReference, + com.google.cloud.privatecatalog.v1beta1.AssetReference.Builder, + com.google.cloud.privatecatalog.v1beta1.AssetReferenceOrBuilder> + getAssetReferencesFieldBuilder() { + if (assetReferencesBuilder_ == null) { + assetReferencesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.AssetReference, + com.google.cloud.privatecatalog.v1beta1.AssetReference.Builder, + com.google.cloud.privatecatalog.v1beta1.AssetReferenceOrBuilder>( + assetReferences_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + assetReferences_ = null; + } + return assetReferencesBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the product 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; + } + /** + * + * + *
+     * Output only. The time when the product 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(); + } + } + /** + * + * + *
+     * Output only. The time when the product 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; + } + /** + * + * + *
+     * Output only. The time when the product 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; + } + /** + * + * + *
+     * Output only. The time when the product 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; + } + /** + * + * + *
+     * Output only. The time when the product 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; + } + /** + * + * + *
+     * Output only. The time when the product 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(); + } + /** + * + * + *
+     * Output only. The time when the product 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_; + } + } + /** + * + * + *
+     * Output only. The time when the product 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_; + /** + * + * + *
+     * Output only. The time when the product was last 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; + } + /** + * + * + *
+     * Output only. The time when the product was last 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(); + } + } + /** + * + * + *
+     * Output only. The time when the product was last 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; + } + /** + * + * + *
+     * Output only. The time when the product was last 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; + } + /** + * + * + *
+     * Output only. The time when the product was last 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; + } + /** + * + * + *
+     * Output only. The time when the product was last 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; + } + /** + * + * + *
+     * Output only. The time when the product was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the product was last 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_; + } + } + /** + * + * + *
+     * Output only. The time when the product was last 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_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(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.privatecatalog.v1beta1.Product) + } + + // @@protoc_insertion_point(class_scope:google.cloud.privatecatalog.v1beta1.Product) + private static final com.google.cloud.privatecatalog.v1beta1.Product DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.privatecatalog.v1beta1.Product(); + } + + public static com.google.cloud.privatecatalog.v1beta1.Product getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Product parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Product(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Product getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/ProductName.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/ProductName.java new file mode 100644 index 00000000..dd5371cd --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/ProductName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.privatecatalog.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 ProductName implements ResourceName { + private static final PathTemplate PRODUCT = + PathTemplate.createWithoutUrlEncoding("products/{product}"); + private volatile Map fieldValuesMap; + private final String product; + + @Deprecated + protected ProductName() { + product = null; + } + + private ProductName(Builder builder) { + product = Preconditions.checkNotNull(builder.getProduct()); + } + + public String getProduct() { + return product; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProductName of(String product) { + return newBuilder().setProduct(product).build(); + } + + public static String format(String product) { + return newBuilder().setProduct(product).build().toString(); + } + + public static ProductName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PRODUCT.validatedMatch( + formattedString, "ProductName.parse: formattedString not in valid format"); + return of(matchMap.get("product")); + } + + 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 (ProductName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PRODUCT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (product != null) { + fieldMapBuilder.put("product", product); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PRODUCT.instantiate("product", product); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ProductName that = ((ProductName) o); + return Objects.equals(this.product, that.product); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(product); + return h; + } + + /** Builder for products/{product}. */ + public static class Builder { + private String product; + + protected Builder() {} + + public String getProduct() { + return product; + } + + public Builder setProduct(String product) { + this.product = product; + return this; + } + + private Builder(ProductName productName) { + product = productName.product; + } + + public ProductName build() { + return new ProductName(this); + } + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/ProductOrBuilder.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/ProductOrBuilder.java new file mode 100644 index 00000000..f21fd971 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/ProductOrBuilder.java @@ -0,0 +1,742 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public interface ProductOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.privatecatalog.v1beta1.Product) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the target product, in the format of
+   * `products/[a-z][-a-z0-9]*[a-z0-9]'.
+   * A unique identifier for the product under a catalog.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the target product, in the format of
+   * `products/[a-z][-a-z0-9]*[a-z0-9]'.
+   * A unique identifier for the product under a catalog.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The type of the product asset. It can be one of the following values:
+   * * `google.deploymentmanager.Template`
+   * * `google.cloudprivatecatalog.ListingOnly`
+   * * `google.cloudprivatecatalog.Terraform`
+   * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The assetType. + */ + java.lang.String getAssetType(); + /** + * + * + *
+   * Output only. The type of the product asset. It can be one of the following values:
+   * * `google.deploymentmanager.Template`
+   * * `google.cloudprivatecatalog.ListingOnly`
+   * * `google.cloudprivatecatalog.Terraform`
+   * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for assetType. + */ + com.google.protobuf.ByteString getAssetTypeBytes(); + + /** + * + * + *
+   * Required. Output only. The display metadata to describe the product. The JSON schema of the
+   * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+   * When the type is `google.deploymentmanager.Template`, the schema is as
+   * follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   * required:
+   * - name
+   * - description
+   * additionalProperties: false
+   * ```
+   * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+   * is as follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   *   signup_url:
+   *     type: string
+   *     pattern:
+   *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   * required:
+   * - name
+   * - description
+   * - signup_url
+   * additionalProperties: false
+   * ```
+   * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+   * is as follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   * required:
+   * - name
+   * - description
+   * additionalProperties: true
+   * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the displayMetadata field is set. + */ + boolean hasDisplayMetadata(); + /** + * + * + *
+   * Required. Output only. The display metadata to describe the product. The JSON schema of the
+   * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+   * When the type is `google.deploymentmanager.Template`, the schema is as
+   * follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   * required:
+   * - name
+   * - description
+   * additionalProperties: false
+   * ```
+   * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+   * is as follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   *   signup_url:
+   *     type: string
+   *     pattern:
+   *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   * required:
+   * - name
+   * - description
+   * - signup_url
+   * additionalProperties: false
+   * ```
+   * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+   * is as follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   * required:
+   * - name
+   * - description
+   * additionalProperties: true
+   * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The displayMetadata. + */ + com.google.protobuf.Struct getDisplayMetadata(); + /** + * + * + *
+   * Required. Output only. The display metadata to describe the product. The JSON schema of the
+   * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
+   * When the type is `google.deploymentmanager.Template`, the schema is as
+   * follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   * required:
+   * - name
+   * - description
+   * additionalProperties: false
+   * ```
+   * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
+   * is as follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   *   signup_url:
+   *     type: string
+   *     pattern:
+   *     "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   * required:
+   * - name
+   * - description
+   * - signup_url
+   * additionalProperties: false
+   * ```
+   * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
+   * is as follows:
+   * ```
+   * "$schema": http://json-schema.org/draft-04/schema#
+   * type: object
+   * properties:
+   *   name:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 64
+   *   description:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   tagline:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   support_info:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 2048
+   *   creator:
+   *     type: string
+   *     minLength: 1
+   *     maxLength: 100
+   *   documentations:
+   *     type: array
+   *     items:
+   *       type: object
+   *       properties:
+   *         url:
+   *           type: string
+   *           pattern:
+   *           "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
+   *         title:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 64
+   *         description:
+   *           type: string
+   *           minLength: 1
+   *           maxLength: 2048
+   * required:
+   * - name
+   * - description
+   * additionalProperties: true
+   * 
+ * + * + * .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.StructOrBuilder getDisplayMetadataOrBuilder(); + + /** + * + * + *
+   * Output only. The icon URI of the product.
+   * 
+ * + * string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The iconUri. + */ + java.lang.String getIconUri(); + /** + * + * + *
+   * Output only. The icon URI of the product.
+   * 
+ * + * string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for iconUri. + */ + com.google.protobuf.ByteString getIconUriBytes(); + + /** + * + * + *
+   * Output only. A collection of assets referred by a product.
+   * This field is set for Terraform Products only.
+   * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getAssetReferencesList(); + /** + * + * + *
+   * Output only. A collection of assets referred by a product.
+   * This field is set for Terraform Products only.
+   * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.privatecatalog.v1beta1.AssetReference getAssetReferences(int index); + /** + * + * + *
+   * Output only. A collection of assets referred by a product.
+   * This field is set for Terraform Products only.
+   * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getAssetReferencesCount(); + /** + * + * + *
+   * Output only. A collection of assets referred by a product.
+   * This field is set for Terraform Products only.
+   * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getAssetReferencesOrBuilderList(); + /** + * + * + *
+   * Output only. A collection of assets referred by a product.
+   * This field is set for Terraform Products only.
+   * 
+ * + * + * repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.privatecatalog.v1beta1.AssetReferenceOrBuilder getAssetReferencesOrBuilder( + int index); + + /** + * + * + *
+   * Output only. The time when the product was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time when the product was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time when the product was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the product was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time when the product was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time when the product was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsRequest.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsRequest.java new file mode 100644 index 00000000..d9c64b54 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsRequest.java @@ -0,0 +1,1124 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +/** + * + * + *
+ * Request message for [PrivateCatalog.SearchCatalogs][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchCatalogs].
+ * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest} + */ +public final class SearchCatalogsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest) + SearchCatalogsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchCatalogsRequest.newBuilder() to construct. + private SearchCatalogsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchCatalogsRequest() { + resource_ = ""; + query_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchCatalogsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchCatalogsRequest( + 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(); + + resource_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.class, + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.Builder.class); + } + + public static final int RESOURCE_FIELD_NUMBER = 1; + private volatile java.lang.Object resource_; + /** + * + * + *
+   * Required. The name of the resource context. It can be in following formats:
+   * * `projects/{project}`
+   * * `folders/{folder}`
+   * * `organizations/{organization}`
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + @java.lang.Override + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resource context. It can be in following formats:
+   * * `projects/{project}`
+   * * `folders/{folder}`
+   * * `organizations/{organization}`
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 2; + private volatile java.lang.Object query_; + /** + * + * + *
+   * The query to filter the catalogs. The supported queries are:
+   * * Get a single catalog: `name=catalogs/{catalog}`
+   * 
+ * + * string query = 2; + * + * @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 to filter the catalogs. The supported queries are:
+   * * Get a single catalog: `name=catalogs/{catalog}`
+   * 
+ * + * string query = 2; + * + * @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 PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of entries that are requested.
+   * 
+ * + * 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_; + /** + * + * + *
+   * A pagination token returned from a previous call to SearchCatalogs that
+   * indicates where this listing should continue from.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * A pagination token returned from a previous call to SearchCatalogs that
+   * indicates where this listing should continue from.
+   * 
+ * + * 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 (!getResourceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resource_); + } + if (!getQueryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getResourceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resource_); + } + if (!getQueryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest)) { + return super.equals(obj); + } + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest other = + (com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest) obj; + + if (!getResource().equals(other.getResource())) return false; + if (!getQuery().equals(other.getQuery())) 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) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 [PrivateCatalog.SearchCatalogs][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchCatalogs].
+   * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest) + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.class, + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.Builder.class); + } + + // Construct using com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.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(); + resource_ = ""; + + query_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest + getDefaultInstanceForType() { + return com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest build() { + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest buildPartial() { + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest result = + new com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest(this); + result.resource_ = resource_; + result.query_ = query_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest) { + return mergeFrom((com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest other) { + if (other + == com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.getDefaultInstance()) + return this; + if (!other.getResource().isEmpty()) { + resource_ = other.resource_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object resource_ = ""; + /** + * + * + *
+     * Required. The name of the resource context. It can be in following formats:
+     * * `projects/{project}`
+     * * `folders/{folder}`
+     * * `organizations/{organization}`
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource context. It can be in following formats:
+     * * `projects/{project}`
+     * * `folders/{folder}`
+     * * `organizations/{organization}`
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource context. It can be in following formats:
+     * * `projects/{project}`
+     * * `folders/{folder}`
+     * * `organizations/{organization}`
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The resource to set. + * @return This builder for chaining. + */ + public Builder setResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource context. It can be in following formats:
+     * * `projects/{project}`
+     * * `folders/{folder}`
+     * * `organizations/{organization}`
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearResource() { + + resource_ = getDefaultInstance().getResource(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource context. It can be in following formats:
+     * * `projects/{project}`
+     * * `folders/{folder}`
+     * * `organizations/{organization}`
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for resource to set. + * @return This builder for chaining. + */ + public Builder setResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resource_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * The query to filter the catalogs. The supported queries are:
+     * * Get a single catalog: `name=catalogs/{catalog}`
+     * 
+ * + * string query = 2; + * + * @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 to filter the catalogs. The supported queries are:
+     * * Get a single catalog: `name=catalogs/{catalog}`
+     * 
+ * + * string query = 2; + * + * @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 to filter the catalogs. The supported queries are:
+     * * Get a single catalog: `name=catalogs/{catalog}`
+     * 
+ * + * string query = 2; + * + * @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 to filter the catalogs. The supported queries are:
+     * * Get a single catalog: `name=catalogs/{catalog}`
+     * 
+ * + * string query = 2; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * The query to filter the catalogs. The supported queries are:
+     * * Get a single catalog: `name=catalogs/{catalog}`
+     * 
+ * + * string query = 2; + * + * @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 int pageSize_; + /** + * + * + *
+     * The maximum number of entries that are requested.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of entries that are requested.
+     * 
+ * + * 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 entries that are requested.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A pagination token returned from a previous call to SearchCatalogs that
+     * indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchCatalogs that
+     * indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchCatalogs that
+     * indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchCatalogs that
+     * indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchCatalogs that
+     * indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest) + private static final com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest(); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchCatalogsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchCatalogsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsRequestOrBuilder.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsRequestOrBuilder.java new file mode 100644 index 00000000..5902d0dd --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public interface SearchCatalogsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource context. It can be in following formats:
+   * * `projects/{project}`
+   * * `folders/{folder}`
+   * * `organizations/{organization}`
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + java.lang.String getResource(); + /** + * + * + *
+   * Required. The name of the resource context. It can be in following formats:
+   * * `projects/{project}`
+   * * `folders/{folder}`
+   * * `organizations/{organization}`
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + com.google.protobuf.ByteString getResourceBytes(); + + /** + * + * + *
+   * The query to filter the catalogs. The supported queries are:
+   * * Get a single catalog: `name=catalogs/{catalog}`
+   * 
+ * + * string query = 2; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * The query to filter the catalogs. The supported queries are:
+   * * Get a single catalog: `name=catalogs/{catalog}`
+   * 
+ * + * string query = 2; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * The maximum number of entries that are requested.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A pagination token returned from a previous call to SearchCatalogs that
+   * indicates where this listing should continue from.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A pagination token returned from a previous call to SearchCatalogs that
+   * indicates where this listing should continue from.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsResponse.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsResponse.java new file mode 100644 index 00000000..8fa3a0ff --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsResponse.java @@ -0,0 +1,1146 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +/** + * + * + *
+ * Response message for [PrivateCatalog.SearchCatalogs][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchCatalogs].
+ * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse} + */ +public final class SearchCatalogsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse) + SearchCatalogsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchCatalogsResponse.newBuilder() to construct. + private SearchCatalogsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchCatalogsResponse() { + catalogs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchCatalogsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchCatalogsResponse( + 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)) { + catalogs_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + catalogs_.add( + input.readMessage( + com.google.cloud.privatecatalog.v1beta1.Catalog.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + catalogs_ = java.util.Collections.unmodifiableList(catalogs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse.class, + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse.Builder.class); + } + + public static final int CATALOGS_FIELD_NUMBER = 1; + private java.util.List catalogs_; + /** + * + * + *
+   * The `Catalog`s computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + @java.lang.Override + public java.util.List getCatalogsList() { + return catalogs_; + } + /** + * + * + *
+   * The `Catalog`s computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + @java.lang.Override + public java.util.List + getCatalogsOrBuilderList() { + return catalogs_; + } + /** + * + * + *
+   * The `Catalog`s computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + @java.lang.Override + public int getCatalogsCount() { + return catalogs_.size(); + } + /** + * + * + *
+   * The `Catalog`s computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Catalog getCatalogs(int index) { + return catalogs_.get(index); + } + /** + * + * + *
+   * The `Catalog`s computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.CatalogOrBuilder getCatalogsOrBuilder(int index) { + return catalogs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A pagination token returned from a previous call to SearchCatalogs that
+   * indicates from where listing should continue.
+   * 
+ * + * 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 pagination token returned from a previous call to SearchCatalogs that
+   * indicates from where listing should continue.
+   * 
+ * + * 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 < catalogs_.size(); i++) { + output.writeMessage(1, catalogs_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < catalogs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, catalogs_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse)) { + return super.equals(obj); + } + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse other = + (com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse) obj; + + if (!getCatalogsList().equals(other.getCatalogsList())) 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 (getCatalogsCount() > 0) { + hash = (37 * hash) + CATALOGS_FIELD_NUMBER; + hash = (53 * hash) + getCatalogsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 [PrivateCatalog.SearchCatalogs][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchCatalogs].
+   * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse) + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse.class, + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse.Builder.class); + } + + // Construct using com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCatalogsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (catalogsBuilder_ == null) { + catalogs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + catalogsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchCatalogsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse + getDefaultInstanceForType() { + return com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse build() { + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse buildPartial() { + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse result = + new com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse(this); + int from_bitField0_ = bitField0_; + if (catalogsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + catalogs_ = java.util.Collections.unmodifiableList(catalogs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.catalogs_ = catalogs_; + } else { + result.catalogs_ = catalogsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse) { + return mergeFrom((com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse other) { + if (other + == com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse.getDefaultInstance()) + return this; + if (catalogsBuilder_ == null) { + if (!other.catalogs_.isEmpty()) { + if (catalogs_.isEmpty()) { + catalogs_ = other.catalogs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCatalogsIsMutable(); + catalogs_.addAll(other.catalogs_); + } + onChanged(); + } + } else { + if (!other.catalogs_.isEmpty()) { + if (catalogsBuilder_.isEmpty()) { + catalogsBuilder_.dispose(); + catalogsBuilder_ = null; + catalogs_ = other.catalogs_; + bitField0_ = (bitField0_ & ~0x00000001); + catalogsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCatalogsFieldBuilder() + : null; + } else { + catalogsBuilder_.addAllMessages(other.catalogs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List catalogs_ = + java.util.Collections.emptyList(); + + private void ensureCatalogsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + catalogs_ = + new java.util.ArrayList(catalogs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.Catalog, + com.google.cloud.privatecatalog.v1beta1.Catalog.Builder, + com.google.cloud.privatecatalog.v1beta1.CatalogOrBuilder> + catalogsBuilder_; + + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public java.util.List getCatalogsList() { + if (catalogsBuilder_ == null) { + return java.util.Collections.unmodifiableList(catalogs_); + } else { + return catalogsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public int getCatalogsCount() { + if (catalogsBuilder_ == null) { + return catalogs_.size(); + } else { + return catalogsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.Catalog getCatalogs(int index) { + if (catalogsBuilder_ == null) { + return catalogs_.get(index); + } else { + return catalogsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public Builder setCatalogs(int index, com.google.cloud.privatecatalog.v1beta1.Catalog value) { + if (catalogsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogsIsMutable(); + catalogs_.set(index, value); + onChanged(); + } else { + catalogsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public Builder setCatalogs( + int index, com.google.cloud.privatecatalog.v1beta1.Catalog.Builder builderForValue) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + catalogs_.set(index, builderForValue.build()); + onChanged(); + } else { + catalogsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public Builder addCatalogs(com.google.cloud.privatecatalog.v1beta1.Catalog value) { + if (catalogsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogsIsMutable(); + catalogs_.add(value); + onChanged(); + } else { + catalogsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public Builder addCatalogs(int index, com.google.cloud.privatecatalog.v1beta1.Catalog value) { + if (catalogsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogsIsMutable(); + catalogs_.add(index, value); + onChanged(); + } else { + catalogsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public Builder addCatalogs( + com.google.cloud.privatecatalog.v1beta1.Catalog.Builder builderForValue) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + catalogs_.add(builderForValue.build()); + onChanged(); + } else { + catalogsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public Builder addCatalogs( + int index, com.google.cloud.privatecatalog.v1beta1.Catalog.Builder builderForValue) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + catalogs_.add(index, builderForValue.build()); + onChanged(); + } else { + catalogsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public Builder addAllCatalogs( + java.lang.Iterable values) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, catalogs_); + onChanged(); + } else { + catalogsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public Builder clearCatalogs() { + if (catalogsBuilder_ == null) { + catalogs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + catalogsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public Builder removeCatalogs(int index) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + catalogs_.remove(index); + onChanged(); + } else { + catalogsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.Catalog.Builder getCatalogsBuilder(int index) { + return getCatalogsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.CatalogOrBuilder getCatalogsOrBuilder( + int index) { + if (catalogsBuilder_ == null) { + return catalogs_.get(index); + } else { + return catalogsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public java.util.List + getCatalogsOrBuilderList() { + if (catalogsBuilder_ != null) { + return catalogsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(catalogs_); + } + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.Catalog.Builder addCatalogsBuilder() { + return getCatalogsFieldBuilder() + .addBuilder(com.google.cloud.privatecatalog.v1beta1.Catalog.getDefaultInstance()); + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.Catalog.Builder addCatalogsBuilder(int index) { + return getCatalogsFieldBuilder() + .addBuilder(index, com.google.cloud.privatecatalog.v1beta1.Catalog.getDefaultInstance()); + } + /** + * + * + *
+     * The `Catalog`s computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + public java.util.List + getCatalogsBuilderList() { + return getCatalogsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.Catalog, + com.google.cloud.privatecatalog.v1beta1.Catalog.Builder, + com.google.cloud.privatecatalog.v1beta1.CatalogOrBuilder> + getCatalogsFieldBuilder() { + if (catalogsBuilder_ == null) { + catalogsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.Catalog, + com.google.cloud.privatecatalog.v1beta1.Catalog.Builder, + com.google.cloud.privatecatalog.v1beta1.CatalogOrBuilder>( + catalogs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + catalogs_ = null; + } + return catalogsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A pagination token returned from a previous call to SearchCatalogs that
+     * indicates from where listing should continue.
+     * 
+ * + * 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 pagination token returned from a previous call to SearchCatalogs that
+     * indicates from where listing should continue.
+     * 
+ * + * 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 pagination token returned from a previous call to SearchCatalogs that
+     * indicates from where listing should continue.
+     * 
+ * + * 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 pagination token returned from a previous call to SearchCatalogs that
+     * indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchCatalogs that
+     * indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse) + private static final com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse(); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchCatalogsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchCatalogsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsResponseOrBuilder.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsResponseOrBuilder.java new file mode 100644 index 00000000..e9f441b6 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchCatalogsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public interface SearchCatalogsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The `Catalog`s computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + java.util.List getCatalogsList(); + /** + * + * + *
+   * The `Catalog`s computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + com.google.cloud.privatecatalog.v1beta1.Catalog getCatalogs(int index); + /** + * + * + *
+   * The `Catalog`s computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + int getCatalogsCount(); + /** + * + * + *
+   * The `Catalog`s computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + java.util.List + getCatalogsOrBuilderList(); + /** + * + * + *
+   * The `Catalog`s computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + com.google.cloud.privatecatalog.v1beta1.CatalogOrBuilder getCatalogsOrBuilder(int index); + + /** + * + * + *
+   * A pagination token returned from a previous call to SearchCatalogs that
+   * indicates from where listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A pagination token returned from a previous call to SearchCatalogs that
+   * indicates from where listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsRequest.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsRequest.java new file mode 100644 index 00000000..186f681b --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsRequest.java @@ -0,0 +1,1138 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +/** + * + * + *
+ * Request message for [PrivateCatalog.SearchProducts][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchProducts].
+ * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.SearchProductsRequest} + */ +public final class SearchProductsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.privatecatalog.v1beta1.SearchProductsRequest) + SearchProductsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchProductsRequest.newBuilder() to construct. + private SearchProductsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchProductsRequest() { + resource_ = ""; + query_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchProductsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchProductsRequest( + 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(); + + resource_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest.class, + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest.Builder.class); + } + + public static final int RESOURCE_FIELD_NUMBER = 1; + private volatile java.lang.Object resource_; + /** + * + * + *
+   * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+   * for details.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + @java.lang.Override + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+   * for details.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 2; + private volatile java.lang.Object query_; + /** + * + * + *
+   * The query to filter the products.
+   * The supported queries are:
+   * * List products of all catalogs: empty
+   * * List products under a catalog: `parent=catalogs/{catalog}`
+   * * Get a product by name:
+   * `name=catalogs/{catalog}/products/{product}`
+   * 
+ * + * string query = 2; + * + * @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 to filter the products.
+   * The supported queries are:
+   * * List products of all catalogs: empty
+   * * List products under a catalog: `parent=catalogs/{catalog}`
+   * * Get a product by name:
+   * `name=catalogs/{catalog}/products/{product}`
+   * 
+ * + * string query = 2; + * + * @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 PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of entries that are requested.
+   * 
+ * + * 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_; + /** + * + * + *
+   * A pagination token returned from a previous call to SearchProducts that
+   * indicates where this listing should continue from.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * A pagination token returned from a previous call to SearchProducts that
+   * indicates where this listing should continue from.
+   * 
+ * + * 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 (!getResourceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resource_); + } + if (!getQueryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getResourceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resource_); + } + if (!getQueryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest)) { + return super.equals(obj); + } + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest other = + (com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest) obj; + + if (!getResource().equals(other.getResource())) return false; + if (!getQuery().equals(other.getQuery())) 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) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 [PrivateCatalog.SearchProducts][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchProducts].
+   * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.SearchProductsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.privatecatalog.v1beta1.SearchProductsRequest) + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest.class, + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest.Builder.class); + } + + // Construct using com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest.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(); + resource_ = ""; + + query_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest + getDefaultInstanceForType() { + return com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest build() { + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest buildPartial() { + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest result = + new com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest(this); + result.resource_ = resource_; + result.query_ = query_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest) { + return mergeFrom((com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest other) { + if (other + == com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest.getDefaultInstance()) + return this; + if (!other.getResource().isEmpty()) { + resource_ = other.resource_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object resource_ = ""; + /** + * + * + *
+     * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+     * for details.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+     * for details.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+     * for details.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The resource to set. + * @return This builder for chaining. + */ + public Builder setResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+     * for details.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearResource() { + + resource_ = getDefaultInstance().getResource(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+     * for details.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for resource to set. + * @return This builder for chaining. + */ + public Builder setResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resource_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * The query to filter the products.
+     * The supported queries are:
+     * * List products of all catalogs: empty
+     * * List products under a catalog: `parent=catalogs/{catalog}`
+     * * Get a product by name:
+     * `name=catalogs/{catalog}/products/{product}`
+     * 
+ * + * string query = 2; + * + * @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 to filter the products.
+     * The supported queries are:
+     * * List products of all catalogs: empty
+     * * List products under a catalog: `parent=catalogs/{catalog}`
+     * * Get a product by name:
+     * `name=catalogs/{catalog}/products/{product}`
+     * 
+ * + * string query = 2; + * + * @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 to filter the products.
+     * The supported queries are:
+     * * List products of all catalogs: empty
+     * * List products under a catalog: `parent=catalogs/{catalog}`
+     * * Get a product by name:
+     * `name=catalogs/{catalog}/products/{product}`
+     * 
+ * + * string query = 2; + * + * @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 to filter the products.
+     * The supported queries are:
+     * * List products of all catalogs: empty
+     * * List products under a catalog: `parent=catalogs/{catalog}`
+     * * Get a product by name:
+     * `name=catalogs/{catalog}/products/{product}`
+     * 
+ * + * string query = 2; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * The query to filter the products.
+     * The supported queries are:
+     * * List products of all catalogs: empty
+     * * List products under a catalog: `parent=catalogs/{catalog}`
+     * * Get a product by name:
+     * `name=catalogs/{catalog}/products/{product}`
+     * 
+ * + * string query = 2; + * + * @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 int pageSize_; + /** + * + * + *
+     * The maximum number of entries that are requested.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of entries that are requested.
+     * 
+ * + * 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 entries that are requested.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A pagination token returned from a previous call to SearchProducts that
+     * indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchProducts that
+     * indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchProducts that
+     * indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchProducts that
+     * indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchProducts that
+     * indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.privatecatalog.v1beta1.SearchProductsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.privatecatalog.v1beta1.SearchProductsRequest) + private static final com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest(); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchProductsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchProductsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchProductsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsRequestOrBuilder.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsRequestOrBuilder.java new file mode 100644 index 00000000..215d80d6 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsRequestOrBuilder.java @@ -0,0 +1,127 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public interface SearchProductsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.privatecatalog.v1beta1.SearchProductsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+   * for details.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + java.lang.String getResource(); + /** + * + * + *
+   * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+   * for details.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + com.google.protobuf.ByteString getResourceBytes(); + + /** + * + * + *
+   * The query to filter the products.
+   * The supported queries are:
+   * * List products of all catalogs: empty
+   * * List products under a catalog: `parent=catalogs/{catalog}`
+   * * Get a product by name:
+   * `name=catalogs/{catalog}/products/{product}`
+   * 
+ * + * string query = 2; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * The query to filter the products.
+   * The supported queries are:
+   * * List products of all catalogs: empty
+   * * List products under a catalog: `parent=catalogs/{catalog}`
+   * * Get a product by name:
+   * `name=catalogs/{catalog}/products/{product}`
+   * 
+ * + * string query = 2; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * The maximum number of entries that are requested.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A pagination token returned from a previous call to SearchProducts that
+   * indicates where this listing should continue from.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A pagination token returned from a previous call to SearchProducts that
+   * indicates where this listing should continue from.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsResponse.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsResponse.java new file mode 100644 index 00000000..145d18b3 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsResponse.java @@ -0,0 +1,1146 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +/** + * + * + *
+ * Response message for [PrivateCatalog.SearchProducts][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchProducts].
+ * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.SearchProductsResponse} + */ +public final class SearchProductsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.privatecatalog.v1beta1.SearchProductsResponse) + SearchProductsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchProductsResponse.newBuilder() to construct. + private SearchProductsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchProductsResponse() { + products_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchProductsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchProductsResponse( + 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)) { + products_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + products_.add( + input.readMessage( + com.google.cloud.privatecatalog.v1beta1.Product.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + products_ = java.util.Collections.unmodifiableList(products_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse.class, + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse.Builder.class); + } + + public static final int PRODUCTS_FIELD_NUMBER = 1; + private java.util.List products_; + /** + * + * + *
+   * The `Product` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + @java.lang.Override + public java.util.List getProductsList() { + return products_; + } + /** + * + * + *
+   * The `Product` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + @java.lang.Override + public java.util.List + getProductsOrBuilderList() { + return products_; + } + /** + * + * + *
+   * The `Product` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + @java.lang.Override + public int getProductsCount() { + return products_.size(); + } + /** + * + * + *
+   * The `Product` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Product getProducts(int index) { + return products_.get(index); + } + /** + * + * + *
+   * The `Product` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.ProductOrBuilder getProductsOrBuilder(int index) { + return products_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A pagination token returned from a previous call to SearchProducts that
+   * indicates from where listing should continue.
+   * 
+ * + * 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 pagination token returned from a previous call to SearchProducts that
+   * indicates from where listing should continue.
+   * 
+ * + * 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 < products_.size(); i++) { + output.writeMessage(1, products_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < products_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, products_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse)) { + return super.equals(obj); + } + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse other = + (com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse) obj; + + if (!getProductsList().equals(other.getProductsList())) 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 (getProductsCount() > 0) { + hash = (37 * hash) + PRODUCTS_FIELD_NUMBER; + hash = (53 * hash) + getProductsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 [PrivateCatalog.SearchProducts][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchProducts].
+   * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.SearchProductsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.privatecatalog.v1beta1.SearchProductsResponse) + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse.class, + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse.Builder.class); + } + + // Construct using com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProductsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + productsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchProductsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse + getDefaultInstanceForType() { + return com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse build() { + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse buildPartial() { + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse result = + new com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse(this); + int from_bitField0_ = bitField0_; + if (productsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + products_ = java.util.Collections.unmodifiableList(products_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.products_ = products_; + } else { + result.products_ = productsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse) { + return mergeFrom((com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse other) { + if (other + == com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse.getDefaultInstance()) + return this; + if (productsBuilder_ == null) { + if (!other.products_.isEmpty()) { + if (products_.isEmpty()) { + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProductsIsMutable(); + products_.addAll(other.products_); + } + onChanged(); + } + } else { + if (!other.products_.isEmpty()) { + if (productsBuilder_.isEmpty()) { + productsBuilder_.dispose(); + productsBuilder_ = null; + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + productsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProductsFieldBuilder() + : null; + } else { + productsBuilder_.addAllMessages(other.products_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List products_ = + java.util.Collections.emptyList(); + + private void ensureProductsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + products_ = + new java.util.ArrayList(products_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.Product, + com.google.cloud.privatecatalog.v1beta1.Product.Builder, + com.google.cloud.privatecatalog.v1beta1.ProductOrBuilder> + productsBuilder_; + + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public java.util.List getProductsList() { + if (productsBuilder_ == null) { + return java.util.Collections.unmodifiableList(products_); + } else { + return productsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.Product getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public Builder setProducts(int index, com.google.cloud.privatecatalog.v1beta1.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.set(index, value); + onChanged(); + } else { + productsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.privatecatalog.v1beta1.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.set(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public Builder addProducts(com.google.cloud.privatecatalog.v1beta1.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(value); + onChanged(); + } else { + productsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public Builder addProducts(int index, com.google.cloud.privatecatalog.v1beta1.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(index, value); + onChanged(); + } else { + productsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public Builder addProducts( + com.google.cloud.privatecatalog.v1beta1.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.privatecatalog.v1beta1.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public Builder addAllProducts( + java.lang.Iterable values) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, products_); + onChanged(); + } else { + productsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public Builder clearProducts() { + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + productsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public Builder removeProducts(int index) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.remove(index); + onChanged(); + } else { + productsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.Product.Builder getProductsBuilder(int index) { + return getProductsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.ProductOrBuilder getProductsOrBuilder( + int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public java.util.List + getProductsOrBuilderList() { + if (productsBuilder_ != null) { + return productsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(products_); + } + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.Product.Builder addProductsBuilder() { + return getProductsFieldBuilder() + .addBuilder(com.google.cloud.privatecatalog.v1beta1.Product.getDefaultInstance()); + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.Product.Builder addProductsBuilder(int index) { + return getProductsFieldBuilder() + .addBuilder(index, com.google.cloud.privatecatalog.v1beta1.Product.getDefaultInstance()); + } + /** + * + * + *
+     * The `Product` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + public java.util.List + getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.Product, + com.google.cloud.privatecatalog.v1beta1.Product.Builder, + com.google.cloud.privatecatalog.v1beta1.ProductOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.Product, + com.google.cloud.privatecatalog.v1beta1.Product.Builder, + com.google.cloud.privatecatalog.v1beta1.ProductOrBuilder>( + products_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + products_ = null; + } + return productsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A pagination token returned from a previous call to SearchProducts that
+     * indicates from where listing should continue.
+     * 
+ * + * 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 pagination token returned from a previous call to SearchProducts that
+     * indicates from where listing should continue.
+     * 
+ * + * 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 pagination token returned from a previous call to SearchProducts that
+     * indicates from where listing should continue.
+     * 
+ * + * 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 pagination token returned from a previous call to SearchProducts that
+     * indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchProducts that
+     * indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.privatecatalog.v1beta1.SearchProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.privatecatalog.v1beta1.SearchProductsResponse) + private static final com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse(); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchProductsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchProductsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchProductsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsResponseOrBuilder.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsResponseOrBuilder.java new file mode 100644 index 00000000..f8c96cc0 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchProductsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public interface SearchProductsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.privatecatalog.v1beta1.SearchProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The `Product` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + java.util.List getProductsList(); + /** + * + * + *
+   * The `Product` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + com.google.cloud.privatecatalog.v1beta1.Product getProducts(int index); + /** + * + * + *
+   * The `Product` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + int getProductsCount(); + /** + * + * + *
+   * The `Product` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + java.util.List + getProductsOrBuilderList(); + /** + * + * + *
+   * The `Product` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + com.google.cloud.privatecatalog.v1beta1.ProductOrBuilder getProductsOrBuilder(int index); + + /** + * + * + *
+   * A pagination token returned from a previous call to SearchProducts that
+   * indicates from where listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A pagination token returned from a previous call to SearchProducts that
+   * indicates from where listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsRequest.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsRequest.java new file mode 100644 index 00000000..83fcce12 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsRequest.java @@ -0,0 +1,1138 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +/** + * + * + *
+ * Request message for [PrivateCatalog.SearchVersions][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchVersions].
+ * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.SearchVersionsRequest} + */ +public final class SearchVersionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.privatecatalog.v1beta1.SearchVersionsRequest) + SearchVersionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchVersionsRequest.newBuilder() to construct. + private SearchVersionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchVersionsRequest() { + resource_ = ""; + query_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchVersionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchVersionsRequest( + 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(); + + resource_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest.class, + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest.Builder.class); + } + + public static final int RESOURCE_FIELD_NUMBER = 1; + private volatile java.lang.Object resource_; + /** + * + * + *
+   * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+   * for details.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + @java.lang.Override + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+   * for details.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 2; + private volatile java.lang.Object query_; + /** + * + * + *
+   * Required. The query to filter the versions.
+   * The supported queries are:
+   * * List versions under a product:
+   * `parent=catalogs/{catalog}/products/{product}`
+   * * Get a version by name:
+   * `name=catalogs/{catalog}/products/{product}/versions/{version}`
+   * 
+ * + * string query = 2 [(.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; + } + } + /** + * + * + *
+   * Required. The query to filter the versions.
+   * The supported queries are:
+   * * List versions under a product:
+   * `parent=catalogs/{catalog}/products/{product}`
+   * * Get a version by name:
+   * `name=catalogs/{catalog}/products/{product}/versions/{version}`
+   * 
+ * + * string query = 2 [(.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 PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of entries that are requested.
+   * 
+ * + * 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_; + /** + * + * + *
+   * A pagination token returned from a previous call to SearchVersions
+   * that indicates where this listing should continue from.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * A pagination token returned from a previous call to SearchVersions
+   * that indicates where this listing should continue from.
+   * 
+ * + * 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 (!getResourceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resource_); + } + if (!getQueryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getResourceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resource_); + } + if (!getQueryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest)) { + return super.equals(obj); + } + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest other = + (com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest) obj; + + if (!getResource().equals(other.getResource())) return false; + if (!getQuery().equals(other.getQuery())) 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) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 [PrivateCatalog.SearchVersions][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchVersions].
+   * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.SearchVersionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.privatecatalog.v1beta1.SearchVersionsRequest) + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest.class, + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest.Builder.class); + } + + // Construct using com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest.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(); + resource_ = ""; + + query_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest + getDefaultInstanceForType() { + return com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest build() { + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest buildPartial() { + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest result = + new com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest(this); + result.resource_ = resource_; + result.query_ = query_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest) { + return mergeFrom((com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest other) { + if (other + == com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest.getDefaultInstance()) + return this; + if (!other.getResource().isEmpty()) { + resource_ = other.resource_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object resource_ = ""; + /** + * + * + *
+     * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+     * for details.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+     * for details.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+     * for details.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The resource to set. + * @return This builder for chaining. + */ + public Builder setResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+     * for details.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearResource() { + + resource_ = getDefaultInstance().getResource(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+     * for details.
+     * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for resource to set. + * @return This builder for chaining. + */ + public Builder setResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resource_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * Required. The query to filter the versions.
+     * The supported queries are:
+     * * List versions under a product:
+     * `parent=catalogs/{catalog}/products/{product}`
+     * * Get a version by name:
+     * `name=catalogs/{catalog}/products/{product}/versions/{version}`
+     * 
+ * + * string query = 2 [(.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; + } + } + /** + * + * + *
+     * Required. The query to filter the versions.
+     * The supported queries are:
+     * * List versions under a product:
+     * `parent=catalogs/{catalog}/products/{product}`
+     * * Get a version by name:
+     * `name=catalogs/{catalog}/products/{product}/versions/{version}`
+     * 
+ * + * string query = 2 [(.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; + } + } + /** + * + * + *
+     * Required. The query to filter the versions.
+     * The supported queries are:
+     * * List versions under a product:
+     * `parent=catalogs/{catalog}/products/{product}`
+     * * Get a version by name:
+     * `name=catalogs/{catalog}/products/{product}/versions/{version}`
+     * 
+ * + * string query = 2 [(.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; + } + /** + * + * + *
+     * Required. The query to filter the versions.
+     * The supported queries are:
+     * * List versions under a product:
+     * `parent=catalogs/{catalog}/products/{product}`
+     * * Get a version by name:
+     * `name=catalogs/{catalog}/products/{product}/versions/{version}`
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The query to filter the versions.
+     * The supported queries are:
+     * * List versions under a product:
+     * `parent=catalogs/{catalog}/products/{product}`
+     * * Get a version by name:
+     * `name=catalogs/{catalog}/products/{product}/versions/{version}`
+     * 
+ * + * string query = 2 [(.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 int pageSize_; + /** + * + * + *
+     * The maximum number of entries that are requested.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of entries that are requested.
+     * 
+ * + * 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 entries that are requested.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A pagination token returned from a previous call to SearchVersions
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchVersions
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchVersions
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchVersions
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchVersions
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.privatecatalog.v1beta1.SearchVersionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.privatecatalog.v1beta1.SearchVersionsRequest) + private static final com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest(); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchVersionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchVersionsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsRequestOrBuilder.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsRequestOrBuilder.java new file mode 100644 index 00000000..940468ed --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsRequestOrBuilder.java @@ -0,0 +1,127 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public interface SearchVersionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.privatecatalog.v1beta1.SearchVersionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+   * for details.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resource. + */ + java.lang.String getResource(); + /** + * + * + *
+   * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
+   * for details.
+   * 
+ * + * string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resource. + */ + com.google.protobuf.ByteString getResourceBytes(); + + /** + * + * + *
+   * Required. The query to filter the versions.
+   * The supported queries are:
+   * * List versions under a product:
+   * `parent=catalogs/{catalog}/products/{product}`
+   * * Get a version by name:
+   * `name=catalogs/{catalog}/products/{product}/versions/{version}`
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * Required. The query to filter the versions.
+   * The supported queries are:
+   * * List versions under a product:
+   * `parent=catalogs/{catalog}/products/{product}`
+   * * Get a version by name:
+   * `name=catalogs/{catalog}/products/{product}/versions/{version}`
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * The maximum number of entries that are requested.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A pagination token returned from a previous call to SearchVersions
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A pagination token returned from a previous call to SearchVersions
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsResponse.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsResponse.java new file mode 100644 index 00000000..63809648 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsResponse.java @@ -0,0 +1,1146 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +/** + * + * + *
+ * Response message for [PrivateCatalog.SearchVersions][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchVersions].
+ * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.SearchVersionsResponse} + */ +public final class SearchVersionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.privatecatalog.v1beta1.SearchVersionsResponse) + SearchVersionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchVersionsResponse.newBuilder() to construct. + private SearchVersionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchVersionsResponse() { + versions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchVersionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchVersionsResponse( + 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)) { + versions_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + versions_.add( + input.readMessage( + com.google.cloud.privatecatalog.v1beta1.Version.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + versions_ = java.util.Collections.unmodifiableList(versions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse.class, + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse.Builder.class); + } + + public static final int VERSIONS_FIELD_NUMBER = 1; + private java.util.List versions_; + /** + * + * + *
+   * The `Version` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + @java.lang.Override + public java.util.List getVersionsList() { + return versions_; + } + /** + * + * + *
+   * The `Version` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + @java.lang.Override + public java.util.List + getVersionsOrBuilderList() { + return versions_; + } + /** + * + * + *
+   * The `Version` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + @java.lang.Override + public int getVersionsCount() { + return versions_.size(); + } + /** + * + * + *
+   * The `Version` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Version getVersions(int index) { + return versions_.get(index); + } + /** + * + * + *
+   * The `Version` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.VersionOrBuilder getVersionsOrBuilder(int index) { + return versions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A pagination token returned from a previous call to SearchVersions that
+   * indicates from where the listing should continue.
+   * 
+ * + * 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 pagination token returned from a previous call to SearchVersions that
+   * indicates from where the listing should continue.
+   * 
+ * + * 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 < versions_.size(); i++) { + output.writeMessage(1, versions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < versions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, versions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse)) { + return super.equals(obj); + } + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse other = + (com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse) obj; + + if (!getVersionsList().equals(other.getVersionsList())) 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 (getVersionsCount() > 0) { + hash = (37 * hash) + VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getVersionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 [PrivateCatalog.SearchVersions][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchVersions].
+   * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.SearchVersionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.privatecatalog.v1beta1.SearchVersionsResponse) + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse.class, + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse.Builder.class); + } + + // Construct using com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getVersionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (versionsBuilder_ == null) { + versions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + versionsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_SearchVersionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse + getDefaultInstanceForType() { + return com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse build() { + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse buildPartial() { + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse result = + new com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse(this); + int from_bitField0_ = bitField0_; + if (versionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + versions_ = java.util.Collections.unmodifiableList(versions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.versions_ = versions_; + } else { + result.versions_ = versionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse) { + return mergeFrom((com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse other) { + if (other + == com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse.getDefaultInstance()) + return this; + if (versionsBuilder_ == null) { + if (!other.versions_.isEmpty()) { + if (versions_.isEmpty()) { + versions_ = other.versions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVersionsIsMutable(); + versions_.addAll(other.versions_); + } + onChanged(); + } + } else { + if (!other.versions_.isEmpty()) { + if (versionsBuilder_.isEmpty()) { + versionsBuilder_.dispose(); + versionsBuilder_ = null; + versions_ = other.versions_; + bitField0_ = (bitField0_ & ~0x00000001); + versionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVersionsFieldBuilder() + : null; + } else { + versionsBuilder_.addAllMessages(other.versions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List versions_ = + java.util.Collections.emptyList(); + + private void ensureVersionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + versions_ = + new java.util.ArrayList(versions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.Version, + com.google.cloud.privatecatalog.v1beta1.Version.Builder, + com.google.cloud.privatecatalog.v1beta1.VersionOrBuilder> + versionsBuilder_; + + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public java.util.List getVersionsList() { + if (versionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(versions_); + } else { + return versionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public int getVersionsCount() { + if (versionsBuilder_ == null) { + return versions_.size(); + } else { + return versionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.Version getVersions(int index) { + if (versionsBuilder_ == null) { + return versions_.get(index); + } else { + return versionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public Builder setVersions(int index, com.google.cloud.privatecatalog.v1beta1.Version value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.set(index, value); + onChanged(); + } else { + versionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public Builder setVersions( + int index, com.google.cloud.privatecatalog.v1beta1.Version.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.set(index, builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public Builder addVersions(com.google.cloud.privatecatalog.v1beta1.Version value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.add(value); + onChanged(); + } else { + versionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public Builder addVersions(int index, com.google.cloud.privatecatalog.v1beta1.Version value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.add(index, value); + onChanged(); + } else { + versionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public Builder addVersions( + com.google.cloud.privatecatalog.v1beta1.Version.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.add(builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public Builder addVersions( + int index, com.google.cloud.privatecatalog.v1beta1.Version.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.add(index, builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public Builder addAllVersions( + java.lang.Iterable values) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, versions_); + onChanged(); + } else { + versionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public Builder clearVersions() { + if (versionsBuilder_ == null) { + versions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + versionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public Builder removeVersions(int index) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.remove(index); + onChanged(); + } else { + versionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.Version.Builder getVersionsBuilder(int index) { + return getVersionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.VersionOrBuilder getVersionsOrBuilder( + int index) { + if (versionsBuilder_ == null) { + return versions_.get(index); + } else { + return versionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public java.util.List + getVersionsOrBuilderList() { + if (versionsBuilder_ != null) { + return versionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(versions_); + } + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.Version.Builder addVersionsBuilder() { + return getVersionsFieldBuilder() + .addBuilder(com.google.cloud.privatecatalog.v1beta1.Version.getDefaultInstance()); + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public com.google.cloud.privatecatalog.v1beta1.Version.Builder addVersionsBuilder(int index) { + return getVersionsFieldBuilder() + .addBuilder(index, com.google.cloud.privatecatalog.v1beta1.Version.getDefaultInstance()); + } + /** + * + * + *
+     * The `Version` resources computed from the resource context.
+     * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + public java.util.List + getVersionsBuilderList() { + return getVersionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.Version, + com.google.cloud.privatecatalog.v1beta1.Version.Builder, + com.google.cloud.privatecatalog.v1beta1.VersionOrBuilder> + getVersionsFieldBuilder() { + if (versionsBuilder_ == null) { + versionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.privatecatalog.v1beta1.Version, + com.google.cloud.privatecatalog.v1beta1.Version.Builder, + com.google.cloud.privatecatalog.v1beta1.VersionOrBuilder>( + versions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + versions_ = null; + } + return versionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A pagination token returned from a previous call to SearchVersions that
+     * indicates from where the listing should continue.
+     * 
+ * + * 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 pagination token returned from a previous call to SearchVersions that
+     * indicates from where the listing should continue.
+     * 
+ * + * 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 pagination token returned from a previous call to SearchVersions that
+     * indicates from where the listing should continue.
+     * 
+ * + * 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 pagination token returned from a previous call to SearchVersions that
+     * indicates from where the listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to SearchVersions that
+     * indicates from where the listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.privatecatalog.v1beta1.SearchVersionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.privatecatalog.v1beta1.SearchVersionsResponse) + private static final com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse(); + } + + public static com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchVersionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchVersionsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsResponseOrBuilder.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsResponseOrBuilder.java new file mode 100644 index 00000000..f20c6dfc --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/SearchVersionsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public interface SearchVersionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.privatecatalog.v1beta1.SearchVersionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The `Version` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + java.util.List getVersionsList(); + /** + * + * + *
+   * The `Version` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + com.google.cloud.privatecatalog.v1beta1.Version getVersions(int index); + /** + * + * + *
+   * The `Version` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + int getVersionsCount(); + /** + * + * + *
+   * The `Version` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + java.util.List + getVersionsOrBuilderList(); + /** + * + * + *
+   * The `Version` resources computed from the resource context.
+   * 
+ * + * repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + com.google.cloud.privatecatalog.v1beta1.VersionOrBuilder getVersionsOrBuilder(int index); + + /** + * + * + *
+   * A pagination token returned from a previous call to SearchVersions that
+   * indicates from where the listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A pagination token returned from a previous call to SearchVersions that
+   * indicates from where the listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Version.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Version.java new file mode 100644 index 00000000..9918b7e1 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/Version.java @@ -0,0 +1,1712 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +/** + * + * + *
+ * The consumer representation of a version which is a child resource under a
+ * `Product` with asset data.
+ * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.Version} + */ +public final class Version extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.privatecatalog.v1beta1.Version) + VersionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Version.newBuilder() to construct. + private Version(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Version() { + name_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Version(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Version( + 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(); + + description_ = s; + break; + } + case 26: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (asset_ != null) { + subBuilder = asset_.toBuilder(); + } + asset_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(asset_); + asset_ = subBuilder.buildPartial(); + } + + 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; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Version_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Version_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.Version.class, + com.google.cloud.privatecatalog.v1beta1.Version.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the version, in the format
+   * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'.
+   * A unique identifier for the version under a product.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the version, in the format
+   * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'.
+   * A unique identifier for the version under a product.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Output only. The user-supplied description of the version. Maximum of 256
+   * characters.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The user-supplied description of the version. Maximum of 256
+   * characters.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 ASSET_FIELD_NUMBER = 3; + private com.google.protobuf.Struct asset_; + /** + * + * + *
+   * Output only. The asset which has been validated and is ready to be
+   * provisioned. See
+   * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+   * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the asset field is set. + */ + @java.lang.Override + public boolean hasAsset() { + return asset_ != null; + } + /** + * + * + *
+   * Output only. The asset which has been validated and is ready to be
+   * provisioned. See
+   * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+   * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The asset. + */ + @java.lang.Override + public com.google.protobuf.Struct getAsset() { + return asset_ == null ? com.google.protobuf.Struct.getDefaultInstance() : asset_; + } + /** + * + * + *
+   * Output only. The asset which has been validated and is ready to be
+   * provisioned. See
+   * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+   * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getAssetOrBuilder() { + return getAsset(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the version 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; + } + /** + * + * + *
+   * Output only. The time when the version 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_; + } + /** + * + * + *
+   * Output only. The time when the version 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_; + /** + * + * + *
+   * Output only. The time when the version was last 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; + } + /** + * + * + *
+   * Output only. The time when the version was last 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_; + } + /** + * + * + *
+   * Output only. The time when the version was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (asset_ != null) { + output.writeMessage(3, getAsset()); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (asset_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAsset()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, 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.cloud.privatecatalog.v1beta1.Version)) { + return super.equals(obj); + } + com.google.cloud.privatecatalog.v1beta1.Version other = + (com.google.cloud.privatecatalog.v1beta1.Version) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasAsset() != other.hasAsset()) return false; + if (hasAsset()) { + if (!getAsset().equals(other.getAsset())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasAsset()) { + hash = (37 * hash) + ASSET_FIELD_NUMBER; + hash = (53 * hash) + getAsset().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.cloud.privatecatalog.v1beta1.Version parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.Version parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Version parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.Version parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Version parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.privatecatalog.v1beta1.Version parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Version parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.Version parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Version parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.Version parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.privatecatalog.v1beta1.Version parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.privatecatalog.v1beta1.Version parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.privatecatalog.v1beta1.Version prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 consumer representation of a version which is a child resource under a
+   * `Product` with asset data.
+   * 
+ * + * Protobuf type {@code google.cloud.privatecatalog.v1beta1.Version} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.privatecatalog.v1beta1.Version) + com.google.cloud.privatecatalog.v1beta1.VersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Version_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Version_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.privatecatalog.v1beta1.Version.class, + com.google.cloud.privatecatalog.v1beta1.Version.Builder.class); + } + + // Construct using com.google.cloud.privatecatalog.v1beta1.Version.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_ = ""; + + description_ = ""; + + if (assetBuilder_ == null) { + asset_ = null; + } else { + asset_ = null; + assetBuilder_ = null; + } + 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.cloud.privatecatalog.v1beta1.PrivateCatalogProto + .internal_static_google_cloud_privatecatalog_v1beta1_Version_descriptor; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Version getDefaultInstanceForType() { + return com.google.cloud.privatecatalog.v1beta1.Version.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Version build() { + com.google.cloud.privatecatalog.v1beta1.Version result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Version buildPartial() { + com.google.cloud.privatecatalog.v1beta1.Version result = + new com.google.cloud.privatecatalog.v1beta1.Version(this); + result.name_ = name_; + result.description_ = description_; + if (assetBuilder_ == null) { + result.asset_ = asset_; + } else { + result.asset_ = assetBuilder_.build(); + } + 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.cloud.privatecatalog.v1beta1.Version) { + return mergeFrom((com.google.cloud.privatecatalog.v1beta1.Version) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.privatecatalog.v1beta1.Version other) { + if (other == com.google.cloud.privatecatalog.v1beta1.Version.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasAsset()) { + mergeAsset(other.getAsset()); + } + 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.cloud.privatecatalog.v1beta1.Version parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.privatecatalog.v1beta1.Version) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the version, in the format
+     * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'.
+     * A unique identifier for the version under a product.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the version, in the format
+     * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'.
+     * A unique identifier for the version under a product.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the version, in the format
+     * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'.
+     * A unique identifier for the version under a product.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Output only. The resource name of the version, in the format
+     * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'.
+     * A unique identifier for the version under a product.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the version, in the format
+     * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'.
+     * A unique identifier for the version under a product.
+     * 
+ * + * 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 description_ = ""; + /** + * + * + *
+     * Output only. The user-supplied description of the version. Maximum of 256
+     * characters.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The user-supplied description of the version. Maximum of 256
+     * characters.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The user-supplied description of the version. Maximum of 256
+     * characters.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. The user-supplied description of the version. Maximum of 256
+     * characters.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The user-supplied description of the version. Maximum of 256
+     * characters.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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.Struct asset_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + assetBuilder_; + /** + * + * + *
+     * Output only. The asset which has been validated and is ready to be
+     * provisioned. See
+     * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+     * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the asset field is set. + */ + public boolean hasAsset() { + return assetBuilder_ != null || asset_ != null; + } + /** + * + * + *
+     * Output only. The asset which has been validated and is ready to be
+     * provisioned. See
+     * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+     * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The asset. + */ + public com.google.protobuf.Struct getAsset() { + if (assetBuilder_ == null) { + return asset_ == null ? com.google.protobuf.Struct.getDefaultInstance() : asset_; + } else { + return assetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The asset which has been validated and is ready to be
+     * provisioned. See
+     * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+     * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder setAsset(com.google.protobuf.Struct value) { + if (assetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + asset_ = value; + onChanged(); + } else { + assetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The asset which has been validated and is ready to be
+     * provisioned. See
+     * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+     * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder setAsset(com.google.protobuf.Struct.Builder builderForValue) { + if (assetBuilder_ == null) { + asset_ = builderForValue.build(); + onChanged(); + } else { + assetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The asset which has been validated and is ready to be
+     * provisioned. See
+     * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+     * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder mergeAsset(com.google.protobuf.Struct value) { + if (assetBuilder_ == null) { + if (asset_ != null) { + asset_ = com.google.protobuf.Struct.newBuilder(asset_).mergeFrom(value).buildPartial(); + } else { + asset_ = value; + } + onChanged(); + } else { + assetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The asset which has been validated and is ready to be
+     * provisioned. See
+     * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+     * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder clearAsset() { + if (assetBuilder_ == null) { + asset_ = null; + onChanged(); + } else { + asset_ = null; + assetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The asset which has been validated and is ready to be
+     * provisioned. See
+     * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+     * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.protobuf.Struct.Builder getAssetBuilder() { + + onChanged(); + return getAssetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The asset which has been validated and is ready to be
+     * provisioned. See
+     * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+     * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.protobuf.StructOrBuilder getAssetOrBuilder() { + if (assetBuilder_ != null) { + return assetBuilder_.getMessageOrBuilder(); + } else { + return asset_ == null ? com.google.protobuf.Struct.getDefaultInstance() : asset_; + } + } + /** + * + * + *
+     * Output only. The asset which has been validated and is ready to be
+     * provisioned. See
+     * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+     * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getAssetFieldBuilder() { + if (assetBuilder_ == null) { + assetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>(getAsset(), getParentForChildren(), isClean()); + asset_ = null; + } + return assetBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the version 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; + } + /** + * + * + *
+     * Output only. The time when the version 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(); + } + } + /** + * + * + *
+     * Output only. The time when the version 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; + } + /** + * + * + *
+     * Output only. The time when the version 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; + } + /** + * + * + *
+     * Output only. The time when the version 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; + } + /** + * + * + *
+     * Output only. The time when the version 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; + } + /** + * + * + *
+     * Output only. The time when the version 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(); + } + /** + * + * + *
+     * Output only. The time when the version 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_; + } + } + /** + * + * + *
+     * Output only. The time when the version 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_; + /** + * + * + *
+     * Output only. The time when the version was last 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; + } + /** + * + * + *
+     * Output only. The time when the version was last 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(); + } + } + /** + * + * + *
+     * Output only. The time when the version was last 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; + } + /** + * + * + *
+     * Output only. The time when the version was last 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; + } + /** + * + * + *
+     * Output only. The time when the version was last 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; + } + /** + * + * + *
+     * Output only. The time when the version was last 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; + } + /** + * + * + *
+     * Output only. The time when the version was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the version was last 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_; + } + } + /** + * + * + *
+     * Output only. The time when the version was last 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_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(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.privatecatalog.v1beta1.Version) + } + + // @@protoc_insertion_point(class_scope:google.cloud.privatecatalog.v1beta1.Version) + private static final com.google.cloud.privatecatalog.v1beta1.Version DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.privatecatalog.v1beta1.Version(); + } + + public static com.google.cloud.privatecatalog.v1beta1.Version getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Version parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Version(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.privatecatalog.v1beta1.Version getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/VersionName.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/VersionName.java new file mode 100644 index 00000000..862c96fe --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/VersionName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.privatecatalog.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 VersionName implements ResourceName { + private static final PathTemplate CATALOG_PRODUCT_VERSION = + PathTemplate.createWithoutUrlEncoding( + "catalogs/{catalog}/products/{product}/versions/{version}"); + private volatile Map fieldValuesMap; + private final String catalog; + private final String product; + private final String version; + + @Deprecated + protected VersionName() { + catalog = null; + product = null; + version = null; + } + + private VersionName(Builder builder) { + catalog = Preconditions.checkNotNull(builder.getCatalog()); + product = Preconditions.checkNotNull(builder.getProduct()); + version = Preconditions.checkNotNull(builder.getVersion()); + } + + public String getCatalog() { + return catalog; + } + + public String getProduct() { + return product; + } + + public String getVersion() { + return version; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static VersionName of(String catalog, String product, String version) { + return newBuilder().setCatalog(catalog).setProduct(product).setVersion(version).build(); + } + + public static String format(String catalog, String product, String version) { + return newBuilder() + .setCatalog(catalog) + .setProduct(product) + .setVersion(version) + .build() + .toString(); + } + + public static VersionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + CATALOG_PRODUCT_VERSION.validatedMatch( + formattedString, "VersionName.parse: formattedString not in valid format"); + return of(matchMap.get("catalog"), matchMap.get("product"), matchMap.get("version")); + } + + 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 (VersionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return CATALOG_PRODUCT_VERSION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (catalog != null) { + fieldMapBuilder.put("catalog", catalog); + } + if (product != null) { + fieldMapBuilder.put("product", product); + } + if (version != null) { + fieldMapBuilder.put("version", version); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return CATALOG_PRODUCT_VERSION.instantiate( + "catalog", catalog, "product", product, "version", version); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + VersionName that = ((VersionName) o); + return Objects.equals(this.catalog, that.catalog) + && Objects.equals(this.product, that.product) + && Objects.equals(this.version, that.version); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(catalog); + h *= 1000003; + h ^= Objects.hashCode(product); + h *= 1000003; + h ^= Objects.hashCode(version); + return h; + } + + /** Builder for catalogs/{catalog}/products/{product}/versions/{version}. */ + public static class Builder { + private String catalog; + private String product; + private String version; + + protected Builder() {} + + public String getCatalog() { + return catalog; + } + + public String getProduct() { + return product; + } + + public String getVersion() { + return version; + } + + public Builder setCatalog(String catalog) { + this.catalog = catalog; + return this; + } + + public Builder setProduct(String product) { + this.product = product; + return this; + } + + public Builder setVersion(String version) { + this.version = version; + return this; + } + + private Builder(VersionName versionName) { + catalog = versionName.catalog; + product = versionName.product; + version = versionName.version; + } + + public VersionName build() { + return new VersionName(this); + } + } +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/VersionOrBuilder.java b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/VersionOrBuilder.java new file mode 100644 index 00000000..e7825cd0 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/java/com/google/cloud/privatecatalog/v1beta1/VersionOrBuilder.java @@ -0,0 +1,198 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/privatecatalog/v1beta1/private_catalog.proto + +package com.google.cloud.privatecatalog.v1beta1; + +public interface VersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.privatecatalog.v1beta1.Version) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the version, in the format
+   * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'.
+   * A unique identifier for the version under a product.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the version, in the format
+   * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'.
+   * A unique identifier for the version under a product.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The user-supplied description of the version. Maximum of 256
+   * characters.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. The user-supplied description of the version. Maximum of 256
+   * characters.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The asset which has been validated and is ready to be
+   * provisioned. See
+   * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+   * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the asset field is set. + */ + boolean hasAsset(); + /** + * + * + *
+   * Output only. The asset which has been validated and is ready to be
+   * provisioned. See
+   * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+   * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The asset. + */ + com.google.protobuf.Struct getAsset(); + /** + * + * + *
+   * Output only. The asset which has been validated and is ready to be
+   * provisioned. See
+   * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
+   * 
+ * + * .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.protobuf.StructOrBuilder getAssetOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time when the version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time when the version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the version was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time when the version was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time when the version was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/proto-google-cloud-private-catalog-v1beta1/src/main/proto/google/cloud/privatecatalog/v1beta1/private_catalog.proto b/proto-google-cloud-private-catalog-v1beta1/src/main/proto/google/cloud/privatecatalog/v1beta1/private_catalog.proto new file mode 100644 index 00000000..90975e79 --- /dev/null +++ b/proto-google-cloud-private-catalog-v1beta1/src/main/proto/google/cloud/privatecatalog/v1beta1/private_catalog.proto @@ -0,0 +1,559 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.privatecatalog.v1beta1; + +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/any.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.PrivateCatalog.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/privatecatalog/v1beta1;privatecatalog"; +option java_multiple_files = true; +option java_outer_classname = "PrivateCatalogProto"; +option java_package = "com.google.cloud.privatecatalog.v1beta1"; +option php_namespace = "Google\\Cloud\\PrivateCatalog\\V1beta1"; +option ruby_package = "Google::Cloud::PrivateCatalog::V1beta1"; + +// `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` +// and `Version` resources under a target resource context. +// +// `Catalog` is computed based on the [Association][]s linked to the target +// resource and its ancestors. Each association's +// [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a +// `Catalog`. If multiple associations have the same parent +// [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are +// de-duplicated into one `Catalog`. Users must have +// `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource +// context in order to access catalogs. `Catalog` contains the resource name and +// a subset of data of the original +// [google.cloud.privatecatalogproducer.v1beta.Catalog][]. +// +// `Product` is child resource of the catalog. A `Product` contains the resource +// name and a subset of the data of the original +// [google.cloud.privatecatalogproducer.v1beta.Product][]. +// +// `Version` is child resource of the product. A `Version` contains the resource +// name and a subset of the data of the original +// [google.cloud.privatecatalogproducer.v1beta.Version][]. +service PrivateCatalog { + option (google.api.default_host) = "cloudprivatecatalog.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the + // scope of the consumer cloud resource hierarchy context. + rpc SearchCatalogs(SearchCatalogsRequest) returns (SearchCatalogsResponse) { + option (google.api.http) = { + get: "/v1beta1/{resource=projects/*}/catalogs:search" + additional_bindings { + get: "/v1beta1/{resource=organizations/*}/catalogs:search" + } + additional_bindings { + get: "/v1beta1/{resource=folders/*}/catalogs:search" + } + }; + } + + // Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the + // scope of the consumer cloud resource hierarchy context. + rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) { + option (google.api.http) = { + get: "/v1beta1/{resource=projects/*}/products:search" + additional_bindings { + get: "/v1beta1/{resource=organizations/*}/products:search" + } + additional_bindings { + get: "/v1beta1/{resource=folders/*}/products:search" + } + }; + } + + // Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the + // scope of the consumer cloud resource hierarchy context. + rpc SearchVersions(SearchVersionsRequest) returns (SearchVersionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{resource=projects/*}/versions:search" + additional_bindings { + get: "/v1beta1/{resource=organizations/*}/versions:search" + } + additional_bindings { + get: "/v1beta1/{resource=folders/*}/versions:search" + } + }; + } +} + +// Request message for [PrivateCatalog.SearchCatalogs][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchCatalogs]. +message SearchCatalogsRequest { + // Required. The name of the resource context. It can be in following formats: + // + // * `projects/{project}` + // * `folders/{folder}` + // * `organizations/{organization}` + string resource = 1 [(google.api.field_behavior) = REQUIRED]; + + // The query to filter the catalogs. The supported queries are: + // + // * Get a single catalog: `name=catalogs/{catalog}` + string query = 2; + + // The maximum number of entries that are requested. + int32 page_size = 3; + + // A pagination token returned from a previous call to SearchCatalogs that + // indicates where this listing should continue from. + string page_token = 4; +} + +// Response message for [PrivateCatalog.SearchCatalogs][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchCatalogs]. +message SearchCatalogsResponse { + // The `Catalog`s computed from the resource context. + repeated Catalog catalogs = 1; + + // A pagination token returned from a previous call to SearchCatalogs that + // indicates from where listing should continue. + string next_page_token = 2; +} + +// Request message for [PrivateCatalog.SearchProducts][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchProducts]. +message SearchProductsRequest { + // Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + // for details. + string resource = 1 [(google.api.field_behavior) = REQUIRED]; + + // The query to filter the products. + // + // The supported queries are: + // * List products of all catalogs: empty + // * List products under a catalog: `parent=catalogs/{catalog}` + // * Get a product by name: + // `name=catalogs/{catalog}/products/{product}` + string query = 2; + + // The maximum number of entries that are requested. + int32 page_size = 3; + + // A pagination token returned from a previous call to SearchProducts that + // indicates where this listing should continue from. + string page_token = 4; +} + +// Response message for [PrivateCatalog.SearchProducts][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchProducts]. +message SearchProductsResponse { + // The `Product` resources computed from the resource context. + repeated Product products = 1; + + // A pagination token returned from a previous call to SearchProducts that + // indicates from where listing should continue. + string next_page_token = 2; +} + +// Request message for [PrivateCatalog.SearchVersions][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchVersions]. +message SearchVersionsRequest { + // Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + // for details. + string resource = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The query to filter the versions. + // + // The supported queries are: + // * List versions under a product: + // `parent=catalogs/{catalog}/products/{product}` + // * Get a version by name: + // `name=catalogs/{catalog}/products/{product}/versions/{version}` + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of entries that are requested. + int32 page_size = 3; + + // A pagination token returned from a previous call to SearchVersions + // that indicates where this listing should continue from. + string page_token = 4; +} + +// Response message for [PrivateCatalog.SearchVersions][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchVersions]. +message SearchVersionsResponse { + // The `Version` resources computed from the resource context. + repeated Version versions = 1; + + // A pagination token returned from a previous call to SearchVersions that + // indicates from where the listing should continue. + string next_page_token = 2; +} + +// The readonly representation of a catalog computed with a given resource +// context. +message Catalog { + option (google.api.resource) = { + type: "cloudprivatecatalog.googleapis.com/Catalog" + pattern: "catalogs/{catalog}" + }; + + // Output only. The resource name of the target catalog, in the format of + // `catalogs/{catalog}'. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The descriptive name of the catalog as it appears in UIs. + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The description of the catalog. + string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the catalog was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the catalog was last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The readonly representation of a product computed with a given resource +// context. +message Product { + option (google.api.resource) = { + type: "cloudprivatecatalog.googleapis.com/Product" + pattern: "products/{product}" + }; + + // Output only. The resource name of the target product, in the format of + // `products/[a-z][-a-z0-9]*[a-z0-9]'. + // + // A unique identifier for the product under a catalog. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of the product asset. It can be one of the following values: + // + // * `google.deploymentmanager.Template` + // * `google.cloudprivatecatalog.ListingOnly` + // * `google.cloudprivatecatalog.Terraform` + string asset_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Output only. The display metadata to describe the product. The JSON schema of the + // metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type]. + // When the type is `google.deploymentmanager.Template`, the schema is as + // follows: + // + // ``` + // "$schema": http://json-schema.org/draft-04/schema# + // type: object + // properties: + // name: + // type: string + // minLength: 1 + // maxLength: 64 + // description: + // type: string + // minLength: 1 + // maxLength: 2048 + // tagline: + // type: string + // minLength: 1 + // maxLength: 100 + // support_info: + // type: string + // minLength: 1 + // maxLength: 2048 + // creator: + // type: string + // minLength: 1 + // maxLength: 100 + // documentations: + // type: array + // items: + // type: object + // properties: + // url: + // type: string + // pattern: + // "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + // title: + // type: string + // minLength: 1 + // maxLength: 64 + // description: + // type: string + // minLength: 1 + // maxLength: 2048 + // required: + // - name + // - description + // additionalProperties: false + // + // ``` + // + // When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema + // is as follows: + // + // ``` + // "$schema": http://json-schema.org/draft-04/schema# + // type: object + // properties: + // name: + // type: string + // minLength: 1 + // maxLength: 64 + // description: + // type: string + // minLength: 1 + // maxLength: 2048 + // tagline: + // type: string + // minLength: 1 + // maxLength: 100 + // support_info: + // type: string + // minLength: 1 + // maxLength: 2048 + // creator: + // type: string + // minLength: 1 + // maxLength: 100 + // documentations: + // type: array + // items: + // type: object + // properties: + // url: + // type: string + // pattern: + // "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + // title: + // type: string + // minLength: 1 + // maxLength: 64 + // description: + // type: string + // minLength: 1 + // maxLength: 2048 + // signup_url: + // type: string + // pattern: + // "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + // required: + // - name + // - description + // - signup_url + // additionalProperties: false + // + // ``` + // + // When the asset type is `google.cloudprivatecatalog.Terraform`, the schema + // is as follows: + // + // ``` + // "$schema": http://json-schema.org/draft-04/schema# + // type: object + // properties: + // name: + // type: string + // minLength: 1 + // maxLength: 64 + // description: + // type: string + // minLength: 1 + // maxLength: 2048 + // tagline: + // type: string + // minLength: 1 + // maxLength: 100 + // support_info: + // type: string + // minLength: 1 + // maxLength: 2048 + // creator: + // type: string + // minLength: 1 + // maxLength: 100 + // documentations: + // type: array + // items: + // type: object + // properties: + // url: + // type: string + // pattern: + // "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + // title: + // type: string + // minLength: 1 + // maxLength: 64 + // description: + // type: string + // minLength: 1 + // maxLength: 2048 + // required: + // - name + // - description + // additionalProperties: true + google.protobuf.Struct display_metadata = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The icon URI of the product. + string icon_uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A collection of assets referred by a product. + // This field is set for Terraform Products only. + repeated AssetReference asset_references = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the product was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the product was last updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Defines the reference of an asset belonging to a product. +message AssetReference { + // Possible validation steates of an asset reference. + enum AssetValidationState { + // Unknown state. + ASSET_VALIDATION_STATE_UNSPECIFIED = 0; + + // The validation is still in process. + PENDING = 1; + + // The validation is done and the asset reference is valid. + VALID = 2; + + // The validation is done and the asset reference is invalid. + INVALID = 3; + } + + // Output only. A unique identifier among asset references in a product. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The human-readable description of the referenced asset. Maximum 256 + // characters in length. + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The definition of input parameters to hydrate the asset template. + Inputs inputs = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the asset reference. + AssetValidationState validation_status = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The validation process metadata. + google.longrunning.Operation validation_operation = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The destination of the asset. + oneof source { + // Output only. The asset resource name if an asset is hosted by Private Catalog. + string asset = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The cloud storage object path. + string gcs_path = 11 [ + deprecated = true, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The git source. + GitSource git_source = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The cloud storage source. + GcsSource gcs_source = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The creation timestamp of the asset reference. + google.protobuf.Timestamp create_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of the asset reference. + google.protobuf.Timestamp update_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The version of the source used for this asset reference. + string version = 14 [deprecated = true]; +} + +// Defines definition of input parameters of asset templates. +message Inputs { + // Output only. The JSON schema defining the inputs and their formats. + google.protobuf.Struct parameters = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Defines how to access Cloud Storage source. +message GcsSource { + // Output only. the cloud storage object path. + string gcs_path = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Generation of the object, which is set when the content of an object starts + // being written. + int64 generation = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the object metadata was last changed. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Defines how to access a Git Source. +message GitSource { + // Location of the Git repo to build. + string repo = 1; + + // Directory, relative to the source root, in which to run the build. + // + // This must be a relative path. If a step's `dir` is specified and is an + // absolute path, this value is ignored for that step's execution. + string dir = 2; + + // The revision to fetch from the Git repository such as a branch, a tag, a + // commit SHA, or any Git ref. + oneof ref { + // The revision commit to use. + string commit = 3; + + // The revision branch to use. + string branch = 4; + + // The revision tag to use. + string tag = 5; + } +} + +// The consumer representation of a version which is a child resource under a +// `Product` with asset data. +message Version { + option (google.api.resource) = { + type: "cloudprivatecatalog.googleapis.com/Version" + pattern: "catalogs/{catalog}/products/{product}/versions/{version}" + }; + + // Output only. The resource name of the version, in the format + // `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'. + // + // A unique identifier for the version under a product. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user-supplied description of the version. Maximum of 256 + // characters. + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The asset which has been validated and is ready to be + // provisioned. See + // [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. + google.protobuf.Struct asset = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the version was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the version was last updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..1bc21bcb --- /dev/null +++ b/renovate.json @@ -0,0 +1,73 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-private-catalog", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^junit:junit", + "^com.google.truth:truth", + "^org.mockito:mockito-core", + "^org.objenesis:objenesis" + ], + "semanticCommitType": "test", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "masterIssue": true +} diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml new file mode 100644 index 00000000..f1b74de9 --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + private-catalog-install-without-bom + jar + Google Private Catalog Install Without Bom + https://github.com/googleapis/java-private-catalog + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-private-catalog + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/samples/pom.xml b/samples/pom.xml new file mode 100644 index 00000000..3a3feec6 --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-private-catalog-samples + 0.0.1-SNAPSHOT + pom + Google Private Catalog Samples Parent + https://github.com/googleapis/java-private-catalog + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + + + + + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml new file mode 100644 index 00000000..51f30785 --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + private-catalog-snapshot + jar + Google Private Catalog Snapshot Samples + https://github.com/googleapis/java-private-catalog + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-private-catalog + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + \ No newline at end of file diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml new file mode 100644 index 00000000..089386fb --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + private-catalog-snippets + jar + Google Private Catalog Snippets + https://github.com/googleapis/java-private-catalog + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-private-catalog + 0.0.0 + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + diff --git a/versions.txt b/versions.txt new file mode 100644 index 00000000..47e7a40e --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-private-catalog:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-private-catalog-v1beta1:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-private-catalog-v1beta1:0.0.0:0.0.1-SNAPSHOT