From 633ddaccba133a1756b857f441d2e5d00d553b9b Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Wed, 12 Oct 2022 19:02:14 -0400 Subject: [PATCH] feat: [analyticshub] new module for analyticshub (#8587) - feat: initial generation of analyticshub - build: add the analyticshub module to monorepo - product docs and description --- .release-please-manifest.json | 1 + java-analyticshub/.OwlBot.yaml | 30 + java-analyticshub/.repo-metadata.json | 16 + java-analyticshub/README.md | 201 + .../google-cloud-analyticshub-bom/pom.xml | 56 + .../google-cloud-analyticshub/pom.xml | 138 + .../v1/AnalyticsHubServiceClient.java | 2142 ++++++++ .../v1/AnalyticsHubServiceSettings.java | 380 ++ .../analyticshub/v1/gapic_metadata.json | 63 + .../analyticshub/v1/package-info.java | 47 + .../v1/stub/AnalyticsHubServiceStub.java | 140 + .../stub/AnalyticsHubServiceStubSettings.java | 902 ++++ ...rpcAnalyticsHubServiceCallableFactory.java | 113 + .../v1/stub/GrpcAnalyticsHubServiceStub.java | 665 +++ ...sonAnalyticsHubServiceCallableFactory.java | 105 + .../stub/HttpJsonAnalyticsHubServiceStub.java | 1013 ++++ ...AnalyticsHubServiceClientHttpJsonTest.java | 1342 +++++ .../v1/AnalyticsHubServiceClientTest.java | 1158 +++++ .../v1/MockAnalyticsHubService.java | 59 + .../v1/MockAnalyticsHubServiceImpl.java | 380 ++ .../grpc-google-cloud-analyticshub-v1/pom.xml | 69 + .../v1/AnalyticsHubServiceGrpc.java | 2087 ++++++++ java-analyticshub/owlbot.py | 35 + java-analyticshub/pom.xml | 71 + .../clirr-ignored-differences.xml | 19 + .../pom.xml | 46 + .../analyticshub/v1/AnalyticsHubProto.java | 602 +++ .../v1/CreateDataExchangeRequest.java | 1147 +++++ .../CreateDataExchangeRequestOrBuilder.java | 130 + .../analyticshub/v1/CreateListingRequest.java | 1140 +++++ .../v1/CreateListingRequestOrBuilder.java | 130 + .../analyticshub/v1/DataExchange.java | 1604 ++++++ .../analyticshub/v1/DataExchangeName.java | 227 + .../v1/DataExchangeOrBuilder.java | 200 + .../analyticshub/v1/DataProvider.java | 801 +++ .../v1/DataProviderOrBuilder.java | 77 + .../v1/DeleteDataExchangeRequest.java | 647 +++ .../DeleteDataExchangeRequestOrBuilder.java | 56 + .../analyticshub/v1/DeleteListingRequest.java | 642 +++ .../v1/DeleteListingRequestOrBuilder.java | 56 + .../analyticshub/v1/DestinationDataset.java | 1870 +++++++ .../v1/DestinationDatasetOrBuilder.java | 251 + .../v1/DestinationDatasetReference.java | 818 ++++ .../DestinationDatasetReferenceOrBuilder.java | 79 + .../v1/GetDataExchangeRequest.java | 643 +++ .../v1/GetDataExchangeRequestOrBuilder.java | 56 + .../analyticshub/v1/GetListingRequest.java | 637 +++ .../v1/GetListingRequestOrBuilder.java | 56 + .../v1/ListDataExchangesRequest.java | 927 ++++ .../v1/ListDataExchangesRequestOrBuilder.java | 97 + .../v1/ListDataExchangesResponse.java | 1133 +++++ .../ListDataExchangesResponseOrBuilder.java | 103 + .../analyticshub/v1/ListListingsRequest.java | 920 ++++ .../v1/ListListingsRequestOrBuilder.java | 97 + .../analyticshub/v1/ListListingsResponse.java | 1116 +++++ .../v1/ListListingsResponseOrBuilder.java | 102 + .../v1/ListOrgDataExchangesRequest.java | 915 ++++ .../ListOrgDataExchangesRequestOrBuilder.java | 93 + .../v1/ListOrgDataExchangesResponse.java | 1136 +++++ ...ListOrgDataExchangesResponseOrBuilder.java | 103 + .../bigquery/analyticshub/v1/Listing.java | 4335 +++++++++++++++++ .../bigquery/analyticshub/v1/ListingName.java | 269 + .../analyticshub/v1/ListingOrBuilder.java | 447 ++ .../analyticshub/v1/LocationName.java | 192 + .../bigquery/analyticshub/v1/Publisher.java | 800 +++ .../analyticshub/v1/PublisherOrBuilder.java | 77 + .../v1/SubscribeListingRequest.java | 1037 ++++ .../v1/SubscribeListingRequestOrBuilder.java | 95 + .../v1/SubscribeListingResponse.java | 447 ++ .../v1/SubscribeListingResponseOrBuilder.java | 24 + .../v1/UpdateDataExchangeRequest.java | 1040 ++++ .../UpdateDataExchangeRequestOrBuilder.java | 110 + .../analyticshub/v1/UpdateListingRequest.java | 1033 ++++ .../v1/UpdateListingRequestOrBuilder.java | 110 + .../analyticshub/v1/analyticshub.proto | 651 +++ java-analyticshub/versions.txt | 6 + pom.xml | 1 + release-please-config.json | 4 + 78 files changed, 40567 insertions(+) create mode 100644 java-analyticshub/.OwlBot.yaml create mode 100644 java-analyticshub/.repo-metadata.json create mode 100644 java-analyticshub/README.md create mode 100644 java-analyticshub/google-cloud-analyticshub-bom/pom.xml create mode 100644 java-analyticshub/google-cloud-analyticshub/pom.xml create mode 100644 java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceClient.java create mode 100644 java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceSettings.java create mode 100644 java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/gapic_metadata.json create mode 100644 java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/package-info.java create mode 100644 java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/AnalyticsHubServiceStub.java create mode 100644 java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/AnalyticsHubServiceStubSettings.java create mode 100644 java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/GrpcAnalyticsHubServiceCallableFactory.java create mode 100644 java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/GrpcAnalyticsHubServiceStub.java create mode 100644 java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/HttpJsonAnalyticsHubServiceCallableFactory.java create mode 100644 java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/HttpJsonAnalyticsHubServiceStub.java create mode 100644 java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceClientHttpJsonTest.java create mode 100644 java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceClientTest.java create mode 100644 java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/MockAnalyticsHubService.java create mode 100644 java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/MockAnalyticsHubServiceImpl.java create mode 100644 java-analyticshub/grpc-google-cloud-analyticshub-v1/pom.xml create mode 100644 java-analyticshub/grpc-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceGrpc.java create mode 100644 java-analyticshub/owlbot.py create mode 100644 java-analyticshub/pom.xml create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/clirr-ignored-differences.xml create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/pom.xml create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubProto.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateDataExchangeRequest.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateDataExchangeRequestOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateListingRequest.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateListingRequestOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataExchange.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataExchangeName.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataExchangeOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataProvider.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataProviderOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteDataExchangeRequest.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteDataExchangeRequestOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteListingRequest.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteListingRequestOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDataset.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDatasetOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDatasetReference.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDatasetReferenceOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetDataExchangeRequest.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetDataExchangeRequestOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetListingRequest.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetListingRequestOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesRequest.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesRequestOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesResponse.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesResponseOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsRequest.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsRequestOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsResponse.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsResponseOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesRequest.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesRequestOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesResponse.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesResponseOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/Listing.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListingName.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListingOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/LocationName.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/Publisher.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/PublisherOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingRequest.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingRequestOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingResponse.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingResponseOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateDataExchangeRequest.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateDataExchangeRequestOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateListingRequest.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateListingRequestOrBuilder.java create mode 100644 java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/proto/google/cloud/bigquery/analyticshub/v1/analyticshub.proto create mode 100644 java-analyticshub/versions.txt diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 14a85c7bf028..0860f0c1877e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -6,6 +6,7 @@ "java-aiplatform": "3.4.0", "java-analytics-admin": "0.13.4", "java-analytics-data": "0.14.7", + "java-analyticshub": "0.0.0", "java-api-gateway": "2.3.6", "java-apigee-connect": "2.3.7", "java-apigee-registry": "0.3.1", diff --git a/java-analyticshub/.OwlBot.yaml b/java-analyticshub/.OwlBot.yaml new file mode 100644 index 000000000000..caae4e406a8d --- /dev/null +++ b/java-analyticshub/.OwlBot.yaml @@ -0,0 +1,30 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +deep-remove-regex: +- "/java-analyticshub/grpc-google-.*/src" +- "/java-analyticshub/proto-google-.*/src" +- "/java-analyticshub/google-.*/src" + +deep-preserve-regex: +- "/java-analyticshub/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/bigquery/analyticshub/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-analyticshub/$1/proto-google-cloud-analyticshub-$1/src" +- source: "/google/cloud/bigquery/analyticshub/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-analyticshub/$1/grpc-google-cloud-analyticshub-$1/src" +- source: "/google/cloud/bigquery/analyticshub/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-analyticshub/$1/google-cloud-analyticshub/src" diff --git a/java-analyticshub/.repo-metadata.json b/java-analyticshub/.repo-metadata.json new file mode 100644 index 000000000000..ac00fde0a916 --- /dev/null +++ b/java-analyticshub/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "analyticshub", + "name_pretty": "Analytics Hub API", + "product_documentation": "https://cloud.google.com/bigquery/TBD", + "api_description": "TBD", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-analyticshub/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-analyticshub", + "repo_short": "java-analyticshub", + "distribution_name": "com.google.cloud:google-cloud-analyticshub", + "api_id": "analyticshub.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-analyticshub/README.md b/java-analyticshub/README.md new file mode 100644 index 000000000000..8e947bb8cf61 --- /dev/null +++ b/java-analyticshub/README.md @@ -0,0 +1,201 @@ +# Google Analytics Hub API Client for Java + +Java idiomatic client for [Analytics Hub API][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven, add this to your pom.xml file: + + +```xml + + com.google.cloud + google-cloud-analyticshub + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-analyticshub:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-analyticshub" % "0.0.0" +``` + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Analytics Hub API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Analytics Hub API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Analytics Hub API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Analytics Hub API. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-analyticshub` library. See the [Quickstart](#quickstart) section +to add `google-cloud-analyticshub` as a dependency in your code. + +## About Analytics Hub API + + +[Analytics Hub API][product-docs] Analytics Hub is a data exchange that allows you to efficiently and securely exchange data assets across organizations to address challenges of data reliability and cost. + +See the [Analytics Hub API client library docs][javadocs] to learn how to +use this Analytics Hub API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Analytics Hub API uses gRPC for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/analytics-hub +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-analyticshub/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-analyticshub/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-analyticshub/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-analyticshub/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-analyticshub/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-analyticshub/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-analyticshub/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-analyticshub/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-analyticshub/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-analyticshub/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-analyticshub/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-analyticshub.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-analyticshub&core=gav +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-sdk]: https://cloud.google.com/sdk/ +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-analyticshub/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-analyticshub/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-analyticshub/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=analyticshub.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-analyticshub/google-cloud-analyticshub-bom/pom.xml b/java-analyticshub/google-cloud-analyticshub-bom/pom.xml new file mode 100644 index 000000000000..2e2bca48c92b --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub-bom/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-analyticshub-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-pom-parent + 1.0.0-SNAPSHOT + ../../pom.xml + + + Google Analytics Hub API BOM + https://github.com/googleapis/java-analyticshub + + BOM for Analytics Hub API + + + + true + + + + + + com.google.cloud + google-cloud-analyticshub + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-analyticshub-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-analyticshub-v1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + diff --git a/java-analyticshub/google-cloud-analyticshub/pom.xml b/java-analyticshub/google-cloud-analyticshub/pom.xml new file mode 100644 index 000000000000..4e2d4f3ca819 --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/pom.xml @@ -0,0 +1,138 @@ + + + 4.0.0 + com.google.cloud + google-cloud-analyticshub + 0.0.1-SNAPSHOT + jar + Google Analytics Hub API + https://github.com/googleapis/java-analyticshub + Analytics Hub API TBD + + com.google.cloud + google-cloud-analyticshub-parent + 0.0.1-SNAPSHOT + + + google-cloud-analyticshub + + + + 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-analyticshub-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-analyticshub-v1 + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceClient.java b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceClient.java new file mode 100644 index 000000000000..2ebadbb38b64 --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceClient.java @@ -0,0 +1,2142 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.analyticshub.v1.stub.AnalyticsHubServiceStub; +import com.google.cloud.bigquery.analyticshub.v1.stub.AnalyticsHubServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: The `AnalyticsHubService` API facilitates data sharing within and across + * organizations. It allows data providers to publish listings that reference shared datasets. With + * Analytics Hub, users can discover and search for listings that they have access to. Subscribers + * can view and subscribe to listings. When you subscribe to a listing, Analytics Hub creates a + * linked dataset in your project. + * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+ *   DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]");
+ *   DataExchange response = analyticsHubServiceClient.getDataExchange(name);
+ * }
+ * }
+ * + *

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

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (DataExchange element :
+   *       analyticsHubServiceClient.listDataExchanges(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource path of the data exchanges. e.g. + * `projects/myproject/locations/US`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDataExchangesPagedResponse listDataExchanges(LocationName parent) { + ListDataExchangesRequest request = + ListDataExchangesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDataExchanges(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all data exchanges in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (DataExchange element :
+   *       analyticsHubServiceClient.listDataExchanges(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource path of the data exchanges. e.g. + * `projects/myproject/locations/US`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDataExchangesPagedResponse listDataExchanges(String parent) { + ListDataExchangesRequest request = + ListDataExchangesRequest.newBuilder().setParent(parent).build(); + return listDataExchanges(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all data exchanges in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   ListDataExchangesRequest request =
+   *       ListDataExchangesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (DataExchange element :
+   *       analyticsHubServiceClient.listDataExchanges(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 ListDataExchangesPagedResponse listDataExchanges(ListDataExchangesRequest request) { + return listDataExchangesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all data exchanges in a given project and location. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   String organization = "organization1178922291";
+   *   for (DataExchange element :
+   *       analyticsHubServiceClient.listOrgDataExchanges(organization).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param organization Required. The organization resource path of the projects containing + * DataExchanges. e.g. `organizations/myorg/locations/US`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListOrgDataExchangesPagedResponse listOrgDataExchanges(String organization) { + ListOrgDataExchangesRequest request = + ListOrgDataExchangesRequest.newBuilder().setOrganization(organization).build(); + return listOrgDataExchanges(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all data exchanges from projects in a given organization and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   ListOrgDataExchangesRequest request =
+   *       ListOrgDataExchangesRequest.newBuilder()
+   *           .setOrganization("organization1178922291")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (DataExchange element :
+   *       analyticsHubServiceClient.listOrgDataExchanges(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 ListOrgDataExchangesPagedResponse listOrgDataExchanges( + ListOrgDataExchangesRequest request) { + return listOrgDataExchangesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all data exchanges from projects in a given organization and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   ListOrgDataExchangesRequest request =
+   *       ListOrgDataExchangesRequest.newBuilder()
+   *           .setOrganization("organization1178922291")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       analyticsHubServiceClient.listOrgDataExchangesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (DataExchange element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listOrgDataExchangesPagedCallable() { + return stub.listOrgDataExchangesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all data exchanges from projects in a given organization and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   ListOrgDataExchangesRequest request =
+   *       ListOrgDataExchangesRequest.newBuilder()
+   *           .setOrganization("organization1178922291")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListOrgDataExchangesResponse response =
+   *         analyticsHubServiceClient.listOrgDataExchangesCallable().call(request);
+   *     for (DataExchange element : response.getDataExchangesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listOrgDataExchangesCallable() { + return stub.listOrgDataExchangesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a data exchange. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]");
+   *   DataExchange response = analyticsHubServiceClient.getDataExchange(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the data exchange. e.g. + * `projects/myproject/locations/US/dataExchanges/123`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataExchange getDataExchange(DataExchangeName name) { + GetDataExchangeRequest request = + GetDataExchangeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getDataExchange(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a data exchange. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   String name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString();
+   *   DataExchange response = analyticsHubServiceClient.getDataExchange(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the data exchange. e.g. + * `projects/myproject/locations/US/dataExchanges/123`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataExchange getDataExchange(String name) { + GetDataExchangeRequest request = GetDataExchangeRequest.newBuilder().setName(name).build(); + return getDataExchange(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a data exchange. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   GetDataExchangeRequest request =
+   *       GetDataExchangeRequest.newBuilder()
+   *           .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
+   *           .build();
+   *   DataExchange response = analyticsHubServiceClient.getDataExchange(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataExchange getDataExchange(GetDataExchangeRequest request) { + return getDataExchangeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a data exchange. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   GetDataExchangeRequest request =
+   *       GetDataExchangeRequest.newBuilder()
+   *           .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       analyticsHubServiceClient.getDataExchangeCallable().futureCall(request);
+   *   // Do something.
+   *   DataExchange response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getDataExchangeCallable() { + return stub.getDataExchangeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new data exchange. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   DataExchange dataExchange = DataExchange.newBuilder().build();
+   *   DataExchange response = analyticsHubServiceClient.createDataExchange(parent, dataExchange);
+   * }
+   * }
+ * + * @param parent Required. The parent resource path of the data exchange. e.g. + * `projects/myproject/locations/US`. + * @param dataExchange Required. The data exchange to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataExchange createDataExchange(LocationName parent, DataExchange dataExchange) { + CreateDataExchangeRequest request = + CreateDataExchangeRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDataExchange(dataExchange) + .build(); + return createDataExchange(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new data exchange. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   DataExchange dataExchange = DataExchange.newBuilder().build();
+   *   DataExchange response = analyticsHubServiceClient.createDataExchange(parent, dataExchange);
+   * }
+   * }
+ * + * @param parent Required. The parent resource path of the data exchange. e.g. + * `projects/myproject/locations/US`. + * @param dataExchange Required. The data exchange to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataExchange createDataExchange(String parent, DataExchange dataExchange) { + CreateDataExchangeRequest request = + CreateDataExchangeRequest.newBuilder() + .setParent(parent) + .setDataExchange(dataExchange) + .build(); + return createDataExchange(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new data exchange. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   CreateDataExchangeRequest request =
+   *       CreateDataExchangeRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setDataExchangeId("dataExchangeId783243752")
+   *           .setDataExchange(DataExchange.newBuilder().build())
+   *           .build();
+   *   DataExchange response = analyticsHubServiceClient.createDataExchange(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataExchange createDataExchange(CreateDataExchangeRequest request) { + return createDataExchangeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new data exchange. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   DataExchange dataExchange = DataExchange.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   DataExchange response =
+   *       analyticsHubServiceClient.updateDataExchange(dataExchange, updateMask);
+   * }
+   * }
+ * + * @param dataExchange Required. The data exchange to update. + * @param updateMask Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the `updateMask` are relative to the resource and are not + * a full request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataExchange updateDataExchange(DataExchange dataExchange, FieldMask updateMask) { + UpdateDataExchangeRequest request = + UpdateDataExchangeRequest.newBuilder() + .setDataExchange(dataExchange) + .setUpdateMask(updateMask) + .build(); + return updateDataExchange(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing data exchange. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   UpdateDataExchangeRequest request =
+   *       UpdateDataExchangeRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setDataExchange(DataExchange.newBuilder().build())
+   *           .build();
+   *   DataExchange response = analyticsHubServiceClient.updateDataExchange(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataExchange updateDataExchange(UpdateDataExchangeRequest request) { + return updateDataExchangeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing data exchange. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   UpdateDataExchangeRequest request =
+   *       UpdateDataExchangeRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setDataExchange(DataExchange.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       analyticsHubServiceClient.updateDataExchangeCallable().futureCall(request);
+   *   // Do something.
+   *   DataExchange response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateDataExchangeCallable() { + return stub.updateDataExchangeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an existing data exchange. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]");
+   *   analyticsHubServiceClient.deleteDataExchange(name);
+   * }
+   * }
+ * + * @param name Required. The full name of the data exchange resource that you want to delete. For + * example, `projects/myproject/locations/US/dataExchanges/123`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDataExchange(DataExchangeName name) { + DeleteDataExchangeRequest request = + DeleteDataExchangeRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteDataExchange(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an existing data exchange. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   String name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString();
+   *   analyticsHubServiceClient.deleteDataExchange(name);
+   * }
+   * }
+ * + * @param name Required. The full name of the data exchange resource that you want to delete. For + * example, `projects/myproject/locations/US/dataExchanges/123`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDataExchange(String name) { + DeleteDataExchangeRequest request = + DeleteDataExchangeRequest.newBuilder().setName(name).build(); + deleteDataExchange(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an existing data exchange. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   DataExchangeName parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]");
+   *   for (Listing element : analyticsHubServiceClient.listListings(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource path of the listing. e.g. + * `projects/myproject/locations/US/dataExchanges/123`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListListingsPagedResponse listListings(DataExchangeName parent) { + ListListingsRequest request = + ListListingsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listListings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all listings in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   String parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString();
+   *   for (Listing element : analyticsHubServiceClient.listListings(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource path of the listing. e.g. + * `projects/myproject/locations/US/dataExchanges/123`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListListingsPagedResponse listListings(String parent) { + ListListingsRequest request = ListListingsRequest.newBuilder().setParent(parent).build(); + return listListings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all listings in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   ListListingsRequest request =
+   *       ListListingsRequest.newBuilder()
+   *           .setParent(
+   *               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Listing element : analyticsHubServiceClient.listListings(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 ListListingsPagedResponse listListings(ListListingsRequest request) { + return listListingsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all listings in a given project and location. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]");
+   *   Listing response = analyticsHubServiceClient.getListing(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the listing. e.g. + * `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Listing getListing(ListingName name) { + GetListingRequest request = + GetListingRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getListing(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a listing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   String name =
+   *       ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]").toString();
+   *   Listing response = analyticsHubServiceClient.getListing(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the listing. e.g. + * `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Listing getListing(String name) { + GetListingRequest request = GetListingRequest.newBuilder().setName(name).build(); + return getListing(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a listing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   GetListingRequest request =
+   *       GetListingRequest.newBuilder()
+   *           .setName(
+   *               ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]")
+   *                   .toString())
+   *           .build();
+   *   Listing response = analyticsHubServiceClient.getListing(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Listing getListing(GetListingRequest request) { + return getListingCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a listing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   GetListingRequest request =
+   *       GetListingRequest.newBuilder()
+   *           .setName(
+   *               ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       analyticsHubServiceClient.getListingCallable().futureCall(request);
+   *   // Do something.
+   *   Listing response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getListingCallable() { + return stub.getListingCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new listing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   DataExchangeName parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]");
+   *   Listing listing = Listing.newBuilder().build();
+   *   Listing response = analyticsHubServiceClient.createListing(parent, listing);
+   * }
+   * }
+ * + * @param parent Required. The parent resource path of the listing. e.g. + * `projects/myproject/locations/US/dataExchanges/123`. + * @param listing Required. The listing to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Listing createListing(DataExchangeName parent, Listing listing) { + CreateListingRequest request = + CreateListingRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setListing(listing) + .build(); + return createListing(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new listing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   String parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString();
+   *   Listing listing = Listing.newBuilder().build();
+   *   Listing response = analyticsHubServiceClient.createListing(parent, listing);
+   * }
+   * }
+ * + * @param parent Required. The parent resource path of the listing. e.g. + * `projects/myproject/locations/US/dataExchanges/123`. + * @param listing Required. The listing to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Listing createListing(String parent, Listing listing) { + CreateListingRequest request = + CreateListingRequest.newBuilder().setParent(parent).setListing(listing).build(); + return createListing(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new listing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   CreateListingRequest request =
+   *       CreateListingRequest.newBuilder()
+   *           .setParent(
+   *               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
+   *           .setListingId("listingId-1215024449")
+   *           .setListing(Listing.newBuilder().build())
+   *           .build();
+   *   Listing response = analyticsHubServiceClient.createListing(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Listing createListing(CreateListingRequest request) { + return createListingCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new listing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   CreateListingRequest request =
+   *       CreateListingRequest.newBuilder()
+   *           .setParent(
+   *               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
+   *           .setListingId("listingId-1215024449")
+   *           .setListing(Listing.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       analyticsHubServiceClient.createListingCallable().futureCall(request);
+   *   // Do something.
+   *   Listing response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createListingCallable() { + return stub.createListingCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing listing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   Listing listing = Listing.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Listing response = analyticsHubServiceClient.updateListing(listing, updateMask);
+   * }
+   * }
+ * + * @param listing Required. The listing to update. + * @param updateMask Required. Field mask specifies the fields to update in the listing resource. + * The fields specified in the `updateMask` are relative to the resource and are not a full + * request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Listing updateListing(Listing listing, FieldMask updateMask) { + UpdateListingRequest request = + UpdateListingRequest.newBuilder().setListing(listing).setUpdateMask(updateMask).build(); + return updateListing(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing listing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   UpdateListingRequest request =
+   *       UpdateListingRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setListing(Listing.newBuilder().build())
+   *           .build();
+   *   Listing response = analyticsHubServiceClient.updateListing(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Listing updateListing(UpdateListingRequest request) { + return updateListingCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing listing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   UpdateListingRequest request =
+   *       UpdateListingRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setListing(Listing.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       analyticsHubServiceClient.updateListingCallable().futureCall(request);
+   *   // Do something.
+   *   Listing response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateListingCallable() { + return stub.updateListingCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a listing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]");
+   *   analyticsHubServiceClient.deleteListing(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the listing to delete. e.g. + * `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteListing(ListingName name) { + DeleteListingRequest request = + DeleteListingRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteListing(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a listing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   String name =
+   *       ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]").toString();
+   *   analyticsHubServiceClient.deleteListing(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the listing to delete. e.g. + * `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteListing(String name) { + DeleteListingRequest request = DeleteListingRequest.newBuilder().setName(name).build(); + deleteListing(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a listing. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Currently, with Analytics Hub, you can create listings that reference only BigQuery + * datasets. Upon subscription to a listing for a BigQuery dataset, Analytics Hub creates a linked + * dataset in the subscriber's project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]");
+   *   SubscribeListingResponse response = analyticsHubServiceClient.subscribeListing(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the listing that you want to subscribe to. e.g. + * `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SubscribeListingResponse subscribeListing(ListingName name) { + SubscribeListingRequest request = + SubscribeListingRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return subscribeListing(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Subscribes to a listing. + * + *

Currently, with Analytics Hub, you can create listings that reference only BigQuery + * datasets. Upon subscription to a listing for a BigQuery dataset, Analytics Hub creates a linked + * dataset in the subscriber's project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   String name =
+   *       ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]").toString();
+   *   SubscribeListingResponse response = analyticsHubServiceClient.subscribeListing(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the listing that you want to subscribe to. e.g. + * `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SubscribeListingResponse subscribeListing(String name) { + SubscribeListingRequest request = SubscribeListingRequest.newBuilder().setName(name).build(); + return subscribeListing(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Subscribes to a listing. + * + *

Currently, with Analytics Hub, you can create listings that reference only BigQuery + * datasets. Upon subscription to a listing for a BigQuery dataset, Analytics Hub creates a linked + * dataset in the subscriber's project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   SubscribeListingRequest request =
+   *       SubscribeListingRequest.newBuilder()
+   *           .setName(
+   *               ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]")
+   *                   .toString())
+   *           .build();
+   *   SubscribeListingResponse response = analyticsHubServiceClient.subscribeListing(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SubscribeListingResponse subscribeListing(SubscribeListingRequest request) { + return subscribeListingCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Subscribes to a listing. + * + *

Currently, with Analytics Hub, you can create listings that reference only BigQuery + * datasets. Upon subscription to a listing for a BigQuery dataset, Analytics Hub creates a linked + * dataset in the subscriber's project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   SubscribeListingRequest request =
+   *       SubscribeListingRequest.newBuilder()
+   *           .setName(
+   *               ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       analyticsHubServiceClient.subscribeListingCallable().futureCall(request);
+   *   // Do something.
+   *   SubscribeListingResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + subscribeListingCallable() { + return stub.subscribeListingCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the IAM policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = analyticsHubServiceClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the IAM policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       analyticsHubServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the IAM policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = analyticsHubServiceClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the IAM policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       analyticsHubServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the permissions that a caller has. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = analyticsHubServiceClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the permissions that a caller has. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       analyticsHubServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListDataExchangesPagedResponse + extends AbstractPagedListResponse< + ListDataExchangesRequest, + ListDataExchangesResponse, + DataExchange, + ListDataExchangesPage, + ListDataExchangesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDataExchangesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListDataExchangesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListDataExchangesPagedResponse(ListDataExchangesPage page) { + super(page, ListDataExchangesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDataExchangesPage + extends AbstractPage< + ListDataExchangesRequest, + ListDataExchangesResponse, + DataExchange, + ListDataExchangesPage> { + + private ListDataExchangesPage( + PageContext context, + ListDataExchangesResponse response) { + super(context, response); + } + + private static ListDataExchangesPage createEmptyPage() { + return new ListDataExchangesPage(null, null); + } + + @Override + protected ListDataExchangesPage createPage( + PageContext context, + ListDataExchangesResponse response) { + return new ListDataExchangesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDataExchangesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDataExchangesRequest, + ListDataExchangesResponse, + DataExchange, + ListDataExchangesPage, + ListDataExchangesFixedSizeCollection> { + + private ListDataExchangesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDataExchangesFixedSizeCollection createEmptyCollection() { + return new ListDataExchangesFixedSizeCollection(null, 0); + } + + @Override + protected ListDataExchangesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDataExchangesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListOrgDataExchangesPagedResponse + extends AbstractPagedListResponse< + ListOrgDataExchangesRequest, + ListOrgDataExchangesResponse, + DataExchange, + ListOrgDataExchangesPage, + ListOrgDataExchangesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListOrgDataExchangesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListOrgDataExchangesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListOrgDataExchangesPagedResponse(ListOrgDataExchangesPage page) { + super(page, ListOrgDataExchangesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListOrgDataExchangesPage + extends AbstractPage< + ListOrgDataExchangesRequest, + ListOrgDataExchangesResponse, + DataExchange, + ListOrgDataExchangesPage> { + + private ListOrgDataExchangesPage( + PageContext + context, + ListOrgDataExchangesResponse response) { + super(context, response); + } + + private static ListOrgDataExchangesPage createEmptyPage() { + return new ListOrgDataExchangesPage(null, null); + } + + @Override + protected ListOrgDataExchangesPage createPage( + PageContext + context, + ListOrgDataExchangesResponse response) { + return new ListOrgDataExchangesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListOrgDataExchangesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListOrgDataExchangesRequest, + ListOrgDataExchangesResponse, + DataExchange, + ListOrgDataExchangesPage, + ListOrgDataExchangesFixedSizeCollection> { + + private ListOrgDataExchangesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListOrgDataExchangesFixedSizeCollection createEmptyCollection() { + return new ListOrgDataExchangesFixedSizeCollection(null, 0); + } + + @Override + protected ListOrgDataExchangesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListOrgDataExchangesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListListingsPagedResponse + extends AbstractPagedListResponse< + ListListingsRequest, + ListListingsResponse, + Listing, + ListListingsPage, + ListListingsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListListingsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListListingsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListListingsPagedResponse(ListListingsPage page) { + super(page, ListListingsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListListingsPage + extends AbstractPage { + + private ListListingsPage( + PageContext context, + ListListingsResponse response) { + super(context, response); + } + + private static ListListingsPage createEmptyPage() { + return new ListListingsPage(null, null); + } + + @Override + protected ListListingsPage createPage( + PageContext context, + ListListingsResponse response) { + return new ListListingsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListListingsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListListingsRequest, + ListListingsResponse, + Listing, + ListListingsPage, + ListListingsFixedSizeCollection> { + + private ListListingsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListListingsFixedSizeCollection createEmptyCollection() { + return new ListListingsFixedSizeCollection(null, 0); + } + + @Override + protected ListListingsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListListingsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceSettings.java b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceSettings.java new file mode 100644 index 000000000000..6ca63a9a5b53 --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceSettings.java @@ -0,0 +1,380 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1; + +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListDataExchangesPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListListingsPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.bigquery.analyticshub.v1.stub.AnalyticsHubServiceStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AnalyticsHubServiceClient}. + * + *

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

    + *
  • The default service address (analyticshub.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 getDataExchange to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AnalyticsHubServiceSettings.Builder analyticsHubServiceSettingsBuilder =
+ *     AnalyticsHubServiceSettings.newBuilder();
+ * analyticsHubServiceSettingsBuilder
+ *     .getDataExchangeSettings()
+ *     .setRetrySettings(
+ *         analyticsHubServiceSettingsBuilder
+ *             .getDataExchangeSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AnalyticsHubServiceSettings analyticsHubServiceSettings =
+ *     analyticsHubServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AnalyticsHubServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listDataExchanges. */ + public PagedCallSettings< + ListDataExchangesRequest, ListDataExchangesResponse, ListDataExchangesPagedResponse> + listDataExchangesSettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).listDataExchangesSettings(); + } + + /** Returns the object with the settings used for calls to listOrgDataExchanges. */ + public PagedCallSettings< + ListOrgDataExchangesRequest, + ListOrgDataExchangesResponse, + ListOrgDataExchangesPagedResponse> + listOrgDataExchangesSettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).listOrgDataExchangesSettings(); + } + + /** Returns the object with the settings used for calls to getDataExchange. */ + public UnaryCallSettings getDataExchangeSettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).getDataExchangeSettings(); + } + + /** Returns the object with the settings used for calls to createDataExchange. */ + public UnaryCallSettings createDataExchangeSettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).createDataExchangeSettings(); + } + + /** Returns the object with the settings used for calls to updateDataExchange. */ + public UnaryCallSettings updateDataExchangeSettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).updateDataExchangeSettings(); + } + + /** Returns the object with the settings used for calls to deleteDataExchange. */ + public UnaryCallSettings deleteDataExchangeSettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).deleteDataExchangeSettings(); + } + + /** Returns the object with the settings used for calls to listListings. */ + public PagedCallSettings + listListingsSettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).listListingsSettings(); + } + + /** Returns the object with the settings used for calls to getListing. */ + public UnaryCallSettings getListingSettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).getListingSettings(); + } + + /** Returns the object with the settings used for calls to createListing. */ + public UnaryCallSettings createListingSettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).createListingSettings(); + } + + /** Returns the object with the settings used for calls to updateListing. */ + public UnaryCallSettings updateListingSettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).updateListingSettings(); + } + + /** Returns the object with the settings used for calls to deleteListing. */ + public UnaryCallSettings deleteListingSettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).deleteListingSettings(); + } + + /** Returns the object with the settings used for calls to subscribeListing. */ + public UnaryCallSettings + subscribeListingSettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).subscribeListingSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((AnalyticsHubServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final AnalyticsHubServiceSettings create(AnalyticsHubServiceStubSettings stub) + throws IOException { + return new AnalyticsHubServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AnalyticsHubServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AnalyticsHubServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AnalyticsHubServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AnalyticsHubServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AnalyticsHubServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return AnalyticsHubServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AnalyticsHubServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AnalyticsHubServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AnalyticsHubServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AnalyticsHubServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AnalyticsHubServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(AnalyticsHubServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AnalyticsHubServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AnalyticsHubServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(AnalyticsHubServiceStubSettings.newHttpJsonBuilder()); + } + + public AnalyticsHubServiceStubSettings.Builder getStubSettingsBuilder() { + return ((AnalyticsHubServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listDataExchanges. */ + public PagedCallSettings.Builder< + ListDataExchangesRequest, ListDataExchangesResponse, ListDataExchangesPagedResponse> + listDataExchangesSettings() { + return getStubSettingsBuilder().listDataExchangesSettings(); + } + + /** Returns the builder for the settings used for calls to listOrgDataExchanges. */ + public PagedCallSettings.Builder< + ListOrgDataExchangesRequest, + ListOrgDataExchangesResponse, + ListOrgDataExchangesPagedResponse> + listOrgDataExchangesSettings() { + return getStubSettingsBuilder().listOrgDataExchangesSettings(); + } + + /** Returns the builder for the settings used for calls to getDataExchange. */ + public UnaryCallSettings.Builder + getDataExchangeSettings() { + return getStubSettingsBuilder().getDataExchangeSettings(); + } + + /** Returns the builder for the settings used for calls to createDataExchange. */ + public UnaryCallSettings.Builder + createDataExchangeSettings() { + return getStubSettingsBuilder().createDataExchangeSettings(); + } + + /** Returns the builder for the settings used for calls to updateDataExchange. */ + public UnaryCallSettings.Builder + updateDataExchangeSettings() { + return getStubSettingsBuilder().updateDataExchangeSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDataExchange. */ + public UnaryCallSettings.Builder + deleteDataExchangeSettings() { + return getStubSettingsBuilder().deleteDataExchangeSettings(); + } + + /** Returns the builder for the settings used for calls to listListings. */ + public PagedCallSettings.Builder< + ListListingsRequest, ListListingsResponse, ListListingsPagedResponse> + listListingsSettings() { + return getStubSettingsBuilder().listListingsSettings(); + } + + /** Returns the builder for the settings used for calls to getListing. */ + public UnaryCallSettings.Builder getListingSettings() { + return getStubSettingsBuilder().getListingSettings(); + } + + /** Returns the builder for the settings used for calls to createListing. */ + public UnaryCallSettings.Builder createListingSettings() { + return getStubSettingsBuilder().createListingSettings(); + } + + /** Returns the builder for the settings used for calls to updateListing. */ + public UnaryCallSettings.Builder updateListingSettings() { + return getStubSettingsBuilder().updateListingSettings(); + } + + /** Returns the builder for the settings used for calls to deleteListing. */ + public UnaryCallSettings.Builder deleteListingSettings() { + return getStubSettingsBuilder().deleteListingSettings(); + } + + /** Returns the builder for the settings used for calls to subscribeListing. */ + public UnaryCallSettings.Builder + subscribeListingSettings() { + return getStubSettingsBuilder().subscribeListingSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public AnalyticsHubServiceSettings build() throws IOException { + return new AnalyticsHubServiceSettings(this); + } + } +} diff --git a/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/gapic_metadata.json b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/gapic_metadata.json new file mode 100644 index 000000000000..3773f7d08e13 --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/gapic_metadata.json @@ -0,0 +1,63 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.bigquery.analyticshub.v1", + "libraryPackage": "com.google.cloud.bigquery.analyticshub.v1", + "services": { + "AnalyticsHubService": { + "clients": { + "grpc": { + "libraryClient": "AnalyticsHubServiceClient", + "rpcs": { + "CreateDataExchange": { + "methods": ["createDataExchange", "createDataExchange", "createDataExchange", "createDataExchangeCallable"] + }, + "CreateListing": { + "methods": ["createListing", "createListing", "createListing", "createListingCallable"] + }, + "DeleteDataExchange": { + "methods": ["deleteDataExchange", "deleteDataExchange", "deleteDataExchange", "deleteDataExchangeCallable"] + }, + "DeleteListing": { + "methods": ["deleteListing", "deleteListing", "deleteListing", "deleteListingCallable"] + }, + "GetDataExchange": { + "methods": ["getDataExchange", "getDataExchange", "getDataExchange", "getDataExchangeCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetListing": { + "methods": ["getListing", "getListing", "getListing", "getListingCallable"] + }, + "ListDataExchanges": { + "methods": ["listDataExchanges", "listDataExchanges", "listDataExchanges", "listDataExchangesPagedCallable", "listDataExchangesCallable"] + }, + "ListListings": { + "methods": ["listListings", "listListings", "listListings", "listListingsPagedCallable", "listListingsCallable"] + }, + "ListOrgDataExchanges": { + "methods": ["listOrgDataExchanges", "listOrgDataExchanges", "listOrgDataExchangesPagedCallable", "listOrgDataExchangesCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "SubscribeListing": { + "methods": ["subscribeListing", "subscribeListing", "subscribeListing", "subscribeListingCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateDataExchange": { + "methods": ["updateDataExchange", "updateDataExchange", "updateDataExchangeCallable"] + }, + "UpdateListing": { + "methods": ["updateListing", "updateListing", "updateListingCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/package-info.java b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/package-info.java new file mode 100644 index 000000000000..2afc00e913ba --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/package-info.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Analytics Hub API + * + *

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

======================= AnalyticsHubServiceClient ======================= + * + *

Service Description: The `AnalyticsHubService` API facilitates data sharing within and across + * organizations. It allows data providers to publish listings that reference shared datasets. With + * Analytics Hub, users can discover and search for listings that they have access to. Subscribers + * can view and subscribe to listings. When you subscribe to a listing, Analytics Hub creates a + * linked dataset in your project. + * + *

Sample for AnalyticsHubServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
+ *   DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]");
+ *   DataExchange response = analyticsHubServiceClient.getDataExchange(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.bigquery.analyticshub.v1; + +import javax.annotation.Generated; diff --git a/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/AnalyticsHubServiceStub.java b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/AnalyticsHubServiceStub.java new file mode 100644 index 000000000000..732de2b8a2ee --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/AnalyticsHubServiceStub.java @@ -0,0 +1,140 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1.stub; + +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListDataExchangesPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListListingsPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.DataExchange; +import com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.GetListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse; +import com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse; +import com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse; +import com.google.cloud.bigquery.analyticshub.v1.Listing; +import com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse; +import com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the AnalyticsHubService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class AnalyticsHubServiceStub implements BackgroundResource { + + public UnaryCallable + listDataExchangesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDataExchangesPagedCallable()"); + } + + public UnaryCallable + listDataExchangesCallable() { + throw new UnsupportedOperationException("Not implemented: listDataExchangesCallable()"); + } + + public UnaryCallable + listOrgDataExchangesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listOrgDataExchangesPagedCallable()"); + } + + public UnaryCallable + listOrgDataExchangesCallable() { + throw new UnsupportedOperationException("Not implemented: listOrgDataExchangesCallable()"); + } + + public UnaryCallable getDataExchangeCallable() { + throw new UnsupportedOperationException("Not implemented: getDataExchangeCallable()"); + } + + public UnaryCallable createDataExchangeCallable() { + throw new UnsupportedOperationException("Not implemented: createDataExchangeCallable()"); + } + + public UnaryCallable updateDataExchangeCallable() { + throw new UnsupportedOperationException("Not implemented: updateDataExchangeCallable()"); + } + + public UnaryCallable deleteDataExchangeCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDataExchangeCallable()"); + } + + public UnaryCallable listListingsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listListingsPagedCallable()"); + } + + public UnaryCallable listListingsCallable() { + throw new UnsupportedOperationException("Not implemented: listListingsCallable()"); + } + + public UnaryCallable getListingCallable() { + throw new UnsupportedOperationException("Not implemented: getListingCallable()"); + } + + public UnaryCallable createListingCallable() { + throw new UnsupportedOperationException("Not implemented: createListingCallable()"); + } + + public UnaryCallable updateListingCallable() { + throw new UnsupportedOperationException("Not implemented: updateListingCallable()"); + } + + public UnaryCallable deleteListingCallable() { + throw new UnsupportedOperationException("Not implemented: deleteListingCallable()"); + } + + public UnaryCallable + subscribeListingCallable() { + throw new UnsupportedOperationException("Not implemented: subscribeListingCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/AnalyticsHubServiceStubSettings.java b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/AnalyticsHubServiceStubSettings.java new file mode 100644 index 000000000000..64bdbfb9212d --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/AnalyticsHubServiceStubSettings.java @@ -0,0 +1,902 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1.stub; + +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListDataExchangesPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListListingsPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.DataExchange; +import com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.GetListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse; +import com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse; +import com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse; +import com.google.cloud.bigquery.analyticshub.v1.Listing; +import com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse; +import com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AnalyticsHubServiceStub}. + * + *

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

    + *
  • The default service address (analyticshub.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 getDataExchange to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AnalyticsHubServiceStubSettings.Builder analyticsHubServiceSettingsBuilder =
+ *     AnalyticsHubServiceStubSettings.newBuilder();
+ * analyticsHubServiceSettingsBuilder
+ *     .getDataExchangeSettings()
+ *     .setRetrySettings(
+ *         analyticsHubServiceSettingsBuilder
+ *             .getDataExchangeSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AnalyticsHubServiceStubSettings analyticsHubServiceSettings =
+ *     analyticsHubServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AnalyticsHubServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/bigquery") + .add("https://www.googleapis.com/auth/cloud-platform") + .build(); + + private final PagedCallSettings< + ListDataExchangesRequest, ListDataExchangesResponse, ListDataExchangesPagedResponse> + listDataExchangesSettings; + private final PagedCallSettings< + ListOrgDataExchangesRequest, + ListOrgDataExchangesResponse, + ListOrgDataExchangesPagedResponse> + listOrgDataExchangesSettings; + private final UnaryCallSettings getDataExchangeSettings; + private final UnaryCallSettings + createDataExchangeSettings; + private final UnaryCallSettings + updateDataExchangeSettings; + private final UnaryCallSettings deleteDataExchangeSettings; + private final PagedCallSettings< + ListListingsRequest, ListListingsResponse, ListListingsPagedResponse> + listListingsSettings; + private final UnaryCallSettings getListingSettings; + private final UnaryCallSettings createListingSettings; + private final UnaryCallSettings updateListingSettings; + private final UnaryCallSettings deleteListingSettings; + private final UnaryCallSettings + subscribeListingSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor< + ListDataExchangesRequest, ListDataExchangesResponse, DataExchange> + LIST_DATA_EXCHANGES_PAGE_STR_DESC = + new PagedListDescriptor< + ListDataExchangesRequest, ListDataExchangesResponse, DataExchange>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDataExchangesRequest injectToken( + ListDataExchangesRequest payload, String token) { + return ListDataExchangesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDataExchangesRequest injectPageSize( + ListDataExchangesRequest payload, int pageSize) { + return ListDataExchangesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListDataExchangesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDataExchangesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDataExchangesResponse payload) { + return payload.getDataExchangesList() == null + ? ImmutableList.of() + : payload.getDataExchangesList(); + } + }; + + private static final PagedListDescriptor< + ListOrgDataExchangesRequest, ListOrgDataExchangesResponse, DataExchange> + LIST_ORG_DATA_EXCHANGES_PAGE_STR_DESC = + new PagedListDescriptor< + ListOrgDataExchangesRequest, ListOrgDataExchangesResponse, DataExchange>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListOrgDataExchangesRequest injectToken( + ListOrgDataExchangesRequest payload, String token) { + return ListOrgDataExchangesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListOrgDataExchangesRequest injectPageSize( + ListOrgDataExchangesRequest payload, int pageSize) { + return ListOrgDataExchangesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListOrgDataExchangesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListOrgDataExchangesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListOrgDataExchangesResponse payload) { + return payload.getDataExchangesList() == null + ? ImmutableList.of() + : payload.getDataExchangesList(); + } + }; + + private static final PagedListDescriptor + LIST_LISTINGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListListingsRequest injectToken(ListListingsRequest payload, String token) { + return ListListingsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListListingsRequest injectPageSize(ListListingsRequest payload, int pageSize) { + return ListListingsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListListingsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListListingsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListListingsResponse payload) { + return payload.getListingsList() == null + ? ImmutableList.of() + : payload.getListingsList(); + } + }; + + private static final PagedListResponseFactory< + ListDataExchangesRequest, ListDataExchangesResponse, ListDataExchangesPagedResponse> + LIST_DATA_EXCHANGES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDataExchangesRequest, + ListDataExchangesResponse, + ListDataExchangesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDataExchangesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_DATA_EXCHANGES_PAGE_STR_DESC, request, context); + return ListDataExchangesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListOrgDataExchangesRequest, + ListOrgDataExchangesResponse, + ListOrgDataExchangesPagedResponse> + LIST_ORG_DATA_EXCHANGES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListOrgDataExchangesRequest, + ListOrgDataExchangesResponse, + ListOrgDataExchangesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListOrgDataExchangesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_ORG_DATA_EXCHANGES_PAGE_STR_DESC, request, context); + return ListOrgDataExchangesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListListingsRequest, ListListingsResponse, ListListingsPagedResponse> + LIST_LISTINGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListListingsRequest, ListListingsResponse, ListListingsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListListingsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LISTINGS_PAGE_STR_DESC, request, context); + return ListListingsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listDataExchanges. */ + public PagedCallSettings< + ListDataExchangesRequest, ListDataExchangesResponse, ListDataExchangesPagedResponse> + listDataExchangesSettings() { + return listDataExchangesSettings; + } + + /** Returns the object with the settings used for calls to listOrgDataExchanges. */ + public PagedCallSettings< + ListOrgDataExchangesRequest, + ListOrgDataExchangesResponse, + ListOrgDataExchangesPagedResponse> + listOrgDataExchangesSettings() { + return listOrgDataExchangesSettings; + } + + /** Returns the object with the settings used for calls to getDataExchange. */ + public UnaryCallSettings getDataExchangeSettings() { + return getDataExchangeSettings; + } + + /** Returns the object with the settings used for calls to createDataExchange. */ + public UnaryCallSettings createDataExchangeSettings() { + return createDataExchangeSettings; + } + + /** Returns the object with the settings used for calls to updateDataExchange. */ + public UnaryCallSettings updateDataExchangeSettings() { + return updateDataExchangeSettings; + } + + /** Returns the object with the settings used for calls to deleteDataExchange. */ + public UnaryCallSettings deleteDataExchangeSettings() { + return deleteDataExchangeSettings; + } + + /** Returns the object with the settings used for calls to listListings. */ + public PagedCallSettings + listListingsSettings() { + return listListingsSettings; + } + + /** Returns the object with the settings used for calls to getListing. */ + public UnaryCallSettings getListingSettings() { + return getListingSettings; + } + + /** Returns the object with the settings used for calls to createListing. */ + public UnaryCallSettings createListingSettings() { + return createListingSettings; + } + + /** Returns the object with the settings used for calls to updateListing. */ + public UnaryCallSettings updateListingSettings() { + return updateListingSettings; + } + + /** Returns the object with the settings used for calls to deleteListing. */ + public UnaryCallSettings deleteListingSettings() { + return deleteListingSettings; + } + + /** Returns the object with the settings used for calls to subscribeListing. */ + public UnaryCallSettings + subscribeListingSettings() { + return subscribeListingSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public AnalyticsHubServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAnalyticsHubServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAnalyticsHubServiceStub.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 "analyticshub.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "analyticshub.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AnalyticsHubServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AnalyticsHubServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AnalyticsHubServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AnalyticsHubServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listDataExchangesSettings = settingsBuilder.listDataExchangesSettings().build(); + listOrgDataExchangesSettings = settingsBuilder.listOrgDataExchangesSettings().build(); + getDataExchangeSettings = settingsBuilder.getDataExchangeSettings().build(); + createDataExchangeSettings = settingsBuilder.createDataExchangeSettings().build(); + updateDataExchangeSettings = settingsBuilder.updateDataExchangeSettings().build(); + deleteDataExchangeSettings = settingsBuilder.deleteDataExchangeSettings().build(); + listListingsSettings = settingsBuilder.listListingsSettings().build(); + getListingSettings = settingsBuilder.getListingSettings().build(); + createListingSettings = settingsBuilder.createListingSettings().build(); + updateListingSettings = settingsBuilder.updateListingSettings().build(); + deleteListingSettings = settingsBuilder.deleteListingSettings().build(); + subscribeListingSettings = settingsBuilder.subscribeListingSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for AnalyticsHubServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListDataExchangesRequest, ListDataExchangesResponse, ListDataExchangesPagedResponse> + listDataExchangesSettings; + private final PagedCallSettings.Builder< + ListOrgDataExchangesRequest, + ListOrgDataExchangesResponse, + ListOrgDataExchangesPagedResponse> + listOrgDataExchangesSettings; + private final UnaryCallSettings.Builder + getDataExchangeSettings; + private final UnaryCallSettings.Builder + createDataExchangeSettings; + private final UnaryCallSettings.Builder + updateDataExchangeSettings; + private final UnaryCallSettings.Builder + deleteDataExchangeSettings; + private final PagedCallSettings.Builder< + ListListingsRequest, ListListingsResponse, ListListingsPagedResponse> + listListingsSettings; + private final UnaryCallSettings.Builder getListingSettings; + private final UnaryCallSettings.Builder createListingSettings; + private final UnaryCallSettings.Builder updateListingSettings; + private final UnaryCallSettings.Builder deleteListingSettings; + private final UnaryCallSettings.Builder + subscribeListingSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listDataExchangesSettings = PagedCallSettings.newBuilder(LIST_DATA_EXCHANGES_PAGE_STR_FACT); + listOrgDataExchangesSettings = + PagedCallSettings.newBuilder(LIST_ORG_DATA_EXCHANGES_PAGE_STR_FACT); + getDataExchangeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createDataExchangeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateDataExchangeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteDataExchangeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listListingsSettings = PagedCallSettings.newBuilder(LIST_LISTINGS_PAGE_STR_FACT); + getListingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createListingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateListingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteListingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + subscribeListingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listDataExchangesSettings, + listOrgDataExchangesSettings, + getDataExchangeSettings, + createDataExchangeSettings, + updateDataExchangeSettings, + deleteDataExchangeSettings, + listListingsSettings, + getListingSettings, + createListingSettings, + updateListingSettings, + deleteListingSettings, + subscribeListingSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(AnalyticsHubServiceStubSettings settings) { + super(settings); + + listDataExchangesSettings = settings.listDataExchangesSettings.toBuilder(); + listOrgDataExchangesSettings = settings.listOrgDataExchangesSettings.toBuilder(); + getDataExchangeSettings = settings.getDataExchangeSettings.toBuilder(); + createDataExchangeSettings = settings.createDataExchangeSettings.toBuilder(); + updateDataExchangeSettings = settings.updateDataExchangeSettings.toBuilder(); + deleteDataExchangeSettings = settings.deleteDataExchangeSettings.toBuilder(); + listListingsSettings = settings.listListingsSettings.toBuilder(); + getListingSettings = settings.getListingSettings.toBuilder(); + createListingSettings = settings.createListingSettings.toBuilder(); + updateListingSettings = settings.updateListingSettings.toBuilder(); + deleteListingSettings = settings.deleteListingSettings.toBuilder(); + subscribeListingSettings = settings.subscribeListingSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listDataExchangesSettings, + listOrgDataExchangesSettings, + getDataExchangeSettings, + createDataExchangeSettings, + updateDataExchangeSettings, + deleteDataExchangeSettings, + listListingsSettings, + getListingSettings, + createListingSettings, + updateListingSettings, + deleteListingSettings, + subscribeListingSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listDataExchangesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listOrgDataExchangesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getDataExchangeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createDataExchangeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateDataExchangeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteDataExchangeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listListingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getListingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createListingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateListingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteListingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .subscribeListingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listDataExchanges. */ + public PagedCallSettings.Builder< + ListDataExchangesRequest, ListDataExchangesResponse, ListDataExchangesPagedResponse> + listDataExchangesSettings() { + return listDataExchangesSettings; + } + + /** Returns the builder for the settings used for calls to listOrgDataExchanges. */ + public PagedCallSettings.Builder< + ListOrgDataExchangesRequest, + ListOrgDataExchangesResponse, + ListOrgDataExchangesPagedResponse> + listOrgDataExchangesSettings() { + return listOrgDataExchangesSettings; + } + + /** Returns the builder for the settings used for calls to getDataExchange. */ + public UnaryCallSettings.Builder + getDataExchangeSettings() { + return getDataExchangeSettings; + } + + /** Returns the builder for the settings used for calls to createDataExchange. */ + public UnaryCallSettings.Builder + createDataExchangeSettings() { + return createDataExchangeSettings; + } + + /** Returns the builder for the settings used for calls to updateDataExchange. */ + public UnaryCallSettings.Builder + updateDataExchangeSettings() { + return updateDataExchangeSettings; + } + + /** Returns the builder for the settings used for calls to deleteDataExchange. */ + public UnaryCallSettings.Builder + deleteDataExchangeSettings() { + return deleteDataExchangeSettings; + } + + /** Returns the builder for the settings used for calls to listListings. */ + public PagedCallSettings.Builder< + ListListingsRequest, ListListingsResponse, ListListingsPagedResponse> + listListingsSettings() { + return listListingsSettings; + } + + /** Returns the builder for the settings used for calls to getListing. */ + public UnaryCallSettings.Builder getListingSettings() { + return getListingSettings; + } + + /** Returns the builder for the settings used for calls to createListing. */ + public UnaryCallSettings.Builder createListingSettings() { + return createListingSettings; + } + + /** Returns the builder for the settings used for calls to updateListing. */ + public UnaryCallSettings.Builder updateListingSettings() { + return updateListingSettings; + } + + /** Returns the builder for the settings used for calls to deleteListing. */ + public UnaryCallSettings.Builder deleteListingSettings() { + return deleteListingSettings; + } + + /** Returns the builder for the settings used for calls to subscribeListing. */ + public UnaryCallSettings.Builder + subscribeListingSettings() { + return subscribeListingSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public AnalyticsHubServiceStubSettings build() throws IOException { + return new AnalyticsHubServiceStubSettings(this); + } + } +} diff --git a/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/GrpcAnalyticsHubServiceCallableFactory.java b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/GrpcAnalyticsHubServiceCallableFactory.java new file mode 100644 index 000000000000..4db10ed31e2e --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/GrpcAnalyticsHubServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the AnalyticsHubService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcAnalyticsHubServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/GrpcAnalyticsHubServiceStub.java b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/GrpcAnalyticsHubServiceStub.java new file mode 100644 index 000000000000..b859f750b697 --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/GrpcAnalyticsHubServiceStub.java @@ -0,0 +1,665 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1.stub; + +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListDataExchangesPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListListingsPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.DataExchange; +import com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.GetListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse; +import com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse; +import com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse; +import com.google.cloud.bigquery.analyticshub.v1.Listing; +import com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse; +import com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the AnalyticsHubService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcAnalyticsHubServiceStub extends AnalyticsHubServiceStub { + private static final MethodDescriptor + listDataExchangesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ListDataExchanges") + .setRequestMarshaller( + ProtoUtils.marshaller(ListDataExchangesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListDataExchangesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listOrgDataExchangesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ListOrgDataExchanges") + .setRequestMarshaller( + ProtoUtils.marshaller(ListOrgDataExchangesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListOrgDataExchangesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getDataExchangeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/GetDataExchange") + .setRequestMarshaller( + ProtoUtils.marshaller(GetDataExchangeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(DataExchange.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createDataExchangeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/CreateDataExchange") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateDataExchangeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(DataExchange.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateDataExchangeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/UpdateDataExchange") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateDataExchangeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(DataExchange.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteDataExchangeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/DeleteDataExchange") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDataExchangeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listListingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ListListings") + .setRequestMarshaller(ProtoUtils.marshaller(ListListingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListListingsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getListingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/GetListing") + .setRequestMarshaller(ProtoUtils.marshaller(GetListingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Listing.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createListingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/CreateListing") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateListingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Listing.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateListingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/UpdateListing") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateListingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Listing.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteListingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/DeleteListing") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteListingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + subscribeListingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/SubscribeListing") + .setRequestMarshaller( + ProtoUtils.marshaller(SubscribeListingRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SubscribeListingResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable + listDataExchangesCallable; + private final UnaryCallable + listDataExchangesPagedCallable; + private final UnaryCallable + listOrgDataExchangesCallable; + private final UnaryCallable + listOrgDataExchangesPagedCallable; + private final UnaryCallable getDataExchangeCallable; + private final UnaryCallable createDataExchangeCallable; + private final UnaryCallable updateDataExchangeCallable; + private final UnaryCallable deleteDataExchangeCallable; + private final UnaryCallable listListingsCallable; + private final UnaryCallable + listListingsPagedCallable; + private final UnaryCallable getListingCallable; + private final UnaryCallable createListingCallable; + private final UnaryCallable updateListingCallable; + private final UnaryCallable deleteListingCallable; + private final UnaryCallable + subscribeListingCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAnalyticsHubServiceStub create(AnalyticsHubServiceStubSettings settings) + throws IOException { + return new GrpcAnalyticsHubServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAnalyticsHubServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcAnalyticsHubServiceStub( + AnalyticsHubServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAnalyticsHubServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAnalyticsHubServiceStub( + AnalyticsHubServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAnalyticsHubServiceStub, 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 GrpcAnalyticsHubServiceStub( + AnalyticsHubServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcAnalyticsHubServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcAnalyticsHubServiceStub, 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 GrpcAnalyticsHubServiceStub( + AnalyticsHubServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listDataExchangesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDataExchangesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + listOrgDataExchangesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listOrgDataExchangesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("organization", String.valueOf(request.getOrganization())); + return params.build(); + }) + .build(); + GrpcCallSettings getDataExchangeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDataExchangeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createDataExchangeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createDataExchangeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateDataExchangeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateDataExchangeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "data_exchange.name", String.valueOf(request.getDataExchange().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteDataExchangeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDataExchangeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listListingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listListingsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getListingTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getListingMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createListingTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createListingMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateListingTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateListingMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("listing.name", String.valueOf(request.getListing().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteListingTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteListingMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + subscribeListingTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(subscribeListingMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + + this.listDataExchangesCallable = + callableFactory.createUnaryCallable( + listDataExchangesTransportSettings, + settings.listDataExchangesSettings(), + clientContext); + this.listDataExchangesPagedCallable = + callableFactory.createPagedCallable( + listDataExchangesTransportSettings, + settings.listDataExchangesSettings(), + clientContext); + this.listOrgDataExchangesCallable = + callableFactory.createUnaryCallable( + listOrgDataExchangesTransportSettings, + settings.listOrgDataExchangesSettings(), + clientContext); + this.listOrgDataExchangesPagedCallable = + callableFactory.createPagedCallable( + listOrgDataExchangesTransportSettings, + settings.listOrgDataExchangesSettings(), + clientContext); + this.getDataExchangeCallable = + callableFactory.createUnaryCallable( + getDataExchangeTransportSettings, settings.getDataExchangeSettings(), clientContext); + this.createDataExchangeCallable = + callableFactory.createUnaryCallable( + createDataExchangeTransportSettings, + settings.createDataExchangeSettings(), + clientContext); + this.updateDataExchangeCallable = + callableFactory.createUnaryCallable( + updateDataExchangeTransportSettings, + settings.updateDataExchangeSettings(), + clientContext); + this.deleteDataExchangeCallable = + callableFactory.createUnaryCallable( + deleteDataExchangeTransportSettings, + settings.deleteDataExchangeSettings(), + clientContext); + this.listListingsCallable = + callableFactory.createUnaryCallable( + listListingsTransportSettings, settings.listListingsSettings(), clientContext); + this.listListingsPagedCallable = + callableFactory.createPagedCallable( + listListingsTransportSettings, settings.listListingsSettings(), clientContext); + this.getListingCallable = + callableFactory.createUnaryCallable( + getListingTransportSettings, settings.getListingSettings(), clientContext); + this.createListingCallable = + callableFactory.createUnaryCallable( + createListingTransportSettings, settings.createListingSettings(), clientContext); + this.updateListingCallable = + callableFactory.createUnaryCallable( + updateListingTransportSettings, settings.updateListingSettings(), clientContext); + this.deleteListingCallable = + callableFactory.createUnaryCallable( + deleteListingTransportSettings, settings.deleteListingSettings(), clientContext); + this.subscribeListingCallable = + callableFactory.createUnaryCallable( + subscribeListingTransportSettings, settings.subscribeListingSettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + listDataExchangesCallable() { + return listDataExchangesCallable; + } + + @Override + public UnaryCallable + listDataExchangesPagedCallable() { + return listDataExchangesPagedCallable; + } + + @Override + public UnaryCallable + listOrgDataExchangesCallable() { + return listOrgDataExchangesCallable; + } + + @Override + public UnaryCallable + listOrgDataExchangesPagedCallable() { + return listOrgDataExchangesPagedCallable; + } + + @Override + public UnaryCallable getDataExchangeCallable() { + return getDataExchangeCallable; + } + + @Override + public UnaryCallable createDataExchangeCallable() { + return createDataExchangeCallable; + } + + @Override + public UnaryCallable updateDataExchangeCallable() { + return updateDataExchangeCallable; + } + + @Override + public UnaryCallable deleteDataExchangeCallable() { + return deleteDataExchangeCallable; + } + + @Override + public UnaryCallable listListingsCallable() { + return listListingsCallable; + } + + @Override + public UnaryCallable listListingsPagedCallable() { + return listListingsPagedCallable; + } + + @Override + public UnaryCallable getListingCallable() { + return getListingCallable; + } + + @Override + public UnaryCallable createListingCallable() { + return createListingCallable; + } + + @Override + public UnaryCallable updateListingCallable() { + return updateListingCallable; + } + + @Override + public UnaryCallable deleteListingCallable() { + return deleteListingCallable; + } + + @Override + public UnaryCallable + subscribeListingCallable() { + return subscribeListingCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/HttpJsonAnalyticsHubServiceCallableFactory.java b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/HttpJsonAnalyticsHubServiceCallableFactory.java new file mode 100644 index 000000000000..6742540810fa --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/HttpJsonAnalyticsHubServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the AnalyticsHubService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonAnalyticsHubServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/HttpJsonAnalyticsHubServiceStub.java b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/HttpJsonAnalyticsHubServiceStub.java new file mode 100644 index 000000000000..860912baac98 --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/main/java/com/google/cloud/bigquery/analyticshub/v1/stub/HttpJsonAnalyticsHubServiceStub.java @@ -0,0 +1,1013 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1.stub; + +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListDataExchangesPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListListingsPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.DataExchange; +import com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.GetListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse; +import com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse; +import com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest; +import com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse; +import com.google.cloud.bigquery.analyticshub.v1.Listing; +import com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest; +import com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse; +import com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest; +import com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the AnalyticsHubService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonAnalyticsHubServiceStub extends AnalyticsHubServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listDataExchangesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ListDataExchanges") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/dataExchanges", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListDataExchangesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListOrgDataExchangesRequest, ListOrgDataExchangesResponse> + listOrgDataExchangesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ListOrgDataExchanges") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{organization=organizations/*/locations/*}/dataExchanges", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "organization", request.getOrganization()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListOrgDataExchangesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getDataExchangeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/GetDataExchange") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/dataExchanges/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(DataExchange.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createDataExchangeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/CreateDataExchange") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/dataExchanges", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "dataExchangeId", request.getDataExchangeId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("dataExchange", request.getDataExchange(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(DataExchange.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateDataExchangeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/UpdateDataExchange") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{dataExchange.name=projects/*/locations/*/dataExchanges/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "dataExchange.name", request.getDataExchange().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("dataExchange", request.getDataExchange(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(DataExchange.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteDataExchangeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/DeleteDataExchange") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/dataExchanges/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listListingsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ListListings") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/dataExchanges/*}/listings", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListListingsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getListingMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/GetListing") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.

newBuilder() + .setDefaultInstance(Listing.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createListingMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/CreateListing") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/dataExchanges/*}/listings", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "listingId", request.getListingId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("listing", request.getListing(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Listing.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateListingMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/UpdateListing") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{listing.name=projects/*/locations/*/dataExchanges/*/listings/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "listing.name", request.getListing().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("listing", request.getListing(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Listing.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteListingMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/DeleteListing") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + subscribeListingMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/SubscribeListing") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}:subscribe", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SubscribeListingResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/GetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/dataExchanges/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/dataExchanges/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/dataExchanges/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + listDataExchangesCallable; + private final UnaryCallable + listDataExchangesPagedCallable; + private final UnaryCallable + listOrgDataExchangesCallable; + private final UnaryCallable + listOrgDataExchangesPagedCallable; + private final UnaryCallable getDataExchangeCallable; + private final UnaryCallable createDataExchangeCallable; + private final UnaryCallable updateDataExchangeCallable; + private final UnaryCallable deleteDataExchangeCallable; + private final UnaryCallable listListingsCallable; + private final UnaryCallable + listListingsPagedCallable; + private final UnaryCallable getListingCallable; + private final UnaryCallable createListingCallable; + private final UnaryCallable updateListingCallable; + private final UnaryCallable deleteListingCallable; + private final UnaryCallable + subscribeListingCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAnalyticsHubServiceStub create( + AnalyticsHubServiceStubSettings settings) throws IOException { + return new HttpJsonAnalyticsHubServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAnalyticsHubServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAnalyticsHubServiceStub( + AnalyticsHubServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonAnalyticsHubServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAnalyticsHubServiceStub( + AnalyticsHubServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonAnalyticsHubServiceStub, 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 HttpJsonAnalyticsHubServiceStub( + AnalyticsHubServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonAnalyticsHubServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAnalyticsHubServiceStub, 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 HttpJsonAnalyticsHubServiceStub( + AnalyticsHubServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + listDataExchangesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listDataExchangesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listOrgDataExchangesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listOrgDataExchangesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getDataExchangeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getDataExchangeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createDataExchangeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createDataExchangeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + updateDataExchangeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateDataExchangeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteDataExchangeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteDataExchangeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listListingsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listListingsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getListingTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getListingMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createListingTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createListingMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateListingTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateListingMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteListingTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteListingMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + subscribeListingTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(subscribeListingMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listDataExchangesCallable = + callableFactory.createUnaryCallable( + listDataExchangesTransportSettings, + settings.listDataExchangesSettings(), + clientContext); + this.listDataExchangesPagedCallable = + callableFactory.createPagedCallable( + listDataExchangesTransportSettings, + settings.listDataExchangesSettings(), + clientContext); + this.listOrgDataExchangesCallable = + callableFactory.createUnaryCallable( + listOrgDataExchangesTransportSettings, + settings.listOrgDataExchangesSettings(), + clientContext); + this.listOrgDataExchangesPagedCallable = + callableFactory.createPagedCallable( + listOrgDataExchangesTransportSettings, + settings.listOrgDataExchangesSettings(), + clientContext); + this.getDataExchangeCallable = + callableFactory.createUnaryCallable( + getDataExchangeTransportSettings, settings.getDataExchangeSettings(), clientContext); + this.createDataExchangeCallable = + callableFactory.createUnaryCallable( + createDataExchangeTransportSettings, + settings.createDataExchangeSettings(), + clientContext); + this.updateDataExchangeCallable = + callableFactory.createUnaryCallable( + updateDataExchangeTransportSettings, + settings.updateDataExchangeSettings(), + clientContext); + this.deleteDataExchangeCallable = + callableFactory.createUnaryCallable( + deleteDataExchangeTransportSettings, + settings.deleteDataExchangeSettings(), + clientContext); + this.listListingsCallable = + callableFactory.createUnaryCallable( + listListingsTransportSettings, settings.listListingsSettings(), clientContext); + this.listListingsPagedCallable = + callableFactory.createPagedCallable( + listListingsTransportSettings, settings.listListingsSettings(), clientContext); + this.getListingCallable = + callableFactory.createUnaryCallable( + getListingTransportSettings, settings.getListingSettings(), clientContext); + this.createListingCallable = + callableFactory.createUnaryCallable( + createListingTransportSettings, settings.createListingSettings(), clientContext); + this.updateListingCallable = + callableFactory.createUnaryCallable( + updateListingTransportSettings, settings.updateListingSettings(), clientContext); + this.deleteListingCallable = + callableFactory.createUnaryCallable( + deleteListingTransportSettings, settings.deleteListingSettings(), clientContext); + this.subscribeListingCallable = + callableFactory.createUnaryCallable( + subscribeListingTransportSettings, settings.subscribeListingSettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listDataExchangesMethodDescriptor); + methodDescriptors.add(listOrgDataExchangesMethodDescriptor); + methodDescriptors.add(getDataExchangeMethodDescriptor); + methodDescriptors.add(createDataExchangeMethodDescriptor); + methodDescriptors.add(updateDataExchangeMethodDescriptor); + methodDescriptors.add(deleteDataExchangeMethodDescriptor); + methodDescriptors.add(listListingsMethodDescriptor); + methodDescriptors.add(getListingMethodDescriptor); + methodDescriptors.add(createListingMethodDescriptor); + methodDescriptors.add(updateListingMethodDescriptor); + methodDescriptors.add(deleteListingMethodDescriptor); + methodDescriptors.add(subscribeListingMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + listDataExchangesCallable() { + return listDataExchangesCallable; + } + + @Override + public UnaryCallable + listDataExchangesPagedCallable() { + return listDataExchangesPagedCallable; + } + + @Override + public UnaryCallable + listOrgDataExchangesCallable() { + return listOrgDataExchangesCallable; + } + + @Override + public UnaryCallable + listOrgDataExchangesPagedCallable() { + return listOrgDataExchangesPagedCallable; + } + + @Override + public UnaryCallable getDataExchangeCallable() { + return getDataExchangeCallable; + } + + @Override + public UnaryCallable createDataExchangeCallable() { + return createDataExchangeCallable; + } + + @Override + public UnaryCallable updateDataExchangeCallable() { + return updateDataExchangeCallable; + } + + @Override + public UnaryCallable deleteDataExchangeCallable() { + return deleteDataExchangeCallable; + } + + @Override + public UnaryCallable listListingsCallable() { + return listListingsCallable; + } + + @Override + public UnaryCallable listListingsPagedCallable() { + return listListingsPagedCallable; + } + + @Override + public UnaryCallable getListingCallable() { + return getListingCallable; + } + + @Override + public UnaryCallable createListingCallable() { + return createListingCallable; + } + + @Override + public UnaryCallable updateListingCallable() { + return updateListingCallable; + } + + @Override + public UnaryCallable deleteListingCallable() { + return deleteListingCallable; + } + + @Override + public UnaryCallable + subscribeListingCallable() { + return subscribeListingCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceClientHttpJsonTest.java b/java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..0a0462f1bfd9 --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceClientHttpJsonTest.java @@ -0,0 +1,1342 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1; + +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListDataExchangesPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListListingsPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.bigquery.analyticshub.v1.stub.HttpJsonAnalyticsHubServiceStub; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AnalyticsHubServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static AnalyticsHubServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonAnalyticsHubServiceStub.getMethodDescriptors(), + AnalyticsHubServiceSettings.getDefaultEndpoint()); + AnalyticsHubServiceSettings settings = + AnalyticsHubServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + AnalyticsHubServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AnalyticsHubServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listDataExchangesTest() throws Exception { + DataExchange responsesElement = DataExchange.newBuilder().build(); + ListDataExchangesResponse expectedResponse = + ListDataExchangesResponse.newBuilder() + .setNextPageToken("") + .addAllDataExchanges(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListDataExchangesPagedResponse pagedListResponse = client.listDataExchanges(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDataExchangesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listDataExchangesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listDataExchanges(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDataExchangesTest2() throws Exception { + DataExchange responsesElement = DataExchange.newBuilder().build(); + ListDataExchangesResponse expectedResponse = + ListDataExchangesResponse.newBuilder() + .setNextPageToken("") + .addAllDataExchanges(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListDataExchangesPagedResponse pagedListResponse = client.listDataExchanges(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDataExchangesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listDataExchangesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listDataExchanges(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listOrgDataExchangesTest() throws Exception { + DataExchange responsesElement = DataExchange.newBuilder().build(); + ListOrgDataExchangesResponse expectedResponse = + ListOrgDataExchangesResponse.newBuilder() + .setNextPageToken("") + .addAllDataExchanges(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String organization = "organizations/organization-686/locations/location-686"; + + ListOrgDataExchangesPagedResponse pagedListResponse = client.listOrgDataExchanges(organization); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDataExchangesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listOrgDataExchangesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String organization = "organizations/organization-686/locations/location-686"; + client.listOrgDataExchanges(organization); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDataExchangeTest() throws Exception { + DataExchange expectedResponse = + DataExchange.newBuilder() + .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setListingCount(-1101038700) + .setIcon(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + + DataExchange actualResponse = client.getDataExchange(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDataExchangeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + client.getDataExchange(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDataExchangeTest2() throws Exception { + DataExchange expectedResponse = + DataExchange.newBuilder() + .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setListingCount(-1101038700) + .setIcon(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-1196/locations/location-1196/dataExchanges/dataExchange-1196"; + + DataExchange actualResponse = client.getDataExchange(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDataExchangeExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1196/locations/location-1196/dataExchanges/dataExchange-1196"; + client.getDataExchange(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDataExchangeTest() throws Exception { + DataExchange expectedResponse = + DataExchange.newBuilder() + .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setListingCount(-1101038700) + .setIcon(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + DataExchange dataExchange = DataExchange.newBuilder().build(); + + DataExchange actualResponse = client.createDataExchange(parent, dataExchange); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDataExchangeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + DataExchange dataExchange = DataExchange.newBuilder().build(); + client.createDataExchange(parent, dataExchange); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDataExchangeTest2() throws Exception { + DataExchange expectedResponse = + DataExchange.newBuilder() + .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setListingCount(-1101038700) + .setIcon(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + DataExchange dataExchange = DataExchange.newBuilder().build(); + + DataExchange actualResponse = client.createDataExchange(parent, dataExchange); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDataExchangeExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + DataExchange dataExchange = DataExchange.newBuilder().build(); + client.createDataExchange(parent, dataExchange); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDataExchangeTest() throws Exception { + DataExchange expectedResponse = + DataExchange.newBuilder() + .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setListingCount(-1101038700) + .setIcon(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + DataExchange dataExchange = + DataExchange.newBuilder() + .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setListingCount(-1101038700) + .setIcon(ByteString.EMPTY) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + DataExchange actualResponse = client.updateDataExchange(dataExchange, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateDataExchangeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataExchange dataExchange = + DataExchange.newBuilder() + .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setListingCount(-1101038700) + .setIcon(ByteString.EMPTY) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateDataExchange(dataExchange, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDataExchangeTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + + client.deleteDataExchange(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDataExchangeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + client.deleteDataExchange(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDataExchangeTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-1196/locations/location-1196/dataExchanges/dataExchange-1196"; + + client.deleteDataExchange(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDataExchangeExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1196/locations/location-1196/dataExchanges/dataExchange-1196"; + client.deleteDataExchange(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listListingsTest() throws Exception { + Listing responsesElement = Listing.newBuilder().build(); + ListListingsResponse expectedResponse = + ListListingsResponse.newBuilder() + .setNextPageToken("") + .addAllListings(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + DataExchangeName parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + + ListListingsPagedResponse pagedListResponse = client.listListings(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getListingsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listListingsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataExchangeName parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + client.listListings(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listListingsTest2() throws Exception { + Listing responsesElement = Listing.newBuilder().build(); + ListListingsResponse expectedResponse = + ListListingsResponse.newBuilder() + .setNextPageToken("") + .addAllListings(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-4709/locations/location-4709/dataExchanges/dataExchange-4709"; + + ListListingsPagedResponse pagedListResponse = client.listListings(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getListingsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listListingsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-4709/locations/location-4709/dataExchanges/dataExchange-4709"; + client.listListings(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getListingTest() throws Exception { + Listing expectedResponse = + Listing.newBuilder() + .setName( + ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setIcon(ByteString.EMPTY) + .setDataProvider(DataProvider.newBuilder().build()) + .addAllCategories(new ArrayList()) + .setPublisher(Publisher.newBuilder().build()) + .setRequestAccess("requestAccess871967955") + .build(); + mockService.addResponse(expectedResponse); + + ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]"); + + Listing actualResponse = client.getListing(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getListingExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]"); + client.getListing(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getListingTest2() throws Exception { + Listing expectedResponse = + Listing.newBuilder() + .setName( + ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setIcon(ByteString.EMPTY) + .setDataProvider(DataProvider.newBuilder().build()) + .addAllCategories(new ArrayList()) + .setPublisher(Publisher.newBuilder().build()) + .setRequestAccess("requestAccess871967955") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-9891/locations/location-9891/dataExchanges/dataExchange-9891/listings/listing-9891"; + + Listing actualResponse = client.getListing(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getListingExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-9891/locations/location-9891/dataExchanges/dataExchange-9891/listings/listing-9891"; + client.getListing(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createListingTest() throws Exception { + Listing expectedResponse = + Listing.newBuilder() + .setName( + ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setIcon(ByteString.EMPTY) + .setDataProvider(DataProvider.newBuilder().build()) + .addAllCategories(new ArrayList()) + .setPublisher(Publisher.newBuilder().build()) + .setRequestAccess("requestAccess871967955") + .build(); + mockService.addResponse(expectedResponse); + + DataExchangeName parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + Listing listing = Listing.newBuilder().build(); + + Listing actualResponse = client.createListing(parent, listing); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createListingExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataExchangeName parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + Listing listing = Listing.newBuilder().build(); + client.createListing(parent, listing); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createListingTest2() throws Exception { + Listing expectedResponse = + Listing.newBuilder() + .setName( + ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setIcon(ByteString.EMPTY) + .setDataProvider(DataProvider.newBuilder().build()) + .addAllCategories(new ArrayList()) + .setPublisher(Publisher.newBuilder().build()) + .setRequestAccess("requestAccess871967955") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-4709/locations/location-4709/dataExchanges/dataExchange-4709"; + Listing listing = Listing.newBuilder().build(); + + Listing actualResponse = client.createListing(parent, listing); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createListingExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-4709/locations/location-4709/dataExchanges/dataExchange-4709"; + Listing listing = Listing.newBuilder().build(); + client.createListing(parent, listing); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateListingTest() throws Exception { + Listing expectedResponse = + Listing.newBuilder() + .setName( + ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setIcon(ByteString.EMPTY) + .setDataProvider(DataProvider.newBuilder().build()) + .addAllCategories(new ArrayList()) + .setPublisher(Publisher.newBuilder().build()) + .setRequestAccess("requestAccess871967955") + .build(); + mockService.addResponse(expectedResponse); + + Listing listing = + Listing.newBuilder() + .setName( + ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setIcon(ByteString.EMPTY) + .setDataProvider(DataProvider.newBuilder().build()) + .addAllCategories(new ArrayList()) + .setPublisher(Publisher.newBuilder().build()) + .setRequestAccess("requestAccess871967955") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Listing actualResponse = client.updateListing(listing, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateListingExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Listing listing = + Listing.newBuilder() + .setName( + ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setIcon(ByteString.EMPTY) + .setDataProvider(DataProvider.newBuilder().build()) + .addAllCategories(new ArrayList()) + .setPublisher(Publisher.newBuilder().build()) + .setRequestAccess("requestAccess871967955") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateListing(listing, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteListingTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]"); + + client.deleteListing(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteListingExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]"); + client.deleteListing(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteListingTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-9891/locations/location-9891/dataExchanges/dataExchange-9891/listings/listing-9891"; + + client.deleteListing(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteListingExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-9891/locations/location-9891/dataExchanges/dataExchange-9891/listings/listing-9891"; + client.deleteListing(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void subscribeListingTest() throws Exception { + SubscribeListingResponse expectedResponse = SubscribeListingResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]"); + + SubscribeListingResponse actualResponse = client.subscribeListing(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void subscribeListingExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]"); + client.subscribeListing(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void subscribeListingTest2() throws Exception { + SubscribeListingResponse expectedResponse = SubscribeListingResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-9891/locations/location-9891/dataExchanges/dataExchange-9891/listings/listing-9891"; + + SubscribeListingResponse actualResponse = client.subscribeListing(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void subscribeListingExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-9891/locations/location-9891/dataExchanges/dataExchange-9891/listings/listing-9891"; + client.subscribeListing(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceClientTest.java b/java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceClientTest.java new file mode 100644 index 000000000000..0ad602758523 --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceClientTest.java @@ -0,0 +1,1158 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1; + +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListDataExchangesPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListListingsPagedResponse; +import static com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse; + +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.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.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 AnalyticsHubServiceClientTest { + private static MockAnalyticsHubService mockAnalyticsHubService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private AnalyticsHubServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockAnalyticsHubService = new MockAnalyticsHubService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockAnalyticsHubService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AnalyticsHubServiceSettings settings = + AnalyticsHubServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AnalyticsHubServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listDataExchangesTest() throws Exception { + DataExchange responsesElement = DataExchange.newBuilder().build(); + ListDataExchangesResponse expectedResponse = + ListDataExchangesResponse.newBuilder() + .setNextPageToken("") + .addAllDataExchanges(Arrays.asList(responsesElement)) + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListDataExchangesPagedResponse pagedListResponse = client.listDataExchanges(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDataExchangesList().get(0), resources.get(0)); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDataExchangesRequest actualRequest = ((ListDataExchangesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDataExchangesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listDataExchanges(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDataExchangesTest2() throws Exception { + DataExchange responsesElement = DataExchange.newBuilder().build(); + ListDataExchangesResponse expectedResponse = + ListDataExchangesResponse.newBuilder() + .setNextPageToken("") + .addAllDataExchanges(Arrays.asList(responsesElement)) + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListDataExchangesPagedResponse pagedListResponse = client.listDataExchanges(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDataExchangesList().get(0), resources.get(0)); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDataExchangesRequest actualRequest = ((ListDataExchangesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDataExchangesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listDataExchanges(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listOrgDataExchangesTest() throws Exception { + DataExchange responsesElement = DataExchange.newBuilder().build(); + ListOrgDataExchangesResponse expectedResponse = + ListOrgDataExchangesResponse.newBuilder() + .setNextPageToken("") + .addAllDataExchanges(Arrays.asList(responsesElement)) + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + String organization = "organization1178922291"; + + ListOrgDataExchangesPagedResponse pagedListResponse = client.listOrgDataExchanges(organization); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDataExchangesList().get(0), resources.get(0)); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListOrgDataExchangesRequest actualRequest = + ((ListOrgDataExchangesRequest) actualRequests.get(0)); + + Assert.assertEquals(organization, actualRequest.getOrganization()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listOrgDataExchangesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + String organization = "organization1178922291"; + client.listOrgDataExchanges(organization); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDataExchangeTest() throws Exception { + DataExchange expectedResponse = + DataExchange.newBuilder() + .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setListingCount(-1101038700) + .setIcon(ByteString.EMPTY) + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + + DataExchange actualResponse = client.getDataExchange(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDataExchangeRequest actualRequest = ((GetDataExchangeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDataExchangeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + client.getDataExchange(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDataExchangeTest2() throws Exception { + DataExchange expectedResponse = + DataExchange.newBuilder() + .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setListingCount(-1101038700) + .setIcon(ByteString.EMPTY) + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + String name = "name3373707"; + + DataExchange actualResponse = client.getDataExchange(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDataExchangeRequest actualRequest = ((GetDataExchangeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDataExchangeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + String name = "name3373707"; + client.getDataExchange(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDataExchangeTest() throws Exception { + DataExchange expectedResponse = + DataExchange.newBuilder() + .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setListingCount(-1101038700) + .setIcon(ByteString.EMPTY) + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + DataExchange dataExchange = DataExchange.newBuilder().build(); + + DataExchange actualResponse = client.createDataExchange(parent, dataExchange); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDataExchangeRequest actualRequest = ((CreateDataExchangeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(dataExchange, actualRequest.getDataExchange()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDataExchangeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + DataExchange dataExchange = DataExchange.newBuilder().build(); + client.createDataExchange(parent, dataExchange); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDataExchangeTest2() throws Exception { + DataExchange expectedResponse = + DataExchange.newBuilder() + .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setListingCount(-1101038700) + .setIcon(ByteString.EMPTY) + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + DataExchange dataExchange = DataExchange.newBuilder().build(); + + DataExchange actualResponse = client.createDataExchange(parent, dataExchange); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDataExchangeRequest actualRequest = ((CreateDataExchangeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(dataExchange, actualRequest.getDataExchange()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDataExchangeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + String parent = "parent-995424086"; + DataExchange dataExchange = DataExchange.newBuilder().build(); + client.createDataExchange(parent, dataExchange); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDataExchangeTest() throws Exception { + DataExchange expectedResponse = + DataExchange.newBuilder() + .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setListingCount(-1101038700) + .setIcon(ByteString.EMPTY) + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + DataExchange dataExchange = DataExchange.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + DataExchange actualResponse = client.updateDataExchange(dataExchange, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateDataExchangeRequest actualRequest = ((UpdateDataExchangeRequest) actualRequests.get(0)); + + Assert.assertEquals(dataExchange, actualRequest.getDataExchange()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateDataExchangeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + DataExchange dataExchange = DataExchange.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateDataExchange(dataExchange, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDataExchangeTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + + client.deleteDataExchange(name); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDataExchangeRequest actualRequest = ((DeleteDataExchangeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDataExchangeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + client.deleteDataExchange(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDataExchangeTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteDataExchange(name); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDataExchangeRequest actualRequest = ((DeleteDataExchangeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDataExchangeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + String name = "name3373707"; + client.deleteDataExchange(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listListingsTest() throws Exception { + Listing responsesElement = Listing.newBuilder().build(); + ListListingsResponse expectedResponse = + ListListingsResponse.newBuilder() + .setNextPageToken("") + .addAllListings(Arrays.asList(responsesElement)) + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + DataExchangeName parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + + ListListingsPagedResponse pagedListResponse = client.listListings(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getListingsList().get(0), resources.get(0)); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListListingsRequest actualRequest = ((ListListingsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listListingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + DataExchangeName parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + client.listListings(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listListingsTest2() throws Exception { + Listing responsesElement = Listing.newBuilder().build(); + ListListingsResponse expectedResponse = + ListListingsResponse.newBuilder() + .setNextPageToken("") + .addAllListings(Arrays.asList(responsesElement)) + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListListingsPagedResponse pagedListResponse = client.listListings(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getListingsList().get(0), resources.get(0)); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListListingsRequest actualRequest = ((ListListingsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listListingsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listListings(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getListingTest() throws Exception { + Listing expectedResponse = + Listing.newBuilder() + .setName( + ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setIcon(ByteString.EMPTY) + .setDataProvider(DataProvider.newBuilder().build()) + .addAllCategories(new ArrayList()) + .setPublisher(Publisher.newBuilder().build()) + .setRequestAccess("requestAccess871967955") + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]"); + + Listing actualResponse = client.getListing(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetListingRequest actualRequest = ((GetListingRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getListingExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]"); + client.getListing(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getListingTest2() throws Exception { + Listing expectedResponse = + Listing.newBuilder() + .setName( + ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setIcon(ByteString.EMPTY) + .setDataProvider(DataProvider.newBuilder().build()) + .addAllCategories(new ArrayList()) + .setPublisher(Publisher.newBuilder().build()) + .setRequestAccess("requestAccess871967955") + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + String name = "name3373707"; + + Listing actualResponse = client.getListing(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetListingRequest actualRequest = ((GetListingRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getListingExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + String name = "name3373707"; + client.getListing(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createListingTest() throws Exception { + Listing expectedResponse = + Listing.newBuilder() + .setName( + ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setIcon(ByteString.EMPTY) + .setDataProvider(DataProvider.newBuilder().build()) + .addAllCategories(new ArrayList()) + .setPublisher(Publisher.newBuilder().build()) + .setRequestAccess("requestAccess871967955") + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + DataExchangeName parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + Listing listing = Listing.newBuilder().build(); + + Listing actualResponse = client.createListing(parent, listing); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateListingRequest actualRequest = ((CreateListingRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(listing, actualRequest.getListing()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createListingExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + DataExchangeName parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"); + Listing listing = Listing.newBuilder().build(); + client.createListing(parent, listing); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createListingTest2() throws Exception { + Listing expectedResponse = + Listing.newBuilder() + .setName( + ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setIcon(ByteString.EMPTY) + .setDataProvider(DataProvider.newBuilder().build()) + .addAllCategories(new ArrayList()) + .setPublisher(Publisher.newBuilder().build()) + .setRequestAccess("requestAccess871967955") + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Listing listing = Listing.newBuilder().build(); + + Listing actualResponse = client.createListing(parent, listing); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateListingRequest actualRequest = ((CreateListingRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(listing, actualRequest.getListing()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createListingExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + String parent = "parent-995424086"; + Listing listing = Listing.newBuilder().build(); + client.createListing(parent, listing); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateListingTest() throws Exception { + Listing expectedResponse = + Listing.newBuilder() + .setName( + ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setPrimaryContact("primaryContact-532068418") + .setDocumentation("documentation1587405498") + .setIcon(ByteString.EMPTY) + .setDataProvider(DataProvider.newBuilder().build()) + .addAllCategories(new ArrayList()) + .setPublisher(Publisher.newBuilder().build()) + .setRequestAccess("requestAccess871967955") + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + Listing listing = Listing.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Listing actualResponse = client.updateListing(listing, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateListingRequest actualRequest = ((UpdateListingRequest) actualRequests.get(0)); + + Assert.assertEquals(listing, actualRequest.getListing()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateListingExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + Listing listing = Listing.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateListing(listing, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteListingTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]"); + + client.deleteListing(name); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteListingRequest actualRequest = ((DeleteListingRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteListingExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]"); + client.deleteListing(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteListingTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteListing(name); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteListingRequest actualRequest = ((DeleteListingRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteListingExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + String name = "name3373707"; + client.deleteListing(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void subscribeListingTest() throws Exception { + SubscribeListingResponse expectedResponse = SubscribeListingResponse.newBuilder().build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]"); + + SubscribeListingResponse actualResponse = client.subscribeListing(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SubscribeListingRequest actualRequest = ((SubscribeListingRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void subscribeListingExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]"); + client.subscribeListing(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void subscribeListingTest2() throws Exception { + SubscribeListingResponse expectedResponse = SubscribeListingResponse.newBuilder().build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + String name = "name3373707"; + + SubscribeListingResponse actualResponse = client.subscribeListing(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SubscribeListingRequest actualRequest = ((SubscribeListingRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void subscribeListingExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + String name = "name3373707"; + client.subscribeListing(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockAnalyticsHubService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsHubService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/MockAnalyticsHubService.java b/java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/MockAnalyticsHubService.java new file mode 100644 index 000000000000..2f5e4997691b --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/MockAnalyticsHubService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAnalyticsHubService implements MockGrpcService { + private final MockAnalyticsHubServiceImpl serviceImpl; + + public MockAnalyticsHubService() { + serviceImpl = new MockAnalyticsHubServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/MockAnalyticsHubServiceImpl.java b/java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/MockAnalyticsHubServiceImpl.java new file mode 100644 index 000000000000..8696b8ddc63f --- /dev/null +++ b/java-analyticshub/google-cloud-analyticshub/src/test/java/com/google/cloud/bigquery/analyticshub/v1/MockAnalyticsHubServiceImpl.java @@ -0,0 +1,380 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubServiceGrpc.AnalyticsHubServiceImplBase; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAnalyticsHubServiceImpl extends AnalyticsHubServiceImplBase { + private List requests; + private Queue responses; + + public MockAnalyticsHubServiceImpl() { + 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 listDataExchanges( + ListDataExchangesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListDataExchangesResponse) { + requests.add(request); + responseObserver.onNext(((ListDataExchangesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListDataExchanges, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListDataExchangesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listOrgDataExchanges( + ListOrgDataExchangesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListOrgDataExchangesResponse) { + requests.add(request); + responseObserver.onNext(((ListOrgDataExchangesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListOrgDataExchanges, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListOrgDataExchangesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getDataExchange( + GetDataExchangeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DataExchange) { + requests.add(request); + responseObserver.onNext(((DataExchange) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetDataExchange, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DataExchange.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createDataExchange( + CreateDataExchangeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DataExchange) { + requests.add(request); + responseObserver.onNext(((DataExchange) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateDataExchange, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DataExchange.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateDataExchange( + UpdateDataExchangeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DataExchange) { + requests.add(request); + responseObserver.onNext(((DataExchange) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateDataExchange, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DataExchange.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteDataExchange( + DeleteDataExchangeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteDataExchange, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listListings( + ListListingsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListListingsResponse) { + requests.add(request); + responseObserver.onNext(((ListListingsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListListings, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListListingsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getListing(GetListingRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Listing) { + requests.add(request); + responseObserver.onNext(((Listing) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetListing, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Listing.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createListing( + CreateListingRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Listing) { + requests.add(request); + responseObserver.onNext(((Listing) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateListing, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Listing.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateListing( + UpdateListingRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Listing) { + requests.add(request); + responseObserver.onNext(((Listing) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateListing, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Listing.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteListing(DeleteListingRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteListing, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void subscribeListing( + SubscribeListingRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SubscribeListingResponse) { + requests.add(request); + responseObserver.onNext(((SubscribeListingResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SubscribeListing, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SubscribeListingResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-analyticshub/grpc-google-cloud-analyticshub-v1/pom.xml b/java-analyticshub/grpc-google-cloud-analyticshub-v1/pom.xml new file mode 100644 index 000000000000..d5645ae7170e --- /dev/null +++ b/java-analyticshub/grpc-google-cloud-analyticshub-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-analyticshub-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-analyticshub-v1 + GRPC library for google-cloud-analyticshub + + com.google.cloud + google-cloud-analyticshub-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-analyticshub-v1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/java-analyticshub/grpc-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceGrpc.java b/java-analyticshub/grpc-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceGrpc.java new file mode 100644 index 000000000000..34b7294f7bf4 --- /dev/null +++ b/java-analyticshub/grpc-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubServiceGrpc.java @@ -0,0 +1,2087 @@ +/* + * 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.bigquery.analyticshub.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * The `AnalyticsHubService` API facilitates data sharing within and across
+ * organizations. It allows data providers to publish listings that reference
+ * shared datasets. With Analytics Hub, users can discover and search for
+ * listings that they have access to. Subscribers can view and subscribe to
+ * listings. When you subscribe to a listing, Analytics Hub creates a linked
+ * dataset in your project.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class AnalyticsHubServiceGrpc { + + private AnalyticsHubServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest, + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse> + getListDataExchangesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListDataExchanges", + requestType = com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest.class, + responseType = com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest, + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse> + getListDataExchangesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest, + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse> + getListDataExchangesMethod; + if ((getListDataExchangesMethod = AnalyticsHubServiceGrpc.getListDataExchangesMethod) == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getListDataExchangesMethod = AnalyticsHubServiceGrpc.getListDataExchangesMethod) + == null) { + AnalyticsHubServiceGrpc.getListDataExchangesMethod = + getListDataExchangesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListDataExchanges")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("ListDataExchanges")) + .build(); + } + } + } + return getListDataExchangesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest, + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse> + getListOrgDataExchangesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListOrgDataExchanges", + requestType = com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest.class, + responseType = com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest, + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse> + getListOrgDataExchangesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest, + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse> + getListOrgDataExchangesMethod; + if ((getListOrgDataExchangesMethod = AnalyticsHubServiceGrpc.getListOrgDataExchangesMethod) + == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getListOrgDataExchangesMethod = AnalyticsHubServiceGrpc.getListOrgDataExchangesMethod) + == null) { + AnalyticsHubServiceGrpc.getListOrgDataExchangesMethod = + getListOrgDataExchangesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListOrgDataExchanges")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("ListOrgDataExchanges")) + .build(); + } + } + } + return getListOrgDataExchangesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest, + com.google.cloud.bigquery.analyticshub.v1.DataExchange> + getGetDataExchangeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDataExchange", + requestType = com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest.class, + responseType = com.google.cloud.bigquery.analyticshub.v1.DataExchange.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest, + com.google.cloud.bigquery.analyticshub.v1.DataExchange> + getGetDataExchangeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest, + com.google.cloud.bigquery.analyticshub.v1.DataExchange> + getGetDataExchangeMethod; + if ((getGetDataExchangeMethod = AnalyticsHubServiceGrpc.getGetDataExchangeMethod) == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getGetDataExchangeMethod = AnalyticsHubServiceGrpc.getGetDataExchangeMethod) == null) { + AnalyticsHubServiceGrpc.getGetDataExchangeMethod = + getGetDataExchangeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDataExchange")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.DataExchange + .getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("GetDataExchange")) + .build(); + } + } + } + return getGetDataExchangeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest, + com.google.cloud.bigquery.analyticshub.v1.DataExchange> + getCreateDataExchangeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateDataExchange", + requestType = com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest.class, + responseType = com.google.cloud.bigquery.analyticshub.v1.DataExchange.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest, + com.google.cloud.bigquery.analyticshub.v1.DataExchange> + getCreateDataExchangeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest, + com.google.cloud.bigquery.analyticshub.v1.DataExchange> + getCreateDataExchangeMethod; + if ((getCreateDataExchangeMethod = AnalyticsHubServiceGrpc.getCreateDataExchangeMethod) + == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getCreateDataExchangeMethod = AnalyticsHubServiceGrpc.getCreateDataExchangeMethod) + == null) { + AnalyticsHubServiceGrpc.getCreateDataExchangeMethod = + getCreateDataExchangeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateDataExchange")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.DataExchange + .getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("CreateDataExchange")) + .build(); + } + } + } + return getCreateDataExchangeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest, + com.google.cloud.bigquery.analyticshub.v1.DataExchange> + getUpdateDataExchangeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateDataExchange", + requestType = com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest.class, + responseType = com.google.cloud.bigquery.analyticshub.v1.DataExchange.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest, + com.google.cloud.bigquery.analyticshub.v1.DataExchange> + getUpdateDataExchangeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest, + com.google.cloud.bigquery.analyticshub.v1.DataExchange> + getUpdateDataExchangeMethod; + if ((getUpdateDataExchangeMethod = AnalyticsHubServiceGrpc.getUpdateDataExchangeMethod) + == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getUpdateDataExchangeMethod = AnalyticsHubServiceGrpc.getUpdateDataExchangeMethod) + == null) { + AnalyticsHubServiceGrpc.getUpdateDataExchangeMethod = + getUpdateDataExchangeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateDataExchange")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.DataExchange + .getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("UpdateDataExchange")) + .build(); + } + } + } + return getUpdateDataExchangeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest, + com.google.protobuf.Empty> + getDeleteDataExchangeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteDataExchange", + requestType = com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest, + com.google.protobuf.Empty> + getDeleteDataExchangeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest, + com.google.protobuf.Empty> + getDeleteDataExchangeMethod; + if ((getDeleteDataExchangeMethod = AnalyticsHubServiceGrpc.getDeleteDataExchangeMethod) + == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getDeleteDataExchangeMethod = AnalyticsHubServiceGrpc.getDeleteDataExchangeMethod) + == null) { + AnalyticsHubServiceGrpc.getDeleteDataExchangeMethod = + getDeleteDataExchangeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteDataExchange")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("DeleteDataExchange")) + .build(); + } + } + } + return getDeleteDataExchangeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest, + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse> + getListListingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListListings", + requestType = com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest.class, + responseType = com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest, + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse> + getListListingsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest, + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse> + getListListingsMethod; + if ((getListListingsMethod = AnalyticsHubServiceGrpc.getListListingsMethod) == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getListListingsMethod = AnalyticsHubServiceGrpc.getListListingsMethod) == null) { + AnalyticsHubServiceGrpc.getListListingsMethod = + getListListingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListListings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("ListListings")) + .build(); + } + } + } + return getListListingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest, + com.google.cloud.bigquery.analyticshub.v1.Listing> + getGetListingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetListing", + requestType = com.google.cloud.bigquery.analyticshub.v1.GetListingRequest.class, + responseType = com.google.cloud.bigquery.analyticshub.v1.Listing.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest, + com.google.cloud.bigquery.analyticshub.v1.Listing> + getGetListingMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest, + com.google.cloud.bigquery.analyticshub.v1.Listing> + getGetListingMethod; + if ((getGetListingMethod = AnalyticsHubServiceGrpc.getGetListingMethod) == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getGetListingMethod = AnalyticsHubServiceGrpc.getGetListingMethod) == null) { + AnalyticsHubServiceGrpc.getGetListingMethod = + getGetListingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetListing")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.Listing + .getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("GetListing")) + .build(); + } + } + } + return getGetListingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest, + com.google.cloud.bigquery.analyticshub.v1.Listing> + getCreateListingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateListing", + requestType = com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest.class, + responseType = com.google.cloud.bigquery.analyticshub.v1.Listing.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest, + com.google.cloud.bigquery.analyticshub.v1.Listing> + getCreateListingMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest, + com.google.cloud.bigquery.analyticshub.v1.Listing> + getCreateListingMethod; + if ((getCreateListingMethod = AnalyticsHubServiceGrpc.getCreateListingMethod) == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getCreateListingMethod = AnalyticsHubServiceGrpc.getCreateListingMethod) == null) { + AnalyticsHubServiceGrpc.getCreateListingMethod = + getCreateListingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateListing")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.Listing + .getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("CreateListing")) + .build(); + } + } + } + return getCreateListingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest, + com.google.cloud.bigquery.analyticshub.v1.Listing> + getUpdateListingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateListing", + requestType = com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest.class, + responseType = com.google.cloud.bigquery.analyticshub.v1.Listing.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest, + com.google.cloud.bigquery.analyticshub.v1.Listing> + getUpdateListingMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest, + com.google.cloud.bigquery.analyticshub.v1.Listing> + getUpdateListingMethod; + if ((getUpdateListingMethod = AnalyticsHubServiceGrpc.getUpdateListingMethod) == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getUpdateListingMethod = AnalyticsHubServiceGrpc.getUpdateListingMethod) == null) { + AnalyticsHubServiceGrpc.getUpdateListingMethod = + getUpdateListingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateListing")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.Listing + .getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("UpdateListing")) + .build(); + } + } + } + return getUpdateListingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest, com.google.protobuf.Empty> + getDeleteListingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteListing", + requestType = com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest, com.google.protobuf.Empty> + getDeleteListingMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest, + com.google.protobuf.Empty> + getDeleteListingMethod; + if ((getDeleteListingMethod = AnalyticsHubServiceGrpc.getDeleteListingMethod) == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getDeleteListingMethod = AnalyticsHubServiceGrpc.getDeleteListingMethod) == null) { + AnalyticsHubServiceGrpc.getDeleteListingMethod = + getDeleteListingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteListing")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("DeleteListing")) + .build(); + } + } + } + return getDeleteListingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest, + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse> + getSubscribeListingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SubscribeListing", + requestType = com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest.class, + responseType = com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest, + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse> + getSubscribeListingMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest, + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse> + getSubscribeListingMethod; + if ((getSubscribeListingMethod = AnalyticsHubServiceGrpc.getSubscribeListingMethod) == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getSubscribeListingMethod = AnalyticsHubServiceGrpc.getSubscribeListingMethod) + == null) { + AnalyticsHubServiceGrpc.getSubscribeListingMethod = + getSubscribeListingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SubscribeListing")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("SubscribeListing")) + .build(); + } + } + } + return getSubscribeListingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIamPolicy", + requestType = com.google.iam.v1.GetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = AnalyticsHubServiceGrpc.getGetIamPolicyMethod) == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getGetIamPolicyMethod = AnalyticsHubServiceGrpc.getGetIamPolicyMethod) == null) { + AnalyticsHubServiceGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetIamPolicy", + requestType = com.google.iam.v1.SetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = AnalyticsHubServiceGrpc.getSetIamPolicyMethod) == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getSetIamPolicyMethod = AnalyticsHubServiceGrpc.getSetIamPolicyMethod) == null) { + AnalyticsHubServiceGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TestIamPermissions", + requestType = com.google.iam.v1.TestIamPermissionsRequest.class, + responseType = com.google.iam.v1.TestIamPermissionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = AnalyticsHubServiceGrpc.getTestIamPermissionsMethod) + == null) { + synchronized (AnalyticsHubServiceGrpc.class) { + if ((getTestIamPermissionsMethod = AnalyticsHubServiceGrpc.getTestIamPermissionsMethod) + == null) { + AnalyticsHubServiceGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsHubServiceMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AnalyticsHubServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AnalyticsHubServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsHubServiceStub(channel, callOptions); + } + }; + return AnalyticsHubServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AnalyticsHubServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AnalyticsHubServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsHubServiceBlockingStub(channel, callOptions); + } + }; + return AnalyticsHubServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AnalyticsHubServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AnalyticsHubServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsHubServiceFutureStub(channel, callOptions); + } + }; + return AnalyticsHubServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * The `AnalyticsHubService` API facilitates data sharing within and across
+   * organizations. It allows data providers to publish listings that reference
+   * shared datasets. With Analytics Hub, users can discover and search for
+   * listings that they have access to. Subscribers can view and subscribe to
+   * listings. When you subscribe to a listing, Analytics Hub creates a linked
+   * dataset in your project.
+   * 
+ */ + public abstract static class AnalyticsHubServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists all data exchanges in a given project and location.
+     * 
+ */ + public void listDataExchanges( + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListDataExchangesMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all data exchanges from projects in a given organization and
+     * location.
+     * 
+ */ + public void listOrgDataExchanges( + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListOrgDataExchangesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the details of a data exchange.
+     * 
+ */ + public void getDataExchange( + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDataExchangeMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new data exchange.
+     * 
+ */ + public void createDataExchange( + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateDataExchangeMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an existing data exchange.
+     * 
+ */ + public void updateDataExchange( + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateDataExchangeMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes an existing data exchange.
+     * 
+ */ + public void deleteDataExchange( + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteDataExchangeMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all listings in a given project and location.
+     * 
+ */ + public void listListings( + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListListingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the details of a listing.
+     * 
+ */ + public void getListing( + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetListingMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new listing.
+     * 
+ */ + public void createListing( + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateListingMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an existing listing.
+     * 
+ */ + public void updateListing( + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateListingMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a listing.
+     * 
+ */ + public void deleteListing( + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteListingMethod(), responseObserver); + } + + /** + * + * + *
+     * Subscribes to a listing.
+     * Currently, with Analytics Hub, you can create listings that
+     * reference only BigQuery datasets.
+     * Upon subscription to a listing for a BigQuery dataset, Analytics Hub
+     * creates a linked dataset in the subscriber's project.
+     * 
+ */ + public void subscribeListing( + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSubscribeListingMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the IAM policy.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Sets the IAM policy.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns the permissions that a caller has.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTestIamPermissionsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListDataExchangesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest, + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse>( + this, METHODID_LIST_DATA_EXCHANGES))) + .addMethod( + getListOrgDataExchangesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest, + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse>( + this, METHODID_LIST_ORG_DATA_EXCHANGES))) + .addMethod( + getGetDataExchangeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest, + com.google.cloud.bigquery.analyticshub.v1.DataExchange>( + this, METHODID_GET_DATA_EXCHANGE))) + .addMethod( + getCreateDataExchangeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest, + com.google.cloud.bigquery.analyticshub.v1.DataExchange>( + this, METHODID_CREATE_DATA_EXCHANGE))) + .addMethod( + getUpdateDataExchangeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest, + com.google.cloud.bigquery.analyticshub.v1.DataExchange>( + this, METHODID_UPDATE_DATA_EXCHANGE))) + .addMethod( + getDeleteDataExchangeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_DATA_EXCHANGE))) + .addMethod( + getListListingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest, + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse>( + this, METHODID_LIST_LISTINGS))) + .addMethod( + getGetListingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest, + com.google.cloud.bigquery.analyticshub.v1.Listing>( + this, METHODID_GET_LISTING))) + .addMethod( + getCreateListingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest, + com.google.cloud.bigquery.analyticshub.v1.Listing>( + this, METHODID_CREATE_LISTING))) + .addMethod( + getUpdateListingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest, + com.google.cloud.bigquery.analyticshub.v1.Listing>( + this, METHODID_UPDATE_LISTING))) + .addMethod( + getDeleteListingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_LISTING))) + .addMethod( + getSubscribeListingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest, + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse>( + this, METHODID_SUBSCRIBE_LISTING))) + .addMethod( + getGetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_GET_IAM_POLICY))) + .addMethod( + getSetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_SET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + this, METHODID_TEST_IAM_PERMISSIONS))) + .build(); + } + } + + /** + * + * + *
+   * The `AnalyticsHubService` API facilitates data sharing within and across
+   * organizations. It allows data providers to publish listings that reference
+   * shared datasets. With Analytics Hub, users can discover and search for
+   * listings that they have access to. Subscribers can view and subscribe to
+   * listings. When you subscribe to a listing, Analytics Hub creates a linked
+   * dataset in your project.
+   * 
+ */ + public static final class AnalyticsHubServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private AnalyticsHubServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AnalyticsHubServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsHubServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all data exchanges in a given project and location.
+     * 
+ */ + public void listDataExchanges( + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListDataExchangesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all data exchanges from projects in a given organization and
+     * location.
+     * 
+ */ + public void listOrgDataExchanges( + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListOrgDataExchangesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the details of a data exchange.
+     * 
+ */ + public void getDataExchange( + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDataExchangeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new data exchange.
+     * 
+ */ + public void createDataExchange( + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateDataExchangeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an existing data exchange.
+     * 
+ */ + public void updateDataExchange( + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateDataExchangeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes an existing data exchange.
+     * 
+ */ + public void deleteDataExchange( + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteDataExchangeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all listings in a given project and location.
+     * 
+ */ + public void listListings( + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListListingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the details of a listing.
+     * 
+ */ + public void getListing( + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetListingMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new listing.
+     * 
+ */ + public void createListing( + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateListingMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an existing listing.
+     * 
+ */ + public void updateListing( + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateListingMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a listing.
+     * 
+ */ + public void deleteListing( + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteListingMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Subscribes to a listing.
+     * Currently, with Analytics Hub, you can create listings that
+     * reference only BigQuery datasets.
+     * Upon subscription to a listing for a BigQuery dataset, Analytics Hub
+     * creates a linked dataset in the subscriber's project.
+     * 
+ */ + public void subscribeListing( + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSubscribeListingMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the IAM policy.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Sets the IAM policy.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns the permissions that a caller has.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * The `AnalyticsHubService` API facilitates data sharing within and across
+   * organizations. It allows data providers to publish listings that reference
+   * shared datasets. With Analytics Hub, users can discover and search for
+   * listings that they have access to. Subscribers can view and subscribe to
+   * listings. When you subscribe to a listing, Analytics Hub creates a linked
+   * dataset in your project.
+   * 
+ */ + public static final class AnalyticsHubServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AnalyticsHubServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AnalyticsHubServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsHubServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all data exchanges in a given project and location.
+     * 
+ */ + public com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse listDataExchanges( + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListDataExchangesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all data exchanges from projects in a given organization and
+     * location.
+     * 
+ */ + public com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse + listOrgDataExchanges( + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListOrgDataExchangesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the details of a data exchange.
+     * 
+ */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange getDataExchange( + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDataExchangeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new data exchange.
+     * 
+ */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange createDataExchange( + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateDataExchangeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing data exchange.
+     * 
+ */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange updateDataExchange( + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateDataExchangeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an existing data exchange.
+     * 
+ */ + public com.google.protobuf.Empty deleteDataExchange( + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteDataExchangeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all listings in a given project and location.
+     * 
+ */ + public com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse listListings( + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListListingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the details of a listing.
+     * 
+ */ + public com.google.cloud.bigquery.analyticshub.v1.Listing getListing( + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetListingMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new listing.
+     * 
+ */ + public com.google.cloud.bigquery.analyticshub.v1.Listing createListing( + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateListingMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing listing.
+     * 
+ */ + public com.google.cloud.bigquery.analyticshub.v1.Listing updateListing( + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateListingMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a listing.
+     * 
+ */ + public com.google.protobuf.Empty deleteListing( + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteListingMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Subscribes to a listing.
+     * Currently, with Analytics Hub, you can create listings that
+     * reference only BigQuery datasets.
+     * Upon subscription to a listing for a BigQuery dataset, Analytics Hub
+     * creates a linked dataset in the subscriber's project.
+     * 
+ */ + public com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse subscribeListing( + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSubscribeListingMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the IAM policy.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets the IAM policy.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns the permissions that a caller has.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * The `AnalyticsHubService` API facilitates data sharing within and across
+   * organizations. It allows data providers to publish listings that reference
+   * shared datasets. With Analytics Hub, users can discover and search for
+   * listings that they have access to. Subscribers can view and subscribe to
+   * listings. When you subscribe to a listing, Analytics Hub creates a linked
+   * dataset in your project.
+   * 
+ */ + public static final class AnalyticsHubServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AnalyticsHubServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AnalyticsHubServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsHubServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all data exchanges in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse> + listDataExchanges( + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListDataExchangesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all data exchanges from projects in a given organization and
+     * location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse> + listOrgDataExchanges( + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListOrgDataExchangesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the details of a data exchange.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.analyticshub.v1.DataExchange> + getDataExchange(com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDataExchangeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new data exchange.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.analyticshub.v1.DataExchange> + createDataExchange( + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateDataExchangeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an existing data exchange.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.analyticshub.v1.DataExchange> + updateDataExchange( + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateDataExchangeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes an existing data exchange.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDataExchange( + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteDataExchangeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all listings in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse> + listListings(com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListListingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the details of a listing.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.analyticshub.v1.Listing> + getListing(com.google.cloud.bigquery.analyticshub.v1.GetListingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetListingMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new listing.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.analyticshub.v1.Listing> + createListing(com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateListingMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an existing listing.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.analyticshub.v1.Listing> + updateListing(com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateListingMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a listing.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteListing(com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteListingMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Subscribes to a listing.
+     * Currently, with Analytics Hub, you can create listings that
+     * reference only BigQuery datasets.
+     * Upon subscription to a listing for a BigQuery dataset, Analytics Hub
+     * creates a linked dataset in the subscriber's project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse> + subscribeListing( + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSubscribeListingMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the IAM policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Sets the IAM policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns the permissions that a caller has.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_DATA_EXCHANGES = 0; + private static final int METHODID_LIST_ORG_DATA_EXCHANGES = 1; + private static final int METHODID_GET_DATA_EXCHANGE = 2; + private static final int METHODID_CREATE_DATA_EXCHANGE = 3; + private static final int METHODID_UPDATE_DATA_EXCHANGE = 4; + private static final int METHODID_DELETE_DATA_EXCHANGE = 5; + private static final int METHODID_LIST_LISTINGS = 6; + private static final int METHODID_GET_LISTING = 7; + private static final int METHODID_CREATE_LISTING = 8; + private static final int METHODID_UPDATE_LISTING = 9; + private static final int METHODID_DELETE_LISTING = 10; + private static final int METHODID_SUBSCRIBE_LISTING = 11; + private static final int METHODID_GET_IAM_POLICY = 12; + private static final int METHODID_SET_IAM_POLICY = 13; + private static final int METHODID_TEST_IAM_PERMISSIONS = 14; + + 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 AnalyticsHubServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AnalyticsHubServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_DATA_EXCHANGES: + serviceImpl.listDataExchanges( + (com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse>) + responseObserver); + break; + case METHODID_LIST_ORG_DATA_EXCHANGES: + serviceImpl.listOrgDataExchanges( + (com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse>) + responseObserver); + break; + case METHODID_GET_DATA_EXCHANGE: + serviceImpl.getDataExchange( + (com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_DATA_EXCHANGE: + serviceImpl.createDataExchange( + (com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_DATA_EXCHANGE: + serviceImpl.updateDataExchange( + (com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_DATA_EXCHANGE: + serviceImpl.deleteDataExchange( + (com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_LISTINGS: + serviceImpl.listListings( + (com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse>) + responseObserver); + break; + case METHODID_GET_LISTING: + serviceImpl.getListing( + (com.google.cloud.bigquery.analyticshub.v1.GetListingRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_LISTING: + serviceImpl.createListing( + (com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_LISTING: + serviceImpl.updateListing( + (com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_LISTING: + serviceImpl.deleteListing( + (com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SUBSCRIBE_LISTING: + serviceImpl.subscribeListing( + (com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse>) + responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class AnalyticsHubServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AnalyticsHubServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AnalyticsHubService"); + } + } + + private static final class AnalyticsHubServiceFileDescriptorSupplier + extends AnalyticsHubServiceBaseDescriptorSupplier { + AnalyticsHubServiceFileDescriptorSupplier() {} + } + + private static final class AnalyticsHubServiceMethodDescriptorSupplier + extends AnalyticsHubServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AnalyticsHubServiceMethodDescriptorSupplier(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 (AnalyticsHubServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AnalyticsHubServiceFileDescriptorSupplier()) + .addMethod(getListDataExchangesMethod()) + .addMethod(getListOrgDataExchangesMethod()) + .addMethod(getGetDataExchangeMethod()) + .addMethod(getCreateDataExchangeMethod()) + .addMethod(getUpdateDataExchangeMethod()) + .addMethod(getDeleteDataExchangeMethod()) + .addMethod(getListListingsMethod()) + .addMethod(getGetListingMethod()) + .addMethod(getCreateListingMethod()) + .addMethod(getUpdateListingMethod()) + .addMethod(getDeleteListingMethod()) + .addMethod(getSubscribeListingMethod()) + .addMethod(getGetIamPolicyMethod()) + .addMethod(getSetIamPolicyMethod()) + .addMethod(getTestIamPermissionsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-analyticshub/owlbot.py b/java-analyticshub/owlbot.py new file mode 100644 index 000000000000..7a77cf5ee557 --- /dev/null +++ b/java-analyticshub/owlbot.py @@ -0,0 +1,35 @@ +# 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(excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json" +]) \ No newline at end of file diff --git a/java-analyticshub/pom.xml b/java-analyticshub/pom.xml new file mode 100644 index 000000000000..b8ba04fee541 --- /dev/null +++ b/java-analyticshub/pom.xml @@ -0,0 +1,71 @@ + + + 4.0.0 + com.google.cloud + google-cloud-analyticshub-parent + pom + 0.0.1-SNAPSHOT + Google Analytics Hub API Parent + https://github.com/googleapis/java-analyticshub + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.0.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-analyticshub-parent + + + + + + com.google.cloud + google-cloud-analyticshub + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-analyticshub-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-analyticshub-v1 + 0.0.1-SNAPSHOT + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.objenesis:objenesis + javax.annotation:javax.annotation-api + + + + + + + + + google-cloud-analyticshub + grpc-google-cloud-analyticshub-v1 + proto-google-cloud-analyticshub-v1 + google-cloud-analyticshub-bom + + diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/clirr-ignored-differences.xml b/java-analyticshub/proto-google-cloud-analyticshub-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..b17b7f9cccb2 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/bigquery/analyticshub/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/bigquery/analyticshub/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/bigquery/analyticshub/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/pom.xml b/java-analyticshub/proto-google-cloud-analyticshub-v1/pom.xml new file mode 100644 index 000000000000..cf551bcb4801 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-analyticshub-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-analyticshub-v1 + Proto library for google-cloud-analyticshub + + com.google.cloud + google-cloud-analyticshub-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/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubProto.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubProto.java new file mode 100644 index 000000000000..f11c659979c4 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/AnalyticsHubProto.java @@ -0,0 +1,602 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public final class AnalyticsHubProto { + private AnalyticsHubProto() {} + + 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_bigquery_analyticshub_v1_DataExchange_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_DataExchange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_DataProvider_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_DataProvider_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_Publisher_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_Publisher_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDatasetReference_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDatasetReference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_Listing_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_Listing_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_Listing_BigQueryDatasetSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_Listing_BigQueryDatasetSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_GetDataExchangeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_GetDataExchangeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_CreateDataExchangeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_CreateDataExchangeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_UpdateDataExchangeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_UpdateDataExchangeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_DeleteDataExchangeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_DeleteDataExchangeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_GetListingRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_GetListingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_CreateListingRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_CreateListingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_UpdateListingRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_UpdateListingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_DeleteListingRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_DeleteListingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n8google/cloud/bigquery/analyticshub/v1/" + + "analyticshub.proto\022%google.cloud.bigquer" + + "y.analyticshub.v1\032\034google/api/annotation" + + "s.proto\032\027google/api/client.proto\032\037google" + + "/api/field_behavior.proto\032\031google/api/re" + + "source.proto\032\036google/iam/v1/iam_policy.p" + + "roto\032\032google/iam/v1/policy.proto\032\033google" + + "/protobuf/empty.proto\032 google/protobuf/f" + + "ield_mask.proto\032\036google/protobuf/wrapper" + + "s.proto\"\265\002\n\014DataExchange\022\021\n\004name\030\001 \001(\tB\003" + + "\340A\003\022\031\n\014display_name\030\002 \001(\tB\003\340A\002\022\030\n\013descri" + + "ption\030\003 \001(\tB\003\340A\001\022\034\n\017primary_contact\030\004 \001(" + + "\tB\003\340A\001\022\032\n\rdocumentation\030\005 \001(\tB\003\340A\001\022\032\n\rli" + + "sting_count\030\006 \001(\005B\003\340A\003\022\021\n\004icon\030\007 \001(\014B\003\340A" + + "\001:t\352Aq\n(analyticshub.googleapis.com/Data" + + "Exchange\022Eprojects/{project}/locations/{" + + "location}/dataExchanges/{data_exchange}\"" + + "?\n\014DataProvider\022\021\n\004name\030\001 \001(\tB\003\340A\001\022\034\n\017pr" + + "imary_contact\030\002 \001(\tB\003\340A\001\"<\n\tPublisher\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\001\022\034\n\017primary_contact\030\002 \001(" + + "\tB\003\340A\001\"O\n\033DestinationDatasetReference\022\027\n" + + "\ndataset_id\030\001 \001(\tB\003\340A\002\022\027\n\nproject_id\030\002 \001" + + "(\tB\003\340A\002\"\214\003\n\022DestinationDataset\022b\n\021datase" + + "t_reference\030\001 \001(\0132B.google.cloud.bigquer" + + "y.analyticshub.v1.DestinationDatasetRefe" + + "renceB\003\340A\002\0228\n\rfriendly_name\030\002 \001(\0132\034.goog" + + "le.protobuf.StringValueB\003\340A\001\0226\n\013descript" + + "ion\030\003 \001(\0132\034.google.protobuf.StringValueB" + + "\003\340A\001\022Z\n\006labels\030\004 \003(\0132E.google.cloud.bigq" + + "uery.analyticshub.v1.DestinationDataset." + + "LabelsEntryB\003\340A\001\022\025\n\010location\030\005 \001(\tB\003\340A\002\032" + + "-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" + + "(\t:\0028\001\"\236\013\n\007Listing\022e\n\020bigquery_dataset\030\006" + + " \001(\0132D.google.cloud.bigquery.analyticshu" + + "b.v1.Listing.BigQueryDatasetSourceB\003\340A\002H" + + "\000\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\031\n\014display_name\030\002 \001" + + "(\tB\003\340A\002\022\030\n\013description\030\003 \001(\tB\003\340A\001\022\034\n\017pri" + + "mary_contact\030\004 \001(\tB\003\340A\001\022\032\n\rdocumentation" + + "\030\005 \001(\tB\003\340A\001\022H\n\005state\030\007 \001(\01624.google.clou" + + "d.bigquery.analyticshub.v1.Listing.State" + + "B\003\340A\003\022\021\n\004icon\030\010 \001(\014B\003\340A\001\022O\n\rdata_provide" + + "r\030\t \001(\01323.google.cloud.bigquery.analytic" + + "shub.v1.DataProviderB\003\340A\001\022P\n\ncategories\030" + + "\n \003(\01627.google.cloud.bigquery.analyticsh" + + "ub.v1.Listing.CategoryB\003\340A\001\022H\n\tpublisher" + + "\030\013 \001(\01320.google.cloud.bigquery.analytics" + + "hub.v1.PublisherB\003\340A\001\022\033\n\016request_access\030" + + "\014 \001(\tB\003\340A\001\032N\n\025BigQueryDatasetSource\0225\n\007d" + + "ataset\030\001 \001(\tB$\372A!\n\037bigquery.googleapis.c" + + "om/Dataset\"*\n\005State\022\025\n\021STATE_UNSPECIFIED" + + "\020\000\022\n\n\006ACTIVE\020\001\"\267\004\n\010Category\022\030\n\024CATEGORY_" + + "UNSPECIFIED\020\000\022\023\n\017CATEGORY_OTHERS\020\001\022&\n\"CA" + + "TEGORY_ADVERTISING_AND_MARKETING\020\002\022\025\n\021CA" + + "TEGORY_COMMERCE\020\003\022$\n CATEGORY_CLIMATE_AN" + + "D_ENVIRONMENT\020\004\022\031\n\025CATEGORY_DEMOGRAPHICS" + + "\020\005\022\026\n\022CATEGORY_ECONOMICS\020\006\022\026\n\022CATEGORY_E" + + "DUCATION\020\007\022\023\n\017CATEGORY_ENERGY\020\010\022\026\n\022CATEG" + + "ORY_FINANCIAL\020\t\022\023\n\017CATEGORY_GAMING\020\n\022\027\n\023" + + "CATEGORY_GEOSPATIAL\020\013\022(\n$CATEGORY_HEALTH" + + "CARE_AND_LIFE_SCIENCE\020\014\022\022\n\016CATEGORY_MEDI" + + "A\020\r\022\032\n\026CATEGORY_PUBLIC_SECTOR\020\016\022\023\n\017CATEG" + + "ORY_RETAIL\020\017\022\023\n\017CATEGORY_SPORTS\020\020\022!\n\035CAT" + + "EGORY_SCIENCE_AND_RESEARCH\020\021\022)\n%CATEGORY" + + "_TRANSPORTATION_AND_LOGISTICS\020\022\022\037\n\033CATEG" + + "ORY_TRAVEL_AND_TOURISM\020\023:\202\001\352A\177\n#analytic" + + "shub.googleapis.com/Listing\022Xprojects/{p" + + "roject}/locations/{location}/dataExchang" + + "es/{data_exchange}/listings/{listing}B\010\n" + + "\006source\"|\n\030ListDataExchangesRequest\0229\n\006p" + + "arent\030\001 \001(\tB)\340A\002\372A#\n!locations.googleapi" + + "s.com/Location\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npag" + + "e_token\030\003 \001(\t\"\201\001\n\031ListDataExchangesRespo" + + "nse\022K\n\016data_exchanges\030\001 \003(\01323.google.clo" + + "ud.bigquery.analyticshub.v1.DataExchange" + + "\022\027\n\017next_page_token\030\002 \001(\t\"_\n\033ListOrgData" + + "ExchangesRequest\022\031\n\014organization\030\001 \001(\tB\003" + + "\340A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001" + + "(\t\"\204\001\n\034ListOrgDataExchangesResponse\022K\n\016d" + + "ata_exchanges\030\001 \003(\01323.google.cloud.bigqu" + + "ery.analyticshub.v1.DataExchange\022\027\n\017next" + + "_page_token\030\002 \001(\t\"X\n\026GetDataExchangeRequ" + + "est\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n(analyticshub." + + "googleapis.com/DataExchange\"\306\001\n\031CreateDa" + + "taExchangeRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A" + + "#\n!locations.googleapis.com/Location\022\035\n\020" + + "data_exchange_id\030\002 \001(\tB\003\340A\002\022O\n\rdata_exch" + + "ange\030\003 \001(\01323.google.cloud.bigquery.analy" + + "ticshub.v1.DataExchangeB\003\340A\002\"\242\001\n\031UpdateD" + + "ataExchangeRequest\0224\n\013update_mask\030\001 \001(\0132" + + "\032.google.protobuf.FieldMaskB\003\340A\002\022O\n\rdata" + + "_exchange\030\002 \001(\01323.google.cloud.bigquery." + + "analyticshub.v1.DataExchangeB\003\340A\002\"[\n\031Del" + + "eteDataExchangeRequest\022>\n\004name\030\001 \001(\tB0\340A" + + "\002\372A*\n(analyticshub.googleapis.com/DataEx" + + "change\"~\n\023ListListingsRequest\022@\n\006parent\030" + + "\001 \001(\tB0\340A\002\372A*\n(analyticshub.googleapis.c" + + "om/DataExchange\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npa" + + "ge_token\030\003 \001(\t\"q\n\024ListListingsResponse\022@" + + "\n\010listings\030\001 \003(\0132..google.cloud.bigquery" + + ".analyticshub.v1.Listing\022\027\n\017next_page_to" + + "ken\030\002 \001(\t\"N\n\021GetListingRequest\0229\n\004name\030\001" + + " \001(\tB+\340A\002\372A%\n#analyticshub.googleapis.co" + + "m/Listing\"\267\001\n\024CreateListingRequest\022@\n\006pa" + + "rent\030\001 \001(\tB0\340A\002\372A*\n(analyticshub.googlea" + + "pis.com/DataExchange\022\027\n\nlisting_id\030\002 \001(\t" + + "B\003\340A\002\022D\n\007listing\030\003 \001(\0132..google.cloud.bi" + + "gquery.analyticshub.v1.ListingB\003\340A\002\"\222\001\n\024" + + "UpdateListingRequest\0224\n\013update_mask\030\001 \001(" + + "\0132\032.google.protobuf.FieldMaskB\003\340A\002\022D\n\007li" + + "sting\030\002 \001(\0132..google.cloud.bigquery.anal" + + "yticshub.v1.ListingB\003\340A\002\"Q\n\024DeleteListin" + + "gRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#analytic" + + "shub.googleapis.com/Listing\"\275\001\n\027Subscrib" + + "eListingRequest\022X\n\023destination_dataset\030\003" + + " \001(\01329.google.cloud.bigquery.analyticshu" + + "b.v1.DestinationDatasetH\000\0229\n\004name\030\001 \001(\tB" + + "+\340A\002\372A%\n#analyticshub.googleapis.com/Lis" + + "tingB\r\n\013destination\"\032\n\030SubscribeListingR" + + "esponse2\336\033\n\023AnalyticsHubService\022\332\001\n\021List" + + "DataExchanges\022?.google.cloud.bigquery.an" + + "alyticshub.v1.ListDataExchangesRequest\032@" + + ".google.cloud.bigquery.analyticshub.v1.L" + + "istDataExchangesResponse\"B\202\323\344\223\0023\0221/v1/{p" + + "arent=projects/*/locations/*}/dataExchan" + + "ges\332A\006parent\022\364\001\n\024ListOrgDataExchanges\022B." + + "google.cloud.bigquery.analyticshub.v1.Li" + + "stOrgDataExchangesRequest\032C.google.cloud" + + ".bigquery.analyticshub.v1.ListOrgDataExc" + + "hangesResponse\"S\202\323\344\223\002>\022\022\022*.google.cloud.bigquery.ana" + + "lyticshub.v1.SubscribeListingRequest\032?.g" + + "oogle.cloud.bigquery.analyticshub.v1.Sub" + + "scribeListingResponse\"X\202\323\344\223\002K\"F/v1/{name" + + "=projects/*/locations/*/dataExchanges/*/" + + "listings/*}:subscribe:\001*\332A\004name\022\356\001\n\014GetI" + + "amPolicy\022\".google.iam.v1.GetIamPolicyReq" + + "uest\032\025.google.iam.v1.Policy\"\242\001\202\323\344\223\002\233\001\"B/" + + "v1/{resource=projects/*/locations/*/data" + + "Exchanges/*}:getIamPolicy:\001*ZR\"M/v1/{res" + + "ource=projects/*/locations/*/dataExchang" + + "es/*/listings/*}:getIamPolicy:\001*\022\356\001\n\014Set" + + "IamPolicy\022\".google.iam.v1.SetIamPolicyRe" + + "quest\032\025.google.iam.v1.Policy\"\242\001\202\323\344\223\002\233\001\"B" + + "/v1/{resource=projects/*/locations/*/dat" + + "aExchanges/*}:setIamPolicy:\001*ZR\"M/v1/{re" + + "source=projects/*/locations/*/dataExchan" + + "ges/*/listings/*}:setIamPolicy:\001*\022\232\002\n\022Te" + + "stIamPermissions\022(.google.iam.v1.TestIam" + + "PermissionsRequest\032).google.iam.v1.TestI" + + "amPermissionsResponse\"\256\001\202\323\344\223\002\247\001\"H/v1/{re" + + "source=projects/*/locations/*/dataExchan" + + "ges/*}:testIamPermissions:\001*ZX\"S/v1/{res" + + "ource=projects/*/locations/*/dataExchang" + + "es/*/listings/*}:testIamPermissions:\001*\032x" + + "\312A\033analyticshub.googleapis.com\322AWhttps:/" + + "/www.googleapis.com/auth/bigquery,https:" + + "//www.googleapis.com/auth/cloud-platform" + + "B\332\002\n)com.google.cloud.bigquery.analytics" + + "hub.v1B\021AnalyticsHubProtoP\001ZQgoogle.gola" + + "ng.org/genproto/googleapis/cloud/bigquer" + + "y/analyticshub/v1;analyticshub\252\002%Google." + + "Cloud.BigQuery.AnalyticsHub.V1\312\002%Google\\" + + "Cloud\\BigQuery\\AnalyticsHub\\V1\352\002)Google:" + + ":Cloud::Bigquery::AnalyticsHub::V1\352AH\n\037b" + + "igquery.googleapis.com/Dataset\022%projects" + + "/{project}/datasets/{dataset}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + }); + internal_static_google_cloud_bigquery_analyticshub_v1_DataExchange_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_bigquery_analyticshub_v1_DataExchange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_DataExchange_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Description", + "PrimaryContact", + "Documentation", + "ListingCount", + "Icon", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_DataProvider_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_bigquery_analyticshub_v1_DataProvider_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_DataProvider_descriptor, + new java.lang.String[] { + "Name", "PrimaryContact", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_Publisher_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_bigquery_analyticshub_v1_Publisher_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_Publisher_descriptor, + new java.lang.String[] { + "Name", "PrimaryContact", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDatasetReference_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDatasetReference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDatasetReference_descriptor, + new java.lang.String[] { + "DatasetId", "ProjectId", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_descriptor, + new java.lang.String[] { + "DatasetReference", "FriendlyName", "Description", "Labels", "Location", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_LabelsEntry_descriptor = + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_Listing_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_bigquery_analyticshub_v1_Listing_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_Listing_descriptor, + new java.lang.String[] { + "BigqueryDataset", + "Name", + "DisplayName", + "Description", + "PrimaryContact", + "Documentation", + "State", + "Icon", + "DataProvider", + "Categories", + "Publisher", + "RequestAccess", + "Source", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_Listing_BigQueryDatasetSource_descriptor = + internal_static_google_cloud_bigquery_analyticshub_v1_Listing_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_bigquery_analyticshub_v1_Listing_BigQueryDatasetSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_Listing_BigQueryDatasetSource_descriptor, + new java.lang.String[] { + "Dataset", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesResponse_descriptor, + new java.lang.String[] { + "DataExchanges", "NextPageToken", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesRequest_descriptor, + new java.lang.String[] { + "Organization", "PageSize", "PageToken", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesResponse_descriptor, + new java.lang.String[] { + "DataExchanges", "NextPageToken", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_GetDataExchangeRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_bigquery_analyticshub_v1_GetDataExchangeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_GetDataExchangeRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_CreateDataExchangeRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_bigquery_analyticshub_v1_CreateDataExchangeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_CreateDataExchangeRequest_descriptor, + new java.lang.String[] { + "Parent", "DataExchangeId", "DataExchange", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_UpdateDataExchangeRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_bigquery_analyticshub_v1_UpdateDataExchangeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_UpdateDataExchangeRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "DataExchange", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_DeleteDataExchangeRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_bigquery_analyticshub_v1_DeleteDataExchangeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_DeleteDataExchangeRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsResponse_descriptor, + new java.lang.String[] { + "Listings", "NextPageToken", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_GetListingRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_bigquery_analyticshub_v1_GetListingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_GetListingRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_CreateListingRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_bigquery_analyticshub_v1_CreateListingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_CreateListingRequest_descriptor, + new java.lang.String[] { + "Parent", "ListingId", "Listing", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_UpdateListingRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_bigquery_analyticshub_v1_UpdateListingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_UpdateListingRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Listing", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_DeleteListingRequest_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_bigquery_analyticshub_v1_DeleteListingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_DeleteListingRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingRequest_descriptor, + new java.lang.String[] { + "DestinationDataset", "Name", "Destination", + }); + internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingResponse_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingResponse_descriptor, + new java.lang.String[] {}); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateDataExchangeRequest.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateDataExchangeRequest.java new file mode 100644 index 000000000000..72f5b6b8caca --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateDataExchangeRequest.java @@ -0,0 +1,1147 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for creating a data exchange.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest} + */ +public final class CreateDataExchangeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest) + CreateDataExchangeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDataExchangeRequest.newBuilder() to construct. + private CreateDataExchangeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDataExchangeRequest() { + parent_ = ""; + dataExchangeId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateDataExchangeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_CreateDataExchangeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_CreateDataExchangeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest.class, + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource path of the data exchange.
+   * e.g. `projects/myproject/locations/US`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource path of the data exchange.
+   * e.g. `projects/myproject/locations/US`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_EXCHANGE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object dataExchangeId_; + /** + * + * + *
+   * Required. The ID of the data exchange.
+   * Must contain only Unicode letters, numbers (0-9), underscores (_).
+   * Should not use characters that require URL-escaping, or characters
+   * outside of ASCII, spaces.
+   * Max length: 100 bytes.
+   * 
+ * + * string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The dataExchangeId. + */ + @java.lang.Override + public java.lang.String getDataExchangeId() { + java.lang.Object ref = dataExchangeId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataExchangeId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID of the data exchange.
+   * Must contain only Unicode letters, numbers (0-9), underscores (_).
+   * Should not use characters that require URL-escaping, or characters
+   * outside of ASCII, spaces.
+   * Max length: 100 bytes.
+   * 
+ * + * string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for dataExchangeId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDataExchangeIdBytes() { + java.lang.Object ref = dataExchangeId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataExchangeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_EXCHANGE_FIELD_NUMBER = 3; + private com.google.cloud.bigquery.analyticshub.v1.DataExchange dataExchange_; + /** + * + * + *
+   * Required. The data exchange to create.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataExchange field is set. + */ + @java.lang.Override + public boolean hasDataExchange() { + return dataExchange_ != null; + } + /** + * + * + *
+   * Required. The data exchange to create.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataExchange. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataExchange getDataExchange() { + return dataExchange_ == null + ? com.google.cloud.bigquery.analyticshub.v1.DataExchange.getDefaultInstance() + : dataExchange_; + } + /** + * + * + *
+   * Required. The data exchange to create.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder + getDataExchangeOrBuilder() { + return getDataExchange(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataExchangeId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, dataExchangeId_); + } + if (dataExchange_ != null) { + output.writeMessage(3, getDataExchange()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataExchangeId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, dataExchangeId_); + } + if (dataExchange_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getDataExchange()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = 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.bigquery.analyticshub.v1.CreateDataExchangeRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest other = + (com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getDataExchangeId().equals(other.getDataExchangeId())) return false; + if (hasDataExchange() != other.hasDataExchange()) return false; + if (hasDataExchange()) { + if (!getDataExchange().equals(other.getDataExchange())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + DATA_EXCHANGE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDataExchangeId().hashCode(); + if (hasDataExchange()) { + hash = (37 * hash) + DATA_EXCHANGE_FIELD_NUMBER; + hash = (53 * hash) + getDataExchange().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest 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.bigquery.analyticshub.v1.CreateDataExchangeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest parseFrom( + 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.bigquery.analyticshub.v1.CreateDataExchangeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest parseFrom( + java.io.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.bigquery.analyticshub.v1.CreateDataExchangeRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest + parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.CreateDataExchangeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.CreateDataExchangeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a data exchange.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest) + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_CreateDataExchangeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_CreateDataExchangeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest.class, + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + dataExchangeId_ = ""; + + if (dataExchangeBuilder_ == null) { + dataExchange_ = null; + } else { + dataExchange_ = null; + dataExchangeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_CreateDataExchangeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest build() { + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest result = + new com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest(this); + result.parent_ = parent_; + result.dataExchangeId_ = dataExchangeId_; + if (dataExchangeBuilder_ == null) { + result.dataExchange_ = dataExchange_; + } else { + result.dataExchange_ = dataExchangeBuilder_.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.bigquery.analyticshub.v1.CreateDataExchangeRequest) { + return mergeFrom( + (com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getDataExchangeId().isEmpty()) { + dataExchangeId_ = other.dataExchangeId_; + onChanged(); + } + if (other.hasDataExchange()) { + mergeDataExchange(other.getDataExchange()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + dataExchangeId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + input.readMessage(getDataExchangeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource path of the data exchange.
+     * e.g. `projects/myproject/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource path of the data exchange.
+     * e.g. `projects/myproject/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource path of the data exchange.
+     * e.g. `projects/myproject/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource path of the data exchange.
+     * e.g. `projects/myproject/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource path of the data exchange.
+     * e.g. `projects/myproject/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object dataExchangeId_ = ""; + /** + * + * + *
+     * Required. The ID of the data exchange.
+     * Must contain only Unicode letters, numbers (0-9), underscores (_).
+     * Should not use characters that require URL-escaping, or characters
+     * outside of ASCII, spaces.
+     * Max length: 100 bytes.
+     * 
+ * + * string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The dataExchangeId. + */ + public java.lang.String getDataExchangeId() { + java.lang.Object ref = dataExchangeId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataExchangeId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID of the data exchange.
+     * Must contain only Unicode letters, numbers (0-9), underscores (_).
+     * Should not use characters that require URL-escaping, or characters
+     * outside of ASCII, spaces.
+     * Max length: 100 bytes.
+     * 
+ * + * string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for dataExchangeId. + */ + public com.google.protobuf.ByteString getDataExchangeIdBytes() { + java.lang.Object ref = dataExchangeId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataExchangeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID of the data exchange.
+     * Must contain only Unicode letters, numbers (0-9), underscores (_).
+     * Should not use characters that require URL-escaping, or characters
+     * outside of ASCII, spaces.
+     * Max length: 100 bytes.
+     * 
+ * + * string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The dataExchangeId to set. + * @return This builder for chaining. + */ + public Builder setDataExchangeId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dataExchangeId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the data exchange.
+     * Must contain only Unicode letters, numbers (0-9), underscores (_).
+     * Should not use characters that require URL-escaping, or characters
+     * outside of ASCII, spaces.
+     * Max length: 100 bytes.
+     * 
+ * + * string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDataExchangeId() { + + dataExchangeId_ = getDefaultInstance().getDataExchangeId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the data exchange.
+     * Must contain only Unicode letters, numbers (0-9), underscores (_).
+     * Should not use characters that require URL-escaping, or characters
+     * outside of ASCII, spaces.
+     * Max length: 100 bytes.
+     * 
+ * + * string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for dataExchangeId to set. + * @return This builder for chaining. + */ + public Builder setDataExchangeIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dataExchangeId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.bigquery.analyticshub.v1.DataExchange dataExchange_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataExchange, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder> + dataExchangeBuilder_; + /** + * + * + *
+     * Required. The data exchange to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataExchange field is set. + */ + public boolean hasDataExchange() { + return dataExchangeBuilder_ != null || dataExchange_ != null; + } + /** + * + * + *
+     * Required. The data exchange to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataExchange. + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange getDataExchange() { + if (dataExchangeBuilder_ == null) { + return dataExchange_ == null + ? com.google.cloud.bigquery.analyticshub.v1.DataExchange.getDefaultInstance() + : dataExchange_; + } else { + return dataExchangeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The data exchange to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDataExchange(com.google.cloud.bigquery.analyticshub.v1.DataExchange value) { + if (dataExchangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataExchange_ = value; + onChanged(); + } else { + dataExchangeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The data exchange to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDataExchange( + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder builderForValue) { + if (dataExchangeBuilder_ == null) { + dataExchange_ = builderForValue.build(); + onChanged(); + } else { + dataExchangeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The data exchange to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDataExchange(com.google.cloud.bigquery.analyticshub.v1.DataExchange value) { + if (dataExchangeBuilder_ == null) { + if (dataExchange_ != null) { + dataExchange_ = + com.google.cloud.bigquery.analyticshub.v1.DataExchange.newBuilder(dataExchange_) + .mergeFrom(value) + .buildPartial(); + } else { + dataExchange_ = value; + } + onChanged(); + } else { + dataExchangeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The data exchange to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDataExchange() { + if (dataExchangeBuilder_ == null) { + dataExchange_ = null; + onChanged(); + } else { + dataExchange_ = null; + dataExchangeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The data exchange to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder getDataExchangeBuilder() { + + onChanged(); + return getDataExchangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The data exchange to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder + getDataExchangeOrBuilder() { + if (dataExchangeBuilder_ != null) { + return dataExchangeBuilder_.getMessageOrBuilder(); + } else { + return dataExchange_ == null + ? com.google.cloud.bigquery.analyticshub.v1.DataExchange.getDefaultInstance() + : dataExchange_; + } + } + /** + * + * + *
+     * Required. The data exchange to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataExchange, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder> + getDataExchangeFieldBuilder() { + if (dataExchangeBuilder_ == null) { + dataExchangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataExchange, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder>( + getDataExchange(), getParentForChildren(), isClean()); + dataExchange_ = null; + } + return dataExchangeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(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.bigquery.analyticshub.v1.CreateDataExchangeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest) + private static final com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDataExchangeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.CreateDataExchangeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateDataExchangeRequestOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateDataExchangeRequestOrBuilder.java new file mode 100644 index 000000000000..b2970b5106a1 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateDataExchangeRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface CreateDataExchangeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource path of the data exchange.
+   * e.g. `projects/myproject/locations/US`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource path of the data exchange.
+   * e.g. `projects/myproject/locations/US`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID of the data exchange.
+   * Must contain only Unicode letters, numbers (0-9), underscores (_).
+   * Should not use characters that require URL-escaping, or characters
+   * outside of ASCII, spaces.
+   * Max length: 100 bytes.
+   * 
+ * + * string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The dataExchangeId. + */ + java.lang.String getDataExchangeId(); + /** + * + * + *
+   * Required. The ID of the data exchange.
+   * Must contain only Unicode letters, numbers (0-9), underscores (_).
+   * Should not use characters that require URL-escaping, or characters
+   * outside of ASCII, spaces.
+   * Max length: 100 bytes.
+   * 
+ * + * string data_exchange_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for dataExchangeId. + */ + com.google.protobuf.ByteString getDataExchangeIdBytes(); + + /** + * + * + *
+   * Required. The data exchange to create.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataExchange field is set. + */ + boolean hasDataExchange(); + /** + * + * + *
+   * Required. The data exchange to create.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataExchange. + */ + com.google.cloud.bigquery.analyticshub.v1.DataExchange getDataExchange(); + /** + * + * + *
+   * Required. The data exchange to create.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder getDataExchangeOrBuilder(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateListingRequest.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateListingRequest.java new file mode 100644 index 000000000000..84680aa6b56e --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateListingRequest.java @@ -0,0 +1,1140 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for creating a listing.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.CreateListingRequest} + */ +public final class CreateListingRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.CreateListingRequest) + CreateListingRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateListingRequest.newBuilder() to construct. + private CreateListingRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateListingRequest() { + parent_ = ""; + listingId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateListingRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_CreateListingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_CreateListingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest.class, + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource path of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource path of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LISTING_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object listingId_; + /** + * + * + *
+   * Required. The ID of the listing to create.
+   * Must contain only Unicode letters, numbers (0-9), underscores (_).
+   * Should not use characters that require URL-escaping, or characters
+   * outside of ASCII, spaces.
+   * Max length: 100 bytes.
+   * 
+ * + * string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The listingId. + */ + @java.lang.Override + public java.lang.String getListingId() { + java.lang.Object ref = listingId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + listingId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID of the listing to create.
+   * Must contain only Unicode letters, numbers (0-9), underscores (_).
+   * Should not use characters that require URL-escaping, or characters
+   * outside of ASCII, spaces.
+   * Max length: 100 bytes.
+   * 
+ * + * string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for listingId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getListingIdBytes() { + java.lang.Object ref = listingId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + listingId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LISTING_FIELD_NUMBER = 3; + private com.google.cloud.bigquery.analyticshub.v1.Listing listing_; + /** + * + * + *
+   * Required. The listing to create.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the listing field is set. + */ + @java.lang.Override + public boolean hasListing() { + return listing_ != null; + } + /** + * + * + *
+   * Required. The listing to create.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The listing. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing getListing() { + return listing_ == null + ? com.google.cloud.bigquery.analyticshub.v1.Listing.getDefaultInstance() + : listing_; + } + /** + * + * + *
+   * Required. The listing to create.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder getListingOrBuilder() { + return getListing(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(listingId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, listingId_); + } + if (listing_ != null) { + output.writeMessage(3, getListing()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(listingId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, listingId_); + } + if (listing_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getListing()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = 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.bigquery.analyticshub.v1.CreateListingRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest other = + (com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getListingId().equals(other.getListingId())) return false; + if (hasListing() != other.hasListing()) return false; + if (hasListing()) { + if (!getListing().equals(other.getListing())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + LISTING_ID_FIELD_NUMBER; + hash = (53 * hash) + getListingId().hashCode(); + if (hasListing()) { + hash = (37 * hash) + LISTING_FIELD_NUMBER; + hash = (53 * hash) + getListing().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest 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.bigquery.analyticshub.v1.CreateListingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest parseFrom( + 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.bigquery.analyticshub.v1.CreateListingRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest parseFrom( + java.io.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.bigquery.analyticshub.v1.CreateListingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.CreateListingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.CreateListingRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a listing.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.CreateListingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.CreateListingRequest) + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_CreateListingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_CreateListingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest.class, + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + listingId_ = ""; + + if (listingBuilder_ == null) { + listing_ = null; + } else { + listing_ = null; + listingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_CreateListingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest build() { + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest result = + new com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest(this); + result.parent_ = parent_; + result.listingId_ = listingId_; + if (listingBuilder_ == null) { + result.listing_ = listing_; + } else { + result.listing_ = listingBuilder_.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.bigquery.analyticshub.v1.CreateListingRequest) { + return mergeFrom((com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getListingId().isEmpty()) { + listingId_ = other.listingId_; + onChanged(); + } + if (other.hasListing()) { + mergeListing(other.getListing()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + listingId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + input.readMessage(getListingFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource path of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource path of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource path of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource path of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource path of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object listingId_ = ""; + /** + * + * + *
+     * Required. The ID of the listing to create.
+     * Must contain only Unicode letters, numbers (0-9), underscores (_).
+     * Should not use characters that require URL-escaping, or characters
+     * outside of ASCII, spaces.
+     * Max length: 100 bytes.
+     * 
+ * + * string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The listingId. + */ + public java.lang.String getListingId() { + java.lang.Object ref = listingId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + listingId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID of the listing to create.
+     * Must contain only Unicode letters, numbers (0-9), underscores (_).
+     * Should not use characters that require URL-escaping, or characters
+     * outside of ASCII, spaces.
+     * Max length: 100 bytes.
+     * 
+ * + * string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for listingId. + */ + public com.google.protobuf.ByteString getListingIdBytes() { + java.lang.Object ref = listingId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + listingId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID of the listing to create.
+     * Must contain only Unicode letters, numbers (0-9), underscores (_).
+     * Should not use characters that require URL-escaping, or characters
+     * outside of ASCII, spaces.
+     * Max length: 100 bytes.
+     * 
+ * + * string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The listingId to set. + * @return This builder for chaining. + */ + public Builder setListingId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + listingId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the listing to create.
+     * Must contain only Unicode letters, numbers (0-9), underscores (_).
+     * Should not use characters that require URL-escaping, or characters
+     * outside of ASCII, spaces.
+     * Max length: 100 bytes.
+     * 
+ * + * string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearListingId() { + + listingId_ = getDefaultInstance().getListingId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the listing to create.
+     * Must contain only Unicode letters, numbers (0-9), underscores (_).
+     * Should not use characters that require URL-escaping, or characters
+     * outside of ASCII, spaces.
+     * Max length: 100 bytes.
+     * 
+ * + * string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for listingId to set. + * @return This builder for chaining. + */ + public Builder setListingIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + listingId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.bigquery.analyticshub.v1.Listing listing_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Listing, + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder, + com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder> + listingBuilder_; + /** + * + * + *
+     * Required. The listing to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the listing field is set. + */ + public boolean hasListing() { + return listingBuilder_ != null || listing_ != null; + } + /** + * + * + *
+     * Required. The listing to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The listing. + */ + public com.google.cloud.bigquery.analyticshub.v1.Listing getListing() { + if (listingBuilder_ == null) { + return listing_ == null + ? com.google.cloud.bigquery.analyticshub.v1.Listing.getDefaultInstance() + : listing_; + } else { + return listingBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The listing to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setListing(com.google.cloud.bigquery.analyticshub.v1.Listing value) { + if (listingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + listing_ = value; + onChanged(); + } else { + listingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The listing to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setListing( + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder builderForValue) { + if (listingBuilder_ == null) { + listing_ = builderForValue.build(); + onChanged(); + } else { + listingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The listing to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeListing(com.google.cloud.bigquery.analyticshub.v1.Listing value) { + if (listingBuilder_ == null) { + if (listing_ != null) { + listing_ = + com.google.cloud.bigquery.analyticshub.v1.Listing.newBuilder(listing_) + .mergeFrom(value) + .buildPartial(); + } else { + listing_ = value; + } + onChanged(); + } else { + listingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The listing to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearListing() { + if (listingBuilder_ == null) { + listing_ = null; + onChanged(); + } else { + listing_ = null; + listingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The listing to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.Listing.Builder getListingBuilder() { + + onChanged(); + return getListingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The listing to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder getListingOrBuilder() { + if (listingBuilder_ != null) { + return listingBuilder_.getMessageOrBuilder(); + } else { + return listing_ == null + ? com.google.cloud.bigquery.analyticshub.v1.Listing.getDefaultInstance() + : listing_; + } + } + /** + * + * + *
+     * Required. The listing to create.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Listing, + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder, + com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder> + getListingFieldBuilder() { + if (listingBuilder_ == null) { + listingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Listing, + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder, + com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder>( + getListing(), getParentForChildren(), isClean()); + listing_ = null; + } + return listingBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(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.bigquery.analyticshub.v1.CreateListingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.CreateListingRequest) + private static final com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.CreateListingRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateListingRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.CreateListingRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateListingRequestOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateListingRequestOrBuilder.java new file mode 100644 index 000000000000..865400648535 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/CreateListingRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface CreateListingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.CreateListingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource path of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource path of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID of the listing to create.
+   * Must contain only Unicode letters, numbers (0-9), underscores (_).
+   * Should not use characters that require URL-escaping, or characters
+   * outside of ASCII, spaces.
+   * Max length: 100 bytes.
+   * 
+ * + * string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The listingId. + */ + java.lang.String getListingId(); + /** + * + * + *
+   * Required. The ID of the listing to create.
+   * Must contain only Unicode letters, numbers (0-9), underscores (_).
+   * Should not use characters that require URL-escaping, or characters
+   * outside of ASCII, spaces.
+   * Max length: 100 bytes.
+   * 
+ * + * string listing_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for listingId. + */ + com.google.protobuf.ByteString getListingIdBytes(); + + /** + * + * + *
+   * Required. The listing to create.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the listing field is set. + */ + boolean hasListing(); + /** + * + * + *
+   * Required. The listing to create.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The listing. + */ + com.google.cloud.bigquery.analyticshub.v1.Listing getListing(); + /** + * + * + *
+   * Required. The listing to create.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder getListingOrBuilder(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataExchange.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataExchange.java new file mode 100644 index 000000000000..88b51cadd85e --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataExchange.java @@ -0,0 +1,1604 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * A data exchange is a container that lets you share data. Along with the
+ * descriptive information about the data exchange, it contains listings that
+ * reference shared datasets.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.DataExchange} + */ +public final class DataExchange extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.DataExchange) + DataExchangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use DataExchange.newBuilder() to construct. + private DataExchange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DataExchange() { + name_ = ""; + displayName_ = ""; + description_ = ""; + primaryContact_ = ""; + documentation_ = ""; + icon_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DataExchange(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DataExchange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DataExchange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.DataExchange.class, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the data exchange.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * 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 data exchange.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * 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_; + /** + * + * + *
+   * Required. Human-readable display name of the data exchange. The display name must
+   * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
+   * spaces ( ), ampersands (&) and must not start or end with spaces.
+   * Default value is an empty string.
+   * Max length: 63 bytes.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Human-readable display name of the data exchange. The display name must
+   * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
+   * spaces ( ), ampersands (&) and must not start or end with spaces.
+   * Default value is an empty string.
+   * Max length: 63 bytes.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Optional. Description of the data exchange. The description must not contain Unicode
+   * non-characters as well as C0 and C1 control codes except tabs (HT),
+   * new lines (LF), carriage returns (CR), and page breaks (FF).
+   * Default value is an empty string.
+   * Max length: 2000 bytes.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Description of the data exchange. The description must not contain Unicode
+   * non-characters as well as C0 and C1 control codes except tabs (HT),
+   * new lines (LF), carriage returns (CR), and page breaks (FF).
+   * Default value is an empty string.
+   * Max length: 2000 bytes.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIMARY_CONTACT_FIELD_NUMBER = 4; + private volatile java.lang.Object primaryContact_; + /** + * + * + *
+   * Optional. Email or URL of the primary point of contact of the data exchange.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryContact. + */ + @java.lang.Override + public java.lang.String getPrimaryContact() { + java.lang.Object ref = primaryContact_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryContact_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Email or URL of the primary point of contact of the data exchange.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryContact. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrimaryContactBytes() { + java.lang.Object ref = primaryContact_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryContact_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENTATION_FIELD_NUMBER = 5; + private volatile java.lang.Object documentation_; + /** + * + * + *
+   * Optional. Documentation describing the data exchange.
+   * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The documentation. + */ + @java.lang.Override + public java.lang.String getDocumentation() { + java.lang.Object ref = documentation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentation_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Documentation describing the data exchange.
+   * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for documentation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDocumentationBytes() { + java.lang.Object ref = documentation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LISTING_COUNT_FIELD_NUMBER = 6; + private int listingCount_; + /** + * + * + *
+   * Output only. Number of listings contained in the data exchange.
+   * 
+ * + * int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The listingCount. + */ + @java.lang.Override + public int getListingCount() { + return listingCount_; + } + + public static final int ICON_FIELD_NUMBER = 7; + private com.google.protobuf.ByteString icon_; + /** + * + * + *
+   * Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB
+   * Expected image dimensions are 512x512 pixels, however the API only
+   * performs validation on size of the encoded data.
+   * Note: For byte fields, the content of the fields are base64-encoded (which
+   * increases the size of the data by 33-36%) when using JSON on the wire.
+   * 
+ * + * bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The icon. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIcon() { + return icon_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryContact_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, primaryContact_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, documentation_); + } + if (listingCount_ != 0) { + output.writeInt32(6, listingCount_); + } + if (!icon_.isEmpty()) { + output.writeBytes(7, icon_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryContact_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, primaryContact_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, documentation_); + } + if (listingCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, listingCount_); + } + if (!icon_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(7, icon_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = 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.bigquery.analyticshub.v1.DataExchange)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.DataExchange other = + (com.google.cloud.bigquery.analyticshub.v1.DataExchange) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getPrimaryContact().equals(other.getPrimaryContact())) return false; + if (!getDocumentation().equals(other.getDocumentation())) return false; + if (getListingCount() != other.getListingCount()) return false; + if (!getIcon().equals(other.getIcon())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + PRIMARY_CONTACT_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryContact().hashCode(); + hash = (37 * hash) + DOCUMENTATION_FIELD_NUMBER; + hash = (53 * hash) + getDocumentation().hashCode(); + hash = (37 * hash) + LISTING_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getListingCount(); + hash = (37 * hash) + ICON_FIELD_NUMBER; + hash = (53 * hash) + getIcon().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataExchange parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataExchange 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.bigquery.analyticshub.v1.DataExchange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataExchange parseFrom( + 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.bigquery.analyticshub.v1.DataExchange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataExchange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataExchange parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataExchange parseFrom( + java.io.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.bigquery.analyticshub.v1.DataExchange parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataExchange parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.DataExchange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataExchange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.DataExchange prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A data exchange is a container that lets you share data. Along with the
+   * descriptive information about the data exchange, it contains listings that
+   * reference shared datasets.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.DataExchange} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.DataExchange) + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DataExchange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DataExchange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.DataExchange.class, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder.class); + } + + // Construct using com.google.cloud.bigquery.analyticshub.v1.DataExchange.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + description_ = ""; + + primaryContact_ = ""; + + documentation_ = ""; + + listingCount_ = 0; + + icon_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DataExchange_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataExchange getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.DataExchange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataExchange build() { + com.google.cloud.bigquery.analyticshub.v1.DataExchange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataExchange buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.DataExchange result = + new com.google.cloud.bigquery.analyticshub.v1.DataExchange(this); + result.name_ = name_; + result.displayName_ = displayName_; + result.description_ = description_; + result.primaryContact_ = primaryContact_; + result.documentation_ = documentation_; + result.listingCount_ = listingCount_; + result.icon_ = icon_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.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.bigquery.analyticshub.v1.DataExchange) { + return mergeFrom((com.google.cloud.bigquery.analyticshub.v1.DataExchange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.analyticshub.v1.DataExchange other) { + if (other == com.google.cloud.bigquery.analyticshub.v1.DataExchange.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.getPrimaryContact().isEmpty()) { + primaryContact_ = other.primaryContact_; + onChanged(); + } + if (!other.getDocumentation().isEmpty()) { + documentation_ = other.documentation_; + onChanged(); + } + if (other.getListingCount() != 0) { + setListingCount(other.getListingCount()); + } + if (other.getIcon() != com.google.protobuf.ByteString.EMPTY) { + setIcon(other.getIcon()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + primaryContact_ = input.readStringRequireUtf8(); + + break; + } // case 34 + case 42: + { + documentation_ = input.readStringRequireUtf8(); + + break; + } // case 42 + case 48: + { + listingCount_ = input.readInt32(); + + break; + } // case 48 + case 58: + { + icon_ = input.readBytes(); + + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the data exchange.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * 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 data exchange.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * 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 data exchange.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * 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 data exchange.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * 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 data exchange.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * 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_ = ""; + /** + * + * + *
+     * Required. Human-readable display name of the data exchange. The display name must
+     * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
+     * spaces ( ), ampersands (&) and must not start or end with spaces.
+     * Default value is an empty string.
+     * Max length: 63 bytes.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Human-readable display name of the data exchange. The display name must
+     * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
+     * spaces ( ), ampersands (&) and must not start or end with spaces.
+     * Default value is an empty string.
+     * Max length: 63 bytes.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Human-readable display name of the data exchange. The display name must
+     * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
+     * spaces ( ), ampersands (&) and must not start or end with spaces.
+     * Default value is an empty string.
+     * Max length: 63 bytes.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Human-readable display name of the data exchange. The display name must
+     * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
+     * spaces ( ), ampersands (&) and must not start or end with spaces.
+     * Default value is an empty string.
+     * Max length: 63 bytes.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Human-readable display name of the data exchange. The display name must
+     * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
+     * spaces ( ), ampersands (&) and must not start or end with spaces.
+     * Default value is an empty string.
+     * Max length: 63 bytes.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. Description of the data exchange. The description must not contain Unicode
+     * non-characters as well as C0 and C1 control codes except tabs (HT),
+     * new lines (LF), carriage returns (CR), and page breaks (FF).
+     * Default value is an empty string.
+     * Max length: 2000 bytes.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Description of the data exchange. The description must not contain Unicode
+     * non-characters as well as C0 and C1 control codes except tabs (HT),
+     * new lines (LF), carriage returns (CR), and page breaks (FF).
+     * Default value is an empty string.
+     * Max length: 2000 bytes.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Description of the data exchange. The description must not contain Unicode
+     * non-characters as well as C0 and C1 control codes except tabs (HT),
+     * new lines (LF), carriage returns (CR), and page breaks (FF).
+     * Default value is an empty string.
+     * Max length: 2000 bytes.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Description of the data exchange. The description must not contain Unicode
+     * non-characters as well as C0 and C1 control codes except tabs (HT),
+     * new lines (LF), carriage returns (CR), and page breaks (FF).
+     * Default value is an empty string.
+     * Max length: 2000 bytes.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Description of the data exchange. The description must not contain Unicode
+     * non-characters as well as C0 and C1 control codes except tabs (HT),
+     * new lines (LF), carriage returns (CR), and page breaks (FF).
+     * Default value is an empty string.
+     * Max length: 2000 bytes.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object primaryContact_ = ""; + /** + * + * + *
+     * Optional. Email or URL of the primary point of contact of the data exchange.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryContact. + */ + public java.lang.String getPrimaryContact() { + java.lang.Object ref = primaryContact_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryContact_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Email or URL of the primary point of contact of the data exchange.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryContact. + */ + public com.google.protobuf.ByteString getPrimaryContactBytes() { + java.lang.Object ref = primaryContact_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryContact_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Email or URL of the primary point of contact of the data exchange.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The primaryContact to set. + * @return This builder for chaining. + */ + public Builder setPrimaryContact(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + primaryContact_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Email or URL of the primary point of contact of the data exchange.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPrimaryContact() { + + primaryContact_ = getDefaultInstance().getPrimaryContact(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Email or URL of the primary point of contact of the data exchange.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for primaryContact to set. + * @return This builder for chaining. + */ + public Builder setPrimaryContactBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + primaryContact_ = value; + onChanged(); + return this; + } + + private java.lang.Object documentation_ = ""; + /** + * + * + *
+     * Optional. Documentation describing the data exchange.
+     * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The documentation. + */ + public java.lang.String getDocumentation() { + java.lang.Object ref = documentation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Documentation describing the data exchange.
+     * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for documentation. + */ + public com.google.protobuf.ByteString getDocumentationBytes() { + java.lang.Object ref = documentation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Documentation describing the data exchange.
+     * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The documentation to set. + * @return This builder for chaining. + */ + public Builder setDocumentation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + documentation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Documentation describing the data exchange.
+     * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDocumentation() { + + documentation_ = getDefaultInstance().getDocumentation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Documentation describing the data exchange.
+     * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for documentation to set. + * @return This builder for chaining. + */ + public Builder setDocumentationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + documentation_ = value; + onChanged(); + return this; + } + + private int listingCount_; + /** + * + * + *
+     * Output only. Number of listings contained in the data exchange.
+     * 
+ * + * int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The listingCount. + */ + @java.lang.Override + public int getListingCount() { + return listingCount_; + } + /** + * + * + *
+     * Output only. Number of listings contained in the data exchange.
+     * 
+ * + * int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The listingCount to set. + * @return This builder for chaining. + */ + public Builder setListingCount(int value) { + + listingCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Number of listings contained in the data exchange.
+     * 
+ * + * int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearListingCount() { + + listingCount_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString icon_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB
+     * Expected image dimensions are 512x512 pixels, however the API only
+     * performs validation on size of the encoded data.
+     * Note: For byte fields, the content of the fields are base64-encoded (which
+     * increases the size of the data by 33-36%) when using JSON on the wire.
+     * 
+ * + * bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The icon. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIcon() { + return icon_; + } + /** + * + * + *
+     * Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB
+     * Expected image dimensions are 512x512 pixels, however the API only
+     * performs validation on size of the encoded data.
+     * Note: For byte fields, the content of the fields are base64-encoded (which
+     * increases the size of the data by 33-36%) when using JSON on the wire.
+     * 
+ * + * bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The icon to set. + * @return This builder for chaining. + */ + public Builder setIcon(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + icon_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB
+     * Expected image dimensions are 512x512 pixels, however the API only
+     * performs validation on size of the encoded data.
+     * Note: For byte fields, the content of the fields are base64-encoded (which
+     * increases the size of the data by 33-36%) when using JSON on the wire.
+     * 
+ * + * bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearIcon() { + + icon_ = getDefaultInstance().getIcon(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(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.bigquery.analyticshub.v1.DataExchange) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.DataExchange) + private static final com.google.cloud.bigquery.analyticshub.v1.DataExchange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.DataExchange(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataExchange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataExchange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.DataExchange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataExchangeName.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataExchangeName.java new file mode 100644 index 000000000000..dc02da5133a9 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataExchangeName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class DataExchangeName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_DATA_EXCHANGE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/dataExchanges/{data_exchange}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String dataExchange; + + @Deprecated + protected DataExchangeName() { + project = null; + location = null; + dataExchange = null; + } + + private DataExchangeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + dataExchange = Preconditions.checkNotNull(builder.getDataExchange()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataExchange() { + return dataExchange; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static DataExchangeName of(String project, String location, String dataExchange) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataExchange(dataExchange) + .build(); + } + + public static String format(String project, String location, String dataExchange) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataExchange(dataExchange) + .build() + .toString(); + } + + public static DataExchangeName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_DATA_EXCHANGE.validatedMatch( + formattedString, "DataExchangeName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("data_exchange")); + } + + 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 (DataExchangeName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DATA_EXCHANGE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (dataExchange != null) { + fieldMapBuilder.put("data_exchange", dataExchange); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_DATA_EXCHANGE.instantiate( + "project", project, "location", location, "data_exchange", dataExchange); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + DataExchangeName that = ((DataExchangeName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.dataExchange, that.dataExchange); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(dataExchange); + return h; + } + + /** Builder for projects/{project}/locations/{location}/dataExchanges/{data_exchange}. */ + public static class Builder { + private String project; + private String location; + private String dataExchange; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataExchange() { + return dataExchange; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDataExchange(String dataExchange) { + this.dataExchange = dataExchange; + return this; + } + + private Builder(DataExchangeName dataExchangeName) { + this.project = dataExchangeName.project; + this.location = dataExchangeName.location; + this.dataExchange = dataExchangeName.dataExchange; + } + + public DataExchangeName build() { + return new DataExchangeName(this); + } + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataExchangeOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataExchangeOrBuilder.java new file mode 100644 index 000000000000..380916516fb7 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataExchangeOrBuilder.java @@ -0,0 +1,200 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface DataExchangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.DataExchange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the data exchange.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the data exchange.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Human-readable display name of the data exchange. The display name must
+   * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
+   * spaces ( ), ampersands (&) and must not start or end with spaces.
+   * Default value is an empty string.
+   * Max length: 63 bytes.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. Human-readable display name of the data exchange. The display name must
+   * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
+   * spaces ( ), ampersands (&) and must not start or end with spaces.
+   * Default value is an empty string.
+   * Max length: 63 bytes.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Optional. Description of the data exchange. The description must not contain Unicode
+   * non-characters as well as C0 and C1 control codes except tabs (HT),
+   * new lines (LF), carriage returns (CR), and page breaks (FF).
+   * Default value is an empty string.
+   * Max length: 2000 bytes.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. Description of the data exchange. The description must not contain Unicode
+   * non-characters as well as C0 and C1 control codes except tabs (HT),
+   * new lines (LF), carriage returns (CR), and page breaks (FF).
+   * Default value is an empty string.
+   * Max length: 2000 bytes.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Optional. Email or URL of the primary point of contact of the data exchange.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryContact. + */ + java.lang.String getPrimaryContact(); + /** + * + * + *
+   * Optional. Email or URL of the primary point of contact of the data exchange.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryContact. + */ + com.google.protobuf.ByteString getPrimaryContactBytes(); + + /** + * + * + *
+   * Optional. Documentation describing the data exchange.
+   * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The documentation. + */ + java.lang.String getDocumentation(); + /** + * + * + *
+   * Optional. Documentation describing the data exchange.
+   * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for documentation. + */ + com.google.protobuf.ByteString getDocumentationBytes(); + + /** + * + * + *
+   * Output only. Number of listings contained in the data exchange.
+   * 
+ * + * int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The listingCount. + */ + int getListingCount(); + + /** + * + * + *
+   * Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB
+   * Expected image dimensions are 512x512 pixels, however the API only
+   * performs validation on size of the encoded data.
+   * Note: For byte fields, the content of the fields are base64-encoded (which
+   * increases the size of the data by 33-36%) when using JSON on the wire.
+   * 
+ * + * bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The icon. + */ + com.google.protobuf.ByteString getIcon(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataProvider.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataProvider.java new file mode 100644 index 000000000000..7af9f7b84d93 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataProvider.java @@ -0,0 +1,801 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Contains details of the data provider.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.DataProvider} + */ +public final class DataProvider extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.DataProvider) + DataProviderOrBuilder { + private static final long serialVersionUID = 0L; + // Use DataProvider.newBuilder() to construct. + private DataProvider(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DataProvider() { + name_ = ""; + primaryContact_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DataProvider(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DataProvider_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DataProvider_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.DataProvider.class, + com.google.cloud.bigquery.analyticshub.v1.DataProvider.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Optional. Name of the data provider.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Name of the data provider.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 PRIMARY_CONTACT_FIELD_NUMBER = 2; + private volatile java.lang.Object primaryContact_; + /** + * + * + *
+   * Optional. Email or URL of the data provider.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryContact. + */ + @java.lang.Override + public java.lang.String getPrimaryContact() { + java.lang.Object ref = primaryContact_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryContact_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Email or URL of the data provider.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryContact. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrimaryContactBytes() { + java.lang.Object ref = primaryContact_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryContact_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryContact_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, primaryContact_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryContact_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, primaryContact_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = 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.bigquery.analyticshub.v1.DataProvider)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.DataProvider other = + (com.google.cloud.bigquery.analyticshub.v1.DataProvider) obj; + + if (!getName().equals(other.getName())) return false; + if (!getPrimaryContact().equals(other.getPrimaryContact())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PRIMARY_CONTACT_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryContact().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataProvider parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataProvider 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.bigquery.analyticshub.v1.DataProvider parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataProvider parseFrom( + 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.bigquery.analyticshub.v1.DataProvider parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataProvider parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataProvider parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataProvider parseFrom( + java.io.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.bigquery.analyticshub.v1.DataProvider parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataProvider parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.DataProvider parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataProvider parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.DataProvider prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Contains details of the data provider.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.DataProvider} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.DataProvider) + com.google.cloud.bigquery.analyticshub.v1.DataProviderOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DataProvider_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DataProvider_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.DataProvider.class, + com.google.cloud.bigquery.analyticshub.v1.DataProvider.Builder.class); + } + + // Construct using com.google.cloud.bigquery.analyticshub.v1.DataProvider.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + primaryContact_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DataProvider_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataProvider getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.DataProvider.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataProvider build() { + com.google.cloud.bigquery.analyticshub.v1.DataProvider result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataProvider buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.DataProvider result = + new com.google.cloud.bigquery.analyticshub.v1.DataProvider(this); + result.name_ = name_; + result.primaryContact_ = primaryContact_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.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.bigquery.analyticshub.v1.DataProvider) { + return mergeFrom((com.google.cloud.bigquery.analyticshub.v1.DataProvider) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.analyticshub.v1.DataProvider other) { + if (other == com.google.cloud.bigquery.analyticshub.v1.DataProvider.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getPrimaryContact().isEmpty()) { + primaryContact_ = other.primaryContact_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + primaryContact_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Optional. Name of the data provider.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Name of the data provider.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Name of the data provider.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. Name of the data provider.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Name of the data provider.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 primaryContact_ = ""; + /** + * + * + *
+     * Optional. Email or URL of the data provider.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryContact. + */ + public java.lang.String getPrimaryContact() { + java.lang.Object ref = primaryContact_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryContact_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Email or URL of the data provider.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryContact. + */ + public com.google.protobuf.ByteString getPrimaryContactBytes() { + java.lang.Object ref = primaryContact_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryContact_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Email or URL of the data provider.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The primaryContact to set. + * @return This builder for chaining. + */ + public Builder setPrimaryContact(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + primaryContact_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Email or URL of the data provider.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPrimaryContact() { + + primaryContact_ = getDefaultInstance().getPrimaryContact(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Email or URL of the data provider.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for primaryContact to set. + * @return This builder for chaining. + */ + public Builder setPrimaryContactBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + primaryContact_ = 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.bigquery.analyticshub.v1.DataProvider) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.DataProvider) + private static final com.google.cloud.bigquery.analyticshub.v1.DataProvider DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.DataProvider(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DataProvider getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataProvider parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.DataProvider getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataProviderOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataProviderOrBuilder.java new file mode 100644 index 000000000000..5e5fb5c1f4af --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DataProviderOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface DataProviderOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.DataProvider) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Name of the data provider.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Optional. Name of the data provider.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Email or URL of the data provider.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryContact. + */ + java.lang.String getPrimaryContact(); + /** + * + * + *
+   * Optional. Email or URL of the data provider.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryContact. + */ + com.google.protobuf.ByteString getPrimaryContactBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteDataExchangeRequest.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteDataExchangeRequest.java new file mode 100644 index 000000000000..4e3b3942488b --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteDataExchangeRequest.java @@ -0,0 +1,647 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for deleting a data exchange.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest} + */ +public final class DeleteDataExchangeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest) + DeleteDataExchangeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDataExchangeRequest.newBuilder() to construct. + private DeleteDataExchangeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDataExchangeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDataExchangeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DeleteDataExchangeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DeleteDataExchangeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest.class, + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The full name of the data exchange resource that you want to delete.
+   * For example, `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The full name of the data exchange resource that you want to delete.
+   * For example, `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest other = + (com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest 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.bigquery.analyticshub.v1.DeleteDataExchangeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest parseFrom( + 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.bigquery.analyticshub.v1.DeleteDataExchangeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest parseFrom( + java.io.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.bigquery.analyticshub.v1.DeleteDataExchangeRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest + parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.DeleteDataExchangeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.DeleteDataExchangeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for deleting a data exchange.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest) + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DeleteDataExchangeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DeleteDataExchangeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest.class, + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DeleteDataExchangeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest build() { + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest result = + new com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest) { + return mergeFrom( + (com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The full name of the data exchange resource that you want to delete.
+     * For example, `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The full name of the data exchange resource that you want to delete.
+     * For example, `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The full name of the data exchange resource that you want to delete.
+     * For example, `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full name of the data exchange resource that you want to delete.
+     * For example, `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full name of the data exchange resource that you want to delete.
+     * For example, `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest) + private static final com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDataExchangeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.DeleteDataExchangeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteDataExchangeRequestOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteDataExchangeRequestOrBuilder.java new file mode 100644 index 000000000000..28a5083b97a1 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteDataExchangeRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface DeleteDataExchangeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full name of the data exchange resource that you want to delete.
+   * For example, `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The full name of the data exchange resource that you want to delete.
+   * For example, `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteListingRequest.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteListingRequest.java new file mode 100644 index 000000000000..d0117f5cbebc --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteListingRequest.java @@ -0,0 +1,642 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for deleting a listing.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.DeleteListingRequest} + */ +public final class DeleteListingRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.DeleteListingRequest) + DeleteListingRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteListingRequest.newBuilder() to construct. + private DeleteListingRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteListingRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteListingRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DeleteListingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DeleteListingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest.class, + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Resource name of the listing to delete.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name of the listing to delete.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest other = + (com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest 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.bigquery.analyticshub.v1.DeleteListingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest parseFrom( + 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.bigquery.analyticshub.v1.DeleteListingRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest parseFrom( + java.io.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.bigquery.analyticshub.v1.DeleteListingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.DeleteListingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.DeleteListingRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for deleting a listing.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.DeleteListingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.DeleteListingRequest) + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DeleteListingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DeleteListingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest.class, + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DeleteListingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest build() { + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest result = + new com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest) { + return mergeFrom((com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name of the listing to delete.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the listing to delete.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the listing to delete.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the listing to delete.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the listing to delete.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.analyticshub.v1.DeleteListingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.DeleteListingRequest) + private static final com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteListingRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.DeleteListingRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteListingRequestOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteListingRequestOrBuilder.java new file mode 100644 index 000000000000..354053741df6 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DeleteListingRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface DeleteListingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.DeleteListingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the listing to delete.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name of the listing to delete.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDataset.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDataset.java new file mode 100644 index 000000000000..6eb92478b66d --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDataset.java @@ -0,0 +1,1870 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Defines the destination bigquery dataset.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.DestinationDataset} + */ +public final class DestinationDataset extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.DestinationDataset) + DestinationDatasetOrBuilder { + private static final long serialVersionUID = 0L; + // Use DestinationDataset.newBuilder() to construct. + private DestinationDataset(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DestinationDataset() { + location_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DestinationDataset(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.class, + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.Builder.class); + } + + public static final int DATASET_REFERENCE_FIELD_NUMBER = 1; + private com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference datasetReference_; + /** + * + * + *
+   * Required. A reference that identifies the destination dataset.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the datasetReference field is set. + */ + @java.lang.Override + public boolean hasDatasetReference() { + return datasetReference_ != null; + } + /** + * + * + *
+   * Required. A reference that identifies the destination dataset.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The datasetReference. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference + getDatasetReference() { + return datasetReference_ == null + ? com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference.getDefaultInstance() + : datasetReference_; + } + /** + * + * + *
+   * Required. A reference that identifies the destination dataset.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReferenceOrBuilder + getDatasetReferenceOrBuilder() { + return getDatasetReference(); + } + + public static final int FRIENDLY_NAME_FIELD_NUMBER = 2; + private com.google.protobuf.StringValue friendlyName_; + /** + * + * + *
+   * Optional. A descriptive name for the dataset.
+   * 
+ * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the friendlyName field is set. + */ + @java.lang.Override + public boolean hasFriendlyName() { + return friendlyName_ != null; + } + /** + * + * + *
+   * Optional. A descriptive name for the dataset.
+   * 
+ * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The friendlyName. + */ + @java.lang.Override + public com.google.protobuf.StringValue getFriendlyName() { + return friendlyName_ == null + ? com.google.protobuf.StringValue.getDefaultInstance() + : friendlyName_; + } + /** + * + * + *
+   * Optional. A descriptive name for the dataset.
+   * 
+ * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.StringValueOrBuilder getFriendlyNameOrBuilder() { + return getFriendlyName(); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private com.google.protobuf.StringValue description_; + /** + * + * + *
+   * Optional. A user-friendly description of the dataset.
+   * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the description field is set. + */ + @java.lang.Override + public boolean hasDescription() { + return description_ != null; + } + /** + * + * + *
+   * Optional. A user-friendly description of the dataset.
+   * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The description. + */ + @java.lang.Override + public com.google.protobuf.StringValue getDescription() { + return description_ == null + ? com.google.protobuf.StringValue.getDefaultInstance() + : description_; + } + /** + * + * + *
+   * Optional. A user-friendly description of the dataset.
+   * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.StringValueOrBuilder getDescriptionOrBuilder() { + return getDescription(); + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Optional. The labels associated with this dataset. You can use these
+   * to organize and group your datasets.
+   * You can set this property when inserting or updating a dataset.
+   * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+   * for more information.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional. The labels associated with this dataset. You can use these
+   * to organize and group your datasets.
+   * You can set this property when inserting or updating a dataset.
+   * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+   * for more information.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. The labels associated with this dataset. You can use these
+   * to organize and group your datasets.
+   * You can set this property when inserting or updating a dataset.
+   * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+   * for more information.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The labels associated with this dataset. You can use these
+   * to organize and group your datasets.
+   * You can set this property when inserting or updating a dataset.
+   * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+   * for more information.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int LOCATION_FIELD_NUMBER = 5; + private volatile java.lang.Object location_; + /** + * + * + *
+   * Required. The geographic location where the dataset should reside. See
+   * https://cloud.google.com/bigquery/docs/locations for supported
+   * locations.
+   * 
+ * + * string location = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The geographic location where the dataset should reside. See
+   * https://cloud.google.com/bigquery/docs/locations for supported
+   * locations.
+   * 
+ * + * string location = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = 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 (datasetReference_ != null) { + output.writeMessage(1, getDatasetReference()); + } + if (friendlyName_ != null) { + output.writeMessage(2, getFriendlyName()); + } + if (description_ != null) { + output.writeMessage(3, getDescription()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, location_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (datasetReference_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDatasetReference()); + } + if (friendlyName_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFriendlyName()); + } + if (description_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getDescription()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, location_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = 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.bigquery.analyticshub.v1.DestinationDataset)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset other = + (com.google.cloud.bigquery.analyticshub.v1.DestinationDataset) obj; + + if (hasDatasetReference() != other.hasDatasetReference()) return false; + if (hasDatasetReference()) { + if (!getDatasetReference().equals(other.getDatasetReference())) return false; + } + if (hasFriendlyName() != other.hasFriendlyName()) return false; + if (hasFriendlyName()) { + if (!getFriendlyName().equals(other.getFriendlyName())) return false; + } + if (hasDescription() != other.hasDescription()) return false; + if (hasDescription()) { + if (!getDescription().equals(other.getDescription())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDatasetReference()) { + hash = (37 * hash) + DATASET_REFERENCE_FIELD_NUMBER; + hash = (53 * hash) + getDatasetReference().hashCode(); + } + if (hasFriendlyName()) { + hash = (37 * hash) + FRIENDLY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFriendlyName().hashCode(); + } + if (hasDescription()) { + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDataset parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDataset 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.bigquery.analyticshub.v1.DestinationDataset parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDataset parseFrom( + 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.bigquery.analyticshub.v1.DestinationDataset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDataset parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDataset parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDataset parseFrom( + java.io.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.bigquery.analyticshub.v1.DestinationDataset parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDataset parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.DestinationDataset parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDataset parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.DestinationDataset prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 destination bigquery dataset.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.DestinationDataset} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.DestinationDataset) + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.class, + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.Builder.class); + } + + // Construct using com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (datasetReferenceBuilder_ == null) { + datasetReference_ = null; + } else { + datasetReference_ = null; + datasetReferenceBuilder_ = null; + } + if (friendlyNameBuilder_ == null) { + friendlyName_ = null; + } else { + friendlyName_ = null; + friendlyNameBuilder_ = null; + } + if (descriptionBuilder_ == null) { + description_ = null; + } else { + description_ = null; + descriptionBuilder_ = null; + } + internalGetMutableLabels().clear(); + location_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDataset_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DestinationDataset + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DestinationDataset build() { + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DestinationDataset buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset result = + new com.google.cloud.bigquery.analyticshub.v1.DestinationDataset(this); + int from_bitField0_ = bitField0_; + if (datasetReferenceBuilder_ == null) { + result.datasetReference_ = datasetReference_; + } else { + result.datasetReference_ = datasetReferenceBuilder_.build(); + } + if (friendlyNameBuilder_ == null) { + result.friendlyName_ = friendlyName_; + } else { + result.friendlyName_ = friendlyNameBuilder_.build(); + } + if (descriptionBuilder_ == null) { + result.description_ = description_; + } else { + result.description_ = descriptionBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.location_ = location_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.analyticshub.v1.DestinationDataset) { + return mergeFrom((com.google.cloud.bigquery.analyticshub.v1.DestinationDataset) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.analyticshub.v1.DestinationDataset other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.getDefaultInstance()) + return this; + if (other.hasDatasetReference()) { + mergeDatasetReference(other.getDatasetReference()); + } + if (other.hasFriendlyName()) { + mergeFriendlyName(other.getFriendlyName()); + } + if (other.hasDescription()) { + mergeDescription(other.getDescription()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getDatasetReferenceFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getFriendlyNameFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getDescriptionFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + break; + } // case 34 + case 42: + { + location_ = input.readStringRequireUtf8(); + + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference datasetReference_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference, + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference.Builder, + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReferenceOrBuilder> + datasetReferenceBuilder_; + /** + * + * + *
+     * Required. A reference that identifies the destination dataset.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the datasetReference field is set. + */ + public boolean hasDatasetReference() { + return datasetReferenceBuilder_ != null || datasetReference_ != null; + } + /** + * + * + *
+     * Required. A reference that identifies the destination dataset.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The datasetReference. + */ + public com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference + getDatasetReference() { + if (datasetReferenceBuilder_ == null) { + return datasetReference_ == null + ? com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference + .getDefaultInstance() + : datasetReference_; + } else { + return datasetReferenceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A reference that identifies the destination dataset.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDatasetReference( + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference value) { + if (datasetReferenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + datasetReference_ = value; + onChanged(); + } else { + datasetReferenceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A reference that identifies the destination dataset.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDatasetReference( + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference.Builder + builderForValue) { + if (datasetReferenceBuilder_ == null) { + datasetReference_ = builderForValue.build(); + onChanged(); + } else { + datasetReferenceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A reference that identifies the destination dataset.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDatasetReference( + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference value) { + if (datasetReferenceBuilder_ == null) { + if (datasetReference_ != null) { + datasetReference_ = + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference.newBuilder( + datasetReference_) + .mergeFrom(value) + .buildPartial(); + } else { + datasetReference_ = value; + } + onChanged(); + } else { + datasetReferenceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A reference that identifies the destination dataset.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDatasetReference() { + if (datasetReferenceBuilder_ == null) { + datasetReference_ = null; + onChanged(); + } else { + datasetReference_ = null; + datasetReferenceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A reference that identifies the destination dataset.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference.Builder + getDatasetReferenceBuilder() { + + onChanged(); + return getDatasetReferenceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A reference that identifies the destination dataset.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReferenceOrBuilder + getDatasetReferenceOrBuilder() { + if (datasetReferenceBuilder_ != null) { + return datasetReferenceBuilder_.getMessageOrBuilder(); + } else { + return datasetReference_ == null + ? com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference + .getDefaultInstance() + : datasetReference_; + } + } + /** + * + * + *
+     * Required. A reference that identifies the destination dataset.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference, + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference.Builder, + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReferenceOrBuilder> + getDatasetReferenceFieldBuilder() { + if (datasetReferenceBuilder_ == null) { + datasetReferenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference, + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference.Builder, + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReferenceOrBuilder>( + getDatasetReference(), getParentForChildren(), isClean()); + datasetReference_ = null; + } + return datasetReferenceBuilder_; + } + + private com.google.protobuf.StringValue friendlyName_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.StringValue, + com.google.protobuf.StringValue.Builder, + com.google.protobuf.StringValueOrBuilder> + friendlyNameBuilder_; + /** + * + * + *
+     * Optional. A descriptive name for the dataset.
+     * 
+ * + * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the friendlyName field is set. + */ + public boolean hasFriendlyName() { + return friendlyNameBuilder_ != null || friendlyName_ != null; + } + /** + * + * + *
+     * Optional. A descriptive name for the dataset.
+     * 
+ * + * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The friendlyName. + */ + public com.google.protobuf.StringValue getFriendlyName() { + if (friendlyNameBuilder_ == null) { + return friendlyName_ == null + ? com.google.protobuf.StringValue.getDefaultInstance() + : friendlyName_; + } else { + return friendlyNameBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. A descriptive name for the dataset.
+     * 
+ * + * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFriendlyName(com.google.protobuf.StringValue value) { + if (friendlyNameBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + friendlyName_ = value; + onChanged(); + } else { + friendlyNameBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. A descriptive name for the dataset.
+     * 
+ * + * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFriendlyName(com.google.protobuf.StringValue.Builder builderForValue) { + if (friendlyNameBuilder_ == null) { + friendlyName_ = builderForValue.build(); + onChanged(); + } else { + friendlyNameBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. A descriptive name for the dataset.
+     * 
+ * + * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFriendlyName(com.google.protobuf.StringValue value) { + if (friendlyNameBuilder_ == null) { + if (friendlyName_ != null) { + friendlyName_ = + com.google.protobuf.StringValue.newBuilder(friendlyName_) + .mergeFrom(value) + .buildPartial(); + } else { + friendlyName_ = value; + } + onChanged(); + } else { + friendlyNameBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. A descriptive name for the dataset.
+     * 
+ * + * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFriendlyName() { + if (friendlyNameBuilder_ == null) { + friendlyName_ = null; + onChanged(); + } else { + friendlyName_ = null; + friendlyNameBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. A descriptive name for the dataset.
+     * 
+ * + * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.StringValue.Builder getFriendlyNameBuilder() { + + onChanged(); + return getFriendlyNameFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. A descriptive name for the dataset.
+     * 
+ * + * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.StringValueOrBuilder getFriendlyNameOrBuilder() { + if (friendlyNameBuilder_ != null) { + return friendlyNameBuilder_.getMessageOrBuilder(); + } else { + return friendlyName_ == null + ? com.google.protobuf.StringValue.getDefaultInstance() + : friendlyName_; + } + } + /** + * + * + *
+     * Optional. A descriptive name for the dataset.
+     * 
+ * + * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.StringValue, + com.google.protobuf.StringValue.Builder, + com.google.protobuf.StringValueOrBuilder> + getFriendlyNameFieldBuilder() { + if (friendlyNameBuilder_ == null) { + friendlyNameBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.StringValue, + com.google.protobuf.StringValue.Builder, + com.google.protobuf.StringValueOrBuilder>( + getFriendlyName(), getParentForChildren(), isClean()); + friendlyName_ = null; + } + return friendlyNameBuilder_; + } + + private com.google.protobuf.StringValue description_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.StringValue, + com.google.protobuf.StringValue.Builder, + com.google.protobuf.StringValueOrBuilder> + descriptionBuilder_; + /** + * + * + *
+     * Optional. A user-friendly description of the dataset.
+     * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the description field is set. + */ + public boolean hasDescription() { + return descriptionBuilder_ != null || description_ != null; + } + /** + * + * + *
+     * Optional. A user-friendly description of the dataset.
+     * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The description. + */ + public com.google.protobuf.StringValue getDescription() { + if (descriptionBuilder_ == null) { + return description_ == null + ? com.google.protobuf.StringValue.getDefaultInstance() + : description_; + } else { + return descriptionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. A user-friendly description of the dataset.
+     * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDescription(com.google.protobuf.StringValue value) { + if (descriptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + onChanged(); + } else { + descriptionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. A user-friendly description of the dataset.
+     * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDescription(com.google.protobuf.StringValue.Builder builderForValue) { + if (descriptionBuilder_ == null) { + description_ = builderForValue.build(); + onChanged(); + } else { + descriptionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. A user-friendly description of the dataset.
+     * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDescription(com.google.protobuf.StringValue value) { + if (descriptionBuilder_ == null) { + if (description_ != null) { + description_ = + com.google.protobuf.StringValue.newBuilder(description_) + .mergeFrom(value) + .buildPartial(); + } else { + description_ = value; + } + onChanged(); + } else { + descriptionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. A user-friendly description of the dataset.
+     * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDescription() { + if (descriptionBuilder_ == null) { + description_ = null; + onChanged(); + } else { + description_ = null; + descriptionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. A user-friendly description of the dataset.
+     * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.StringValue.Builder getDescriptionBuilder() { + + onChanged(); + return getDescriptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. A user-friendly description of the dataset.
+     * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.StringValueOrBuilder getDescriptionOrBuilder() { + if (descriptionBuilder_ != null) { + return descriptionBuilder_.getMessageOrBuilder(); + } else { + return description_ == null + ? com.google.protobuf.StringValue.getDefaultInstance() + : description_; + } + } + /** + * + * + *
+     * Optional. A user-friendly description of the dataset.
+     * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.StringValue, + com.google.protobuf.StringValue.Builder, + com.google.protobuf.StringValueOrBuilder> + getDescriptionFieldBuilder() { + if (descriptionBuilder_ == null) { + descriptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.StringValue, + com.google.protobuf.StringValue.Builder, + com.google.protobuf.StringValueOrBuilder>( + getDescription(), getParentForChildren(), isClean()); + description_ = null; + } + return descriptionBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional. The labels associated with this dataset. You can use these
+     * to organize and group your datasets.
+     * You can set this property when inserting or updating a dataset.
+     * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+     * for more information.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional. The labels associated with this dataset. You can use these
+     * to organize and group your datasets.
+     * You can set this property when inserting or updating a dataset.
+     * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+     * for more information.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. The labels associated with this dataset. You can use these
+     * to organize and group your datasets.
+     * You can set this property when inserting or updating a dataset.
+     * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+     * for more information.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. The labels associated with this dataset. You can use these
+     * to organize and group your datasets.
+     * You can set this property when inserting or updating a dataset.
+     * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+     * for more information.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. The labels associated with this dataset. You can use these
+     * to organize and group your datasets.
+     * You can set this property when inserting or updating a dataset.
+     * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+     * for more information.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional. The labels associated with this dataset. You can use these
+     * to organize and group your datasets.
+     * You can set this property when inserting or updating a dataset.
+     * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+     * for more information.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. The labels associated with this dataset. You can use these
+     * to organize and group your datasets.
+     * You can set this property when inserting or updating a dataset.
+     * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+     * for more information.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object location_ = ""; + /** + * + * + *
+     * Required. The geographic location where the dataset should reside. See
+     * https://cloud.google.com/bigquery/docs/locations for supported
+     * locations.
+     * 
+ * + * string location = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The geographic location where the dataset should reside. See
+     * https://cloud.google.com/bigquery/docs/locations for supported
+     * locations.
+     * 
+ * + * string location = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The geographic location where the dataset should reside. See
+     * https://cloud.google.com/bigquery/docs/locations for supported
+     * locations.
+     * 
+ * + * string location = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + location_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The geographic location where the dataset should reside. See
+     * https://cloud.google.com/bigquery/docs/locations for supported
+     * locations.
+     * 
+ * + * string location = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + + location_ = getDefaultInstance().getLocation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The geographic location where the dataset should reside. See
+     * https://cloud.google.com/bigquery/docs/locations for supported
+     * locations.
+     * 
+ * + * string location = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + location_ = 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.bigquery.analyticshub.v1.DestinationDataset) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.DestinationDataset) + private static final com.google.cloud.bigquery.analyticshub.v1.DestinationDataset + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.DestinationDataset(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDataset getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DestinationDataset parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.DestinationDataset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDatasetOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDatasetOrBuilder.java new file mode 100644 index 000000000000..8af84df674a8 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDatasetOrBuilder.java @@ -0,0 +1,251 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface DestinationDatasetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.DestinationDataset) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A reference that identifies the destination dataset.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the datasetReference field is set. + */ + boolean hasDatasetReference(); + /** + * + * + *
+   * Required. A reference that identifies the destination dataset.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The datasetReference. + */ + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference getDatasetReference(); + /** + * + * + *
+   * Required. A reference that identifies the destination dataset.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference dataset_reference = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReferenceOrBuilder + getDatasetReferenceOrBuilder(); + + /** + * + * + *
+   * Optional. A descriptive name for the dataset.
+   * 
+ * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the friendlyName field is set. + */ + boolean hasFriendlyName(); + /** + * + * + *
+   * Optional. A descriptive name for the dataset.
+   * 
+ * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The friendlyName. + */ + com.google.protobuf.StringValue getFriendlyName(); + /** + * + * + *
+   * Optional. A descriptive name for the dataset.
+   * 
+ * + * .google.protobuf.StringValue friendly_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.StringValueOrBuilder getFriendlyNameOrBuilder(); + + /** + * + * + *
+   * Optional. A user-friendly description of the dataset.
+   * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the description field is set. + */ + boolean hasDescription(); + /** + * + * + *
+   * Optional. A user-friendly description of the dataset.
+   * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The description. + */ + com.google.protobuf.StringValue getDescription(); + /** + * + * + *
+   * Optional. A user-friendly description of the dataset.
+   * 
+ * + * .google.protobuf.StringValue description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.StringValueOrBuilder getDescriptionOrBuilder(); + + /** + * + * + *
+   * Optional. The labels associated with this dataset. You can use these
+   * to organize and group your datasets.
+   * You can set this property when inserting or updating a dataset.
+   * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+   * for more information.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. The labels associated with this dataset. You can use these
+   * to organize and group your datasets.
+   * You can set this property when inserting or updating a dataset.
+   * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+   * for more information.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. The labels associated with this dataset. You can use these
+   * to organize and group your datasets.
+   * You can set this property when inserting or updating a dataset.
+   * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+   * for more information.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. The labels associated with this dataset. You can use these
+   * to organize and group your datasets.
+   * You can set this property when inserting or updating a dataset.
+   * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+   * for more information.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. The labels associated with this dataset. You can use these
+   * to organize and group your datasets.
+   * You can set this property when inserting or updating a dataset.
+   * See https://cloud.google.com/resource-manager/docs/creating-managing-labels
+   * for more information.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Required. The geographic location where the dataset should reside. See
+   * https://cloud.google.com/bigquery/docs/locations for supported
+   * locations.
+   * 
+ * + * string location = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * Required. The geographic location where the dataset should reside. See
+   * https://cloud.google.com/bigquery/docs/locations for supported
+   * locations.
+   * 
+ * + * string location = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDatasetReference.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDatasetReference.java new file mode 100644 index 000000000000..86c985a0fef2 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDatasetReference.java @@ -0,0 +1,818 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Contains the reference that identifies a destination bigquery dataset.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference} + */ +public final class DestinationDatasetReference extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference) + DestinationDatasetReferenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use DestinationDatasetReference.newBuilder() to construct. + private DestinationDatasetReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DestinationDatasetReference() { + datasetId_ = ""; + projectId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DestinationDatasetReference(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDatasetReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDatasetReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference.class, + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference.Builder.class); + } + + public static final int DATASET_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object datasetId_; + /** + * + * + *
+   * Required. A unique ID for this dataset, without the project name. The ID
+   * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
+   * The maximum length is 1,024 characters.
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + @java.lang.Override + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasetId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. A unique ID for this dataset, without the project name. The ID
+   * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
+   * The maximum length is 1,024 characters.
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Required. The ID of the project containing this dataset.
+   * 
+ * + * string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID of the project containing this dataset.
+   * 
+ * + * string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(datasetId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, datasetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, projectId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(datasetId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, datasetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, projectId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = 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.bigquery.analyticshub.v1.DestinationDatasetReference)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference other = + (com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference) obj; + + if (!getDatasetId().equals(other.getDatasetId())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATASET_ID_FIELD_NUMBER; + hash = (53 * hash) + getDatasetId().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference 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.bigquery.analyticshub.v1.DestinationDatasetReference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference parseFrom( + 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.bigquery.analyticshub.v1.DestinationDatasetReference parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference parseFrom( + java.io.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.bigquery.analyticshub.v1.DestinationDatasetReference + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference + parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.DestinationDatasetReference parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.DestinationDatasetReference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Contains the reference that identifies a destination bigquery dataset.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference) + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDatasetReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDatasetReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference.class, + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + datasetId_ = ""; + + projectId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_DestinationDatasetReference_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference build() { + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference result = + new com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference(this); + result.datasetId_ = datasetId_; + result.projectId_ = projectId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.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.bigquery.analyticshub.v1.DestinationDatasetReference) { + return mergeFrom( + (com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference + .getDefaultInstance()) return this; + if (!other.getDatasetId().isEmpty()) { + datasetId_ = other.datasetId_; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + datasetId_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + projectId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object datasetId_ = ""; + /** + * + * + *
+     * Required. A unique ID for this dataset, without the project name. The ID
+     * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
+     * The maximum length is 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. A unique ID for this dataset, without the project name. The ID
+     * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
+     * The maximum length is 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. A unique ID for this dataset, without the project name. The ID
+     * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
+     * The maximum length is 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + datasetId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A unique ID for this dataset, without the project name. The ID
+     * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
+     * The maximum length is 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDatasetId() { + + datasetId_ = getDefaultInstance().getDatasetId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A unique ID for this dataset, without the project name. The ID
+     * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
+     * The maximum length is 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + datasetId_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Required. The ID of the project containing this dataset.
+     * 
+ * + * string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID of the project containing this dataset.
+     * 
+ * + * string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID of the project containing this dataset.
+     * 
+ * + * string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the project containing this dataset.
+     * 
+ * + * string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the project containing this dataset.
+     * 
+ * + * string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = 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.bigquery.analyticshub.v1.DestinationDatasetReference) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference) + private static final com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DestinationDatasetReference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.DestinationDatasetReference + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDatasetReferenceOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDatasetReferenceOrBuilder.java new file mode 100644 index 000000000000..cbd892cb24d3 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/DestinationDatasetReferenceOrBuilder.java @@ -0,0 +1,79 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface DestinationDatasetReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A unique ID for this dataset, without the project name. The ID
+   * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
+   * The maximum length is 1,024 characters.
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + java.lang.String getDatasetId(); + /** + * + * + *
+   * Required. A unique ID for this dataset, without the project name. The ID
+   * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
+   * The maximum length is 1,024 characters.
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + com.google.protobuf.ByteString getDatasetIdBytes(); + + /** + * + * + *
+   * Required. The ID of the project containing this dataset.
+   * 
+ * + * string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Required. The ID of the project containing this dataset.
+   * 
+ * + * string project_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetDataExchangeRequest.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetDataExchangeRequest.java new file mode 100644 index 000000000000..c15b7e76fa9d --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetDataExchangeRequest.java @@ -0,0 +1,643 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for getting a data exchange.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest} + */ +public final class GetDataExchangeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest) + GetDataExchangeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDataExchangeRequest.newBuilder() to construct. + private GetDataExchangeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDataExchangeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDataExchangeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_GetDataExchangeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_GetDataExchangeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest.class, + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the data exchange.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the data exchange.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest other = + (com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest 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.bigquery.analyticshub.v1.GetDataExchangeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest parseFrom( + 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.bigquery.analyticshub.v1.GetDataExchangeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest parseFrom( + java.io.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.bigquery.analyticshub.v1.GetDataExchangeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.GetDataExchangeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.GetDataExchangeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for getting a data exchange.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest) + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_GetDataExchangeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_GetDataExchangeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest.class, + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_GetDataExchangeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest build() { + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest result = + new com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest) { + return mergeFrom((com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the data exchange.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the data exchange.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the data exchange.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the data exchange.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the data exchange.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest) + private static final com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDataExchangeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.GetDataExchangeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetDataExchangeRequestOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetDataExchangeRequestOrBuilder.java new file mode 100644 index 000000000000..f0dbde6716dc --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetDataExchangeRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface GetDataExchangeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the data exchange.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the data exchange.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetListingRequest.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetListingRequest.java new file mode 100644 index 000000000000..f2b8a4265d75 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetListingRequest.java @@ -0,0 +1,637 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for getting a listing.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.GetListingRequest} + */ +public final class GetListingRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.GetListingRequest) + GetListingRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetListingRequest.newBuilder() to construct. + private GetListingRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetListingRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetListingRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_GetListingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_GetListingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest.class, + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.analyticshub.v1.GetListingRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest other = + (com.google.cloud.bigquery.analyticshub.v1.GetListingRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetListingRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetListingRequest 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.bigquery.analyticshub.v1.GetListingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetListingRequest parseFrom( + 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.bigquery.analyticshub.v1.GetListingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetListingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetListingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetListingRequest parseFrom( + java.io.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.bigquery.analyticshub.v1.GetListingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetListingRequest parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.GetListingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetListingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.GetListingRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for getting a listing.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.GetListingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.GetListingRequest) + com.google.cloud.bigquery.analyticshub.v1.GetListingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_GetListingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_GetListingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest.class, + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.analyticshub.v1.GetListingRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_GetListingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.GetListingRequest getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.GetListingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.GetListingRequest build() { + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.GetListingRequest buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.GetListingRequest result = + new com.google.cloud.bigquery.analyticshub.v1.GetListingRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.analyticshub.v1.GetListingRequest) { + return mergeFrom((com.google.cloud.bigquery.analyticshub.v1.GetListingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.analyticshub.v1.GetListingRequest other) { + if (other == com.google.cloud.bigquery.analyticshub.v1.GetListingRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.analyticshub.v1.GetListingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.GetListingRequest) + private static final com.google.cloud.bigquery.analyticshub.v1.GetListingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.GetListingRequest(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.GetListingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetListingRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.GetListingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetListingRequestOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetListingRequestOrBuilder.java new file mode 100644 index 000000000000..476f34423e4f --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/GetListingRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface GetListingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.GetListingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesRequest.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesRequest.java new file mode 100644 index 000000000000..b3dfc331e24f --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesRequest.java @@ -0,0 +1,927 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for requesting the list of data exchanges.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest} + */ +public final class ListDataExchangesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest) + ListDataExchangesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDataExchangesRequest.newBuilder() to construct. + private ListDataExchangesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDataExchangesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDataExchangesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest.class, + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource path of the data exchanges.
+   * e.g. `projects/myproject/locations/US`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource path of the data exchanges.
+   * e.g. `projects/myproject/locations/US`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response page. Leverage
+   * the page tokens to iterate through the entire collection.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Page token, returned by a previous call, to request the next page of
+   * results.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Page token, returned by a previous call, to request the next page of
+   * results.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest other = + (com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest 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.bigquery.analyticshub.v1.ListDataExchangesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest parseFrom( + 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.bigquery.analyticshub.v1.ListDataExchangesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest parseFrom( + java.io.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.bigquery.analyticshub.v1.ListDataExchangesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest + parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.ListDataExchangesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.ListDataExchangesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for requesting the list of data exchanges.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest) + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest.class, + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest build() { + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest result = + new com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest) { + return mergeFrom( + (com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource path of the data exchanges.
+     * e.g. `projects/myproject/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource path of the data exchanges.
+     * e.g. `projects/myproject/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource path of the data exchanges.
+     * e.g. `projects/myproject/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource path of the data exchanges.
+     * e.g. `projects/myproject/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource path of the data exchanges.
+     * e.g. `projects/myproject/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response page. Leverage
+     * the page tokens to iterate through the entire collection.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response page. Leverage
+     * the page tokens to iterate through the entire collection.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response page. Leverage
+     * the page tokens to iterate through the entire collection.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest) + private static final com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDataExchangesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.ListDataExchangesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesRequestOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesRequestOrBuilder.java new file mode 100644 index 000000000000..19aee51d22aa --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface ListDataExchangesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource path of the data exchanges.
+   * e.g. `projects/myproject/locations/US`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource path of the data exchanges.
+   * e.g. `projects/myproject/locations/US`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response page. Leverage
+   * the page tokens to iterate through the entire collection.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Page token, returned by a previous call, to request the next page of
+   * results.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Page token, returned by a previous call, to request the next page of
+   * results.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesResponse.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesResponse.java new file mode 100644 index 000000000000..b1dba1d9c661 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesResponse.java @@ -0,0 +1,1133 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for response to the list of data exchanges.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse} + */ +public final class ListDataExchangesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse) + ListDataExchangesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDataExchangesResponse.newBuilder() to construct. + private ListDataExchangesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDataExchangesResponse() { + dataExchanges_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDataExchangesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse.class, + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse.Builder.class); + } + + public static final int DATA_EXCHANGES_FIELD_NUMBER = 1; + private java.util.List dataExchanges_; + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + @java.lang.Override + public java.util.List + getDataExchangesList() { + return dataExchanges_; + } + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + @java.lang.Override + public java.util.List + getDataExchangesOrBuilderList() { + return dataExchanges_; + } + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + @java.lang.Override + public int getDataExchangesCount() { + return dataExchanges_.size(); + } + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataExchange getDataExchanges(int index) { + return dataExchanges_.get(index); + } + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder getDataExchangesOrBuilder( + int index) { + return dataExchanges_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token to request the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token to request the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < dataExchanges_.size(); i++) { + output.writeMessage(1, dataExchanges_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < dataExchanges_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, dataExchanges_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse other = + (com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse) obj; + + if (!getDataExchangesList().equals(other.getDataExchangesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDataExchangesCount() > 0) { + hash = (37 * hash) + DATA_EXCHANGES_FIELD_NUMBER; + hash = (53 * hash) + getDataExchangesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse 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.bigquery.analyticshub.v1.ListDataExchangesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse parseFrom( + 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.bigquery.analyticshub.v1.ListDataExchangesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse parseFrom( + java.io.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.bigquery.analyticshub.v1.ListDataExchangesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse + parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.ListDataExchangesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.ListDataExchangesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to the list of data exchanges.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse) + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse.class, + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (dataExchangesBuilder_ == null) { + dataExchanges_ = java.util.Collections.emptyList(); + } else { + dataExchanges_ = null; + dataExchangesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListDataExchangesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse build() { + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse result = + new com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse(this); + int from_bitField0_ = bitField0_; + if (dataExchangesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + dataExchanges_ = java.util.Collections.unmodifiableList(dataExchanges_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.dataExchanges_ = dataExchanges_; + } else { + result.dataExchanges_ = dataExchangesBuilder_.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.bigquery.analyticshub.v1.ListDataExchangesResponse) { + return mergeFrom( + (com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse + .getDefaultInstance()) return this; + if (dataExchangesBuilder_ == null) { + if (!other.dataExchanges_.isEmpty()) { + if (dataExchanges_.isEmpty()) { + dataExchanges_ = other.dataExchanges_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDataExchangesIsMutable(); + dataExchanges_.addAll(other.dataExchanges_); + } + onChanged(); + } + } else { + if (!other.dataExchanges_.isEmpty()) { + if (dataExchangesBuilder_.isEmpty()) { + dataExchangesBuilder_.dispose(); + dataExchangesBuilder_ = null; + dataExchanges_ = other.dataExchanges_; + bitField0_ = (bitField0_ & ~0x00000001); + dataExchangesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDataExchangesFieldBuilder() + : null; + } else { + dataExchangesBuilder_.addAllMessages(other.dataExchanges_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.bigquery.analyticshub.v1.DataExchange m = + input.readMessage( + com.google.cloud.bigquery.analyticshub.v1.DataExchange.parser(), + extensionRegistry); + if (dataExchangesBuilder_ == null) { + ensureDataExchangesIsMutable(); + dataExchanges_.add(m); + } else { + dataExchangesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List dataExchanges_ = + java.util.Collections.emptyList(); + + private void ensureDataExchangesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + dataExchanges_ = + new java.util.ArrayList( + dataExchanges_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataExchange, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder> + dataExchangesBuilder_; + + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public java.util.List + getDataExchangesList() { + if (dataExchangesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dataExchanges_); + } else { + return dataExchangesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public int getDataExchangesCount() { + if (dataExchangesBuilder_ == null) { + return dataExchanges_.size(); + } else { + return dataExchangesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange getDataExchanges(int index) { + if (dataExchangesBuilder_ == null) { + return dataExchanges_.get(index); + } else { + return dataExchangesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder setDataExchanges( + int index, com.google.cloud.bigquery.analyticshub.v1.DataExchange value) { + if (dataExchangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataExchangesIsMutable(); + dataExchanges_.set(index, value); + onChanged(); + } else { + dataExchangesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder setDataExchanges( + int index, com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder builderForValue) { + if (dataExchangesBuilder_ == null) { + ensureDataExchangesIsMutable(); + dataExchanges_.set(index, builderForValue.build()); + onChanged(); + } else { + dataExchangesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder addDataExchanges(com.google.cloud.bigquery.analyticshub.v1.DataExchange value) { + if (dataExchangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataExchangesIsMutable(); + dataExchanges_.add(value); + onChanged(); + } else { + dataExchangesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder addDataExchanges( + int index, com.google.cloud.bigquery.analyticshub.v1.DataExchange value) { + if (dataExchangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataExchangesIsMutable(); + dataExchanges_.add(index, value); + onChanged(); + } else { + dataExchangesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder addDataExchanges( + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder builderForValue) { + if (dataExchangesBuilder_ == null) { + ensureDataExchangesIsMutable(); + dataExchanges_.add(builderForValue.build()); + onChanged(); + } else { + dataExchangesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder addDataExchanges( + int index, com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder builderForValue) { + if (dataExchangesBuilder_ == null) { + ensureDataExchangesIsMutable(); + dataExchanges_.add(index, builderForValue.build()); + onChanged(); + } else { + dataExchangesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder addAllDataExchanges( + java.lang.Iterable + values) { + if (dataExchangesBuilder_ == null) { + ensureDataExchangesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dataExchanges_); + onChanged(); + } else { + dataExchangesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder clearDataExchanges() { + if (dataExchangesBuilder_ == null) { + dataExchanges_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + dataExchangesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder removeDataExchanges(int index) { + if (dataExchangesBuilder_ == null) { + ensureDataExchangesIsMutable(); + dataExchanges_.remove(index); + onChanged(); + } else { + dataExchangesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder getDataExchangesBuilder( + int index) { + return getDataExchangesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder + getDataExchangesOrBuilder(int index) { + if (dataExchangesBuilder_ == null) { + return dataExchanges_.get(index); + } else { + return dataExchangesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public java.util.List + getDataExchangesOrBuilderList() { + if (dataExchangesBuilder_ != null) { + return dataExchangesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dataExchanges_); + } + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder + addDataExchangesBuilder() { + return getDataExchangesFieldBuilder() + .addBuilder(com.google.cloud.bigquery.analyticshub.v1.DataExchange.getDefaultInstance()); + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder addDataExchangesBuilder( + int index) { + return getDataExchangesFieldBuilder() + .addBuilder( + index, com.google.cloud.bigquery.analyticshub.v1.DataExchange.getDefaultInstance()); + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public java.util.List + getDataExchangesBuilderList() { + return getDataExchangesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataExchange, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder> + getDataExchangesFieldBuilder() { + if (dataExchangesBuilder_ == null) { + dataExchangesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataExchange, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder>( + dataExchanges_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + dataExchanges_ = null; + } + return dataExchangesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse) + private static final com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDataExchangesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.ListDataExchangesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesResponseOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesResponseOrBuilder.java new file mode 100644 index 000000000000..da9eccfa5377 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListDataExchangesResponseOrBuilder.java @@ -0,0 +1,103 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface ListDataExchangesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + java.util.List getDataExchangesList(); + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + com.google.cloud.bigquery.analyticshub.v1.DataExchange getDataExchanges(int index); + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + int getDataExchangesCount(); + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + java.util.List + getDataExchangesOrBuilderList(); + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder getDataExchangesOrBuilder( + int index); + + /** + * + * + *
+   * A token to request the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token to request the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsRequest.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsRequest.java new file mode 100644 index 000000000000..0e13c05b83ae --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsRequest.java @@ -0,0 +1,920 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for requesting the list of listings.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.ListListingsRequest} + */ +public final class ListListingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.ListListingsRequest) + ListListingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListListingsRequest.newBuilder() to construct. + private ListListingsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListListingsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListListingsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest.class, + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource path of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource path of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response page. Leverage
+   * the page tokens to iterate through the entire collection.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Page token, returned by a previous call, to request the next page of
+   * results.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Page token, returned by a previous call, to request the next page of
+   * results.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest other = + (com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest 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.bigquery.analyticshub.v1.ListListingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest parseFrom( + 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.bigquery.analyticshub.v1.ListListingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest parseFrom( + java.io.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.bigquery.analyticshub.v1.ListListingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.ListListingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.ListListingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for requesting the list of listings.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.ListListingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.ListListingsRequest) + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest.class, + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest build() { + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest result = + new com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest) { + return mergeFrom((com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource path of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource path of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource path of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource path of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource path of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response page. Leverage
+     * the page tokens to iterate through the entire collection.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response page. Leverage
+     * the page tokens to iterate through the entire collection.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response page. Leverage
+     * the page tokens to iterate through the entire collection.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.analyticshub.v1.ListListingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.ListListingsRequest) + private static final com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListListingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.ListListingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsRequestOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsRequestOrBuilder.java new file mode 100644 index 000000000000..967c2358816a --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface ListListingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.ListListingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource path of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource path of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response page. Leverage
+   * the page tokens to iterate through the entire collection.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Page token, returned by a previous call, to request the next page of
+   * results.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Page token, returned by a previous call, to request the next page of
+   * results.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsResponse.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsResponse.java new file mode 100644 index 000000000000..f783da12a9ef --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsResponse.java @@ -0,0 +1,1116 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for response to the list of Listings.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.ListListingsResponse} + */ +public final class ListListingsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.ListListingsResponse) + ListListingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListListingsResponse.newBuilder() to construct. + private ListListingsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListListingsResponse() { + listings_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListListingsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse.class, + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse.Builder.class); + } + + public static final int LISTINGS_FIELD_NUMBER = 1; + private java.util.List listings_; + /** + * + * + *
+   * The list of Listing.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + @java.lang.Override + public java.util.List getListingsList() { + return listings_; + } + /** + * + * + *
+   * The list of Listing.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + @java.lang.Override + public java.util.List + getListingsOrBuilderList() { + return listings_; + } + /** + * + * + *
+   * The list of Listing.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + @java.lang.Override + public int getListingsCount() { + return listings_.size(); + } + /** + * + * + *
+   * The list of Listing.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing getListings(int index) { + return listings_.get(index); + } + /** + * + * + *
+   * The list of Listing.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder getListingsOrBuilder( + int index) { + return listings_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token to request the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token to request the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < listings_.size(); i++) { + output.writeMessage(1, listings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < listings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, listings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse other = + (com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse) obj; + + if (!getListingsList().equals(other.getListingsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getListingsCount() > 0) { + hash = (37 * hash) + LISTINGS_FIELD_NUMBER; + hash = (53 * hash) + getListingsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse 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.bigquery.analyticshub.v1.ListListingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse parseFrom( + 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.bigquery.analyticshub.v1.ListListingsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse parseFrom( + java.io.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.bigquery.analyticshub.v1.ListListingsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.ListListingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.ListListingsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to the list of Listings.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.ListListingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.ListListingsResponse) + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse.class, + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse.Builder.class); + } + + // Construct using com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (listingsBuilder_ == null) { + listings_ = java.util.Collections.emptyList(); + } else { + listings_ = null; + listingsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListListingsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse build() { + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse result = + new com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse(this); + int from_bitField0_ = bitField0_; + if (listingsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + listings_ = java.util.Collections.unmodifiableList(listings_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.listings_ = listings_; + } else { + result.listings_ = listingsBuilder_.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.bigquery.analyticshub.v1.ListListingsResponse) { + return mergeFrom((com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse.getDefaultInstance()) + return this; + if (listingsBuilder_ == null) { + if (!other.listings_.isEmpty()) { + if (listings_.isEmpty()) { + listings_ = other.listings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureListingsIsMutable(); + listings_.addAll(other.listings_); + } + onChanged(); + } + } else { + if (!other.listings_.isEmpty()) { + if (listingsBuilder_.isEmpty()) { + listingsBuilder_.dispose(); + listingsBuilder_ = null; + listings_ = other.listings_; + bitField0_ = (bitField0_ & ~0x00000001); + listingsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getListingsFieldBuilder() + : null; + } else { + listingsBuilder_.addAllMessages(other.listings_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.bigquery.analyticshub.v1.Listing m = + input.readMessage( + com.google.cloud.bigquery.analyticshub.v1.Listing.parser(), + extensionRegistry); + if (listingsBuilder_ == null) { + ensureListingsIsMutable(); + listings_.add(m); + } else { + listingsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List listings_ = + java.util.Collections.emptyList(); + + private void ensureListingsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + listings_ = + new java.util.ArrayList(listings_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Listing, + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder, + com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder> + listingsBuilder_; + + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public java.util.List getListingsList() { + if (listingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(listings_); + } else { + return listingsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public int getListingsCount() { + if (listingsBuilder_ == null) { + return listings_.size(); + } else { + return listingsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.Listing getListings(int index) { + if (listingsBuilder_ == null) { + return listings_.get(index); + } else { + return listingsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public Builder setListings(int index, com.google.cloud.bigquery.analyticshub.v1.Listing value) { + if (listingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListingsIsMutable(); + listings_.set(index, value); + onChanged(); + } else { + listingsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public Builder setListings( + int index, com.google.cloud.bigquery.analyticshub.v1.Listing.Builder builderForValue) { + if (listingsBuilder_ == null) { + ensureListingsIsMutable(); + listings_.set(index, builderForValue.build()); + onChanged(); + } else { + listingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public Builder addListings(com.google.cloud.bigquery.analyticshub.v1.Listing value) { + if (listingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListingsIsMutable(); + listings_.add(value); + onChanged(); + } else { + listingsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public Builder addListings(int index, com.google.cloud.bigquery.analyticshub.v1.Listing value) { + if (listingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListingsIsMutable(); + listings_.add(index, value); + onChanged(); + } else { + listingsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public Builder addListings( + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder builderForValue) { + if (listingsBuilder_ == null) { + ensureListingsIsMutable(); + listings_.add(builderForValue.build()); + onChanged(); + } else { + listingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public Builder addListings( + int index, com.google.cloud.bigquery.analyticshub.v1.Listing.Builder builderForValue) { + if (listingsBuilder_ == null) { + ensureListingsIsMutable(); + listings_.add(index, builderForValue.build()); + onChanged(); + } else { + listingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public Builder addAllListings( + java.lang.Iterable values) { + if (listingsBuilder_ == null) { + ensureListingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, listings_); + onChanged(); + } else { + listingsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public Builder clearListings() { + if (listingsBuilder_ == null) { + listings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + listingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public Builder removeListings(int index) { + if (listingsBuilder_ == null) { + ensureListingsIsMutable(); + listings_.remove(index); + onChanged(); + } else { + listingsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.Listing.Builder getListingsBuilder(int index) { + return getListingsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder getListingsOrBuilder( + int index) { + if (listingsBuilder_ == null) { + return listings_.get(index); + } else { + return listingsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public java.util.List + getListingsOrBuilderList() { + if (listingsBuilder_ != null) { + return listingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(listings_); + } + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.Listing.Builder addListingsBuilder() { + return getListingsFieldBuilder() + .addBuilder(com.google.cloud.bigquery.analyticshub.v1.Listing.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.Listing.Builder addListingsBuilder(int index) { + return getListingsFieldBuilder() + .addBuilder( + index, com.google.cloud.bigquery.analyticshub.v1.Listing.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Listing.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + public java.util.List + getListingsBuilderList() { + return getListingsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Listing, + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder, + com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder> + getListingsFieldBuilder() { + if (listingsBuilder_ == null) { + listingsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Listing, + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder, + com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder>( + listings_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + listings_ = null; + } + return listingsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.analyticshub.v1.ListListingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.ListListingsResponse) + private static final com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListListingsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListListingsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.ListListingsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsResponseOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsResponseOrBuilder.java new file mode 100644 index 000000000000..7b7de4605c78 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListListingsResponseOrBuilder.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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface ListListingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.ListListingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Listing.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + java.util.List getListingsList(); + /** + * + * + *
+   * The list of Listing.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + com.google.cloud.bigquery.analyticshub.v1.Listing getListings(int index); + /** + * + * + *
+   * The list of Listing.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + int getListingsCount(); + /** + * + * + *
+   * The list of Listing.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + java.util.List + getListingsOrBuilderList(); + /** + * + * + *
+   * The list of Listing.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing listings = 1; + */ + com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder getListingsOrBuilder(int index); + + /** + * + * + *
+   * A token to request the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token to request the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesRequest.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesRequest.java new file mode 100644 index 000000000000..22dc51ddee61 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesRequest.java @@ -0,0 +1,915 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for requesting the list of data exchanges from projects in an
+ * organization and location.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest} + */ +public final class ListOrgDataExchangesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest) + ListOrgDataExchangesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListOrgDataExchangesRequest.newBuilder() to construct. + private ListOrgDataExchangesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListOrgDataExchangesRequest() { + organization_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListOrgDataExchangesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest.class, + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest.Builder.class); + } + + public static final int ORGANIZATION_FIELD_NUMBER = 1; + private volatile java.lang.Object organization_; + /** + * + * + *
+   * Required. The organization resource path of the projects containing DataExchanges.
+   * e.g. `organizations/myorg/locations/US`.
+   * 
+ * + * string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The organization. + */ + @java.lang.Override + public java.lang.String getOrganization() { + java.lang.Object ref = organization_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + organization_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The organization resource path of the projects containing DataExchanges.
+   * e.g. `organizations/myorg/locations/US`.
+   * 
+ * + * string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for organization. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrganizationBytes() { + java.lang.Object ref = organization_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + organization_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response page. Leverage
+   * the page tokens to iterate through the entire collection.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Page token, returned by a previous call, to request the next page of
+   * results.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Page token, returned by a previous call, to request the next page of
+   * results.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(organization_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, organization_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(organization_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, organization_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest other = + (com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest) obj; + + if (!getOrganization().equals(other.getOrganization())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; + hash = (53 * hash) + getOrganization().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest 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.bigquery.analyticshub.v1.ListOrgDataExchangesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest parseFrom( + 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.bigquery.analyticshub.v1.ListOrgDataExchangesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest parseFrom( + java.io.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.bigquery.analyticshub.v1.ListOrgDataExchangesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest + parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.ListOrgDataExchangesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.ListOrgDataExchangesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for requesting the list of data exchanges from projects in an
+   * organization and location.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest) + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest.class, + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + organization_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest build() { + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest result = + new com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest(this); + result.organization_ = organization_; + 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.bigquery.analyticshub.v1.ListOrgDataExchangesRequest) { + return mergeFrom( + (com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest + .getDefaultInstance()) return this; + if (!other.getOrganization().isEmpty()) { + organization_ = other.organization_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + organization_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object organization_ = ""; + /** + * + * + *
+     * Required. The organization resource path of the projects containing DataExchanges.
+     * e.g. `organizations/myorg/locations/US`.
+     * 
+ * + * string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The organization. + */ + public java.lang.String getOrganization() { + java.lang.Object ref = organization_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + organization_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The organization resource path of the projects containing DataExchanges.
+     * e.g. `organizations/myorg/locations/US`.
+     * 
+ * + * string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for organization. + */ + public com.google.protobuf.ByteString getOrganizationBytes() { + java.lang.Object ref = organization_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + organization_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The organization resource path of the projects containing DataExchanges.
+     * e.g. `organizations/myorg/locations/US`.
+     * 
+ * + * string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The organization to set. + * @return This builder for chaining. + */ + public Builder setOrganization(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + organization_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The organization resource path of the projects containing DataExchanges.
+     * e.g. `organizations/myorg/locations/US`.
+     * 
+ * + * string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearOrganization() { + + organization_ = getDefaultInstance().getOrganization(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The organization resource path of the projects containing DataExchanges.
+     * e.g. `organizations/myorg/locations/US`.
+     * 
+ * + * string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for organization to set. + * @return This builder for chaining. + */ + public Builder setOrganizationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + organization_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response page. Leverage
+     * the page tokens to iterate through the entire collection.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response page. Leverage
+     * the page tokens to iterate through the entire collection.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response page. Leverage
+     * the page tokens to iterate through the entire collection.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Page token, returned by a previous call, to request the next page of
+     * results.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest) + private static final com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListOrgDataExchangesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.ListOrgDataExchangesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesRequestOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesRequestOrBuilder.java new file mode 100644 index 000000000000..9662ff7492dc --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesRequestOrBuilder.java @@ -0,0 +1,93 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface ListOrgDataExchangesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The organization resource path of the projects containing DataExchanges.
+   * e.g. `organizations/myorg/locations/US`.
+   * 
+ * + * string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The organization. + */ + java.lang.String getOrganization(); + /** + * + * + *
+   * Required. The organization resource path of the projects containing DataExchanges.
+   * e.g. `organizations/myorg/locations/US`.
+   * 
+ * + * string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for organization. + */ + com.google.protobuf.ByteString getOrganizationBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response page. Leverage
+   * the page tokens to iterate through the entire collection.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Page token, returned by a previous call, to request the next page of
+   * results.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Page token, returned by a previous call, to request the next page of
+   * results.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesResponse.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesResponse.java new file mode 100644 index 000000000000..62fcfea1b594 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesResponse.java @@ -0,0 +1,1136 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for response to listing data exchanges in an organization and
+ * location.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse} + */ +public final class ListOrgDataExchangesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse) + ListOrgDataExchangesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListOrgDataExchangesResponse.newBuilder() to construct. + private ListOrgDataExchangesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListOrgDataExchangesResponse() { + dataExchanges_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListOrgDataExchangesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse.class, + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse.Builder.class); + } + + public static final int DATA_EXCHANGES_FIELD_NUMBER = 1; + private java.util.List dataExchanges_; + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + @java.lang.Override + public java.util.List + getDataExchangesList() { + return dataExchanges_; + } + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + @java.lang.Override + public java.util.List + getDataExchangesOrBuilderList() { + return dataExchanges_; + } + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + @java.lang.Override + public int getDataExchangesCount() { + return dataExchanges_.size(); + } + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataExchange getDataExchanges(int index) { + return dataExchanges_.get(index); + } + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder getDataExchangesOrBuilder( + int index) { + return dataExchanges_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token to request the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token to request the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < dataExchanges_.size(); i++) { + output.writeMessage(1, dataExchanges_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < dataExchanges_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, dataExchanges_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse other = + (com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse) obj; + + if (!getDataExchangesList().equals(other.getDataExchangesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDataExchangesCount() > 0) { + hash = (37 * hash) + DATA_EXCHANGES_FIELD_NUMBER; + hash = (53 * hash) + getDataExchangesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse 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.bigquery.analyticshub.v1.ListOrgDataExchangesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse parseFrom( + 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.bigquery.analyticshub.v1.ListOrgDataExchangesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse parseFrom( + java.io.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.bigquery.analyticshub.v1.ListOrgDataExchangesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse + parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.ListOrgDataExchangesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.ListOrgDataExchangesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to listing data exchanges in an organization and
+   * location.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse) + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse.class, + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (dataExchangesBuilder_ == null) { + dataExchanges_ = java.util.Collections.emptyList(); + } else { + dataExchanges_ = null; + dataExchangesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_ListOrgDataExchangesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse build() { + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse result = + new com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse(this); + int from_bitField0_ = bitField0_; + if (dataExchangesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + dataExchanges_ = java.util.Collections.unmodifiableList(dataExchanges_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.dataExchanges_ = dataExchanges_; + } else { + result.dataExchanges_ = dataExchangesBuilder_.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.bigquery.analyticshub.v1.ListOrgDataExchangesResponse) { + return mergeFrom( + (com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse + .getDefaultInstance()) return this; + if (dataExchangesBuilder_ == null) { + if (!other.dataExchanges_.isEmpty()) { + if (dataExchanges_.isEmpty()) { + dataExchanges_ = other.dataExchanges_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDataExchangesIsMutable(); + dataExchanges_.addAll(other.dataExchanges_); + } + onChanged(); + } + } else { + if (!other.dataExchanges_.isEmpty()) { + if (dataExchangesBuilder_.isEmpty()) { + dataExchangesBuilder_.dispose(); + dataExchangesBuilder_ = null; + dataExchanges_ = other.dataExchanges_; + bitField0_ = (bitField0_ & ~0x00000001); + dataExchangesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDataExchangesFieldBuilder() + : null; + } else { + dataExchangesBuilder_.addAllMessages(other.dataExchanges_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.bigquery.analyticshub.v1.DataExchange m = + input.readMessage( + com.google.cloud.bigquery.analyticshub.v1.DataExchange.parser(), + extensionRegistry); + if (dataExchangesBuilder_ == null) { + ensureDataExchangesIsMutable(); + dataExchanges_.add(m); + } else { + dataExchangesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List dataExchanges_ = + java.util.Collections.emptyList(); + + private void ensureDataExchangesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + dataExchanges_ = + new java.util.ArrayList( + dataExchanges_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataExchange, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder> + dataExchangesBuilder_; + + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public java.util.List + getDataExchangesList() { + if (dataExchangesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dataExchanges_); + } else { + return dataExchangesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public int getDataExchangesCount() { + if (dataExchangesBuilder_ == null) { + return dataExchanges_.size(); + } else { + return dataExchangesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange getDataExchanges(int index) { + if (dataExchangesBuilder_ == null) { + return dataExchanges_.get(index); + } else { + return dataExchangesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder setDataExchanges( + int index, com.google.cloud.bigquery.analyticshub.v1.DataExchange value) { + if (dataExchangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataExchangesIsMutable(); + dataExchanges_.set(index, value); + onChanged(); + } else { + dataExchangesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder setDataExchanges( + int index, com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder builderForValue) { + if (dataExchangesBuilder_ == null) { + ensureDataExchangesIsMutable(); + dataExchanges_.set(index, builderForValue.build()); + onChanged(); + } else { + dataExchangesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder addDataExchanges(com.google.cloud.bigquery.analyticshub.v1.DataExchange value) { + if (dataExchangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataExchangesIsMutable(); + dataExchanges_.add(value); + onChanged(); + } else { + dataExchangesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder addDataExchanges( + int index, com.google.cloud.bigquery.analyticshub.v1.DataExchange value) { + if (dataExchangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataExchangesIsMutable(); + dataExchanges_.add(index, value); + onChanged(); + } else { + dataExchangesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder addDataExchanges( + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder builderForValue) { + if (dataExchangesBuilder_ == null) { + ensureDataExchangesIsMutable(); + dataExchanges_.add(builderForValue.build()); + onChanged(); + } else { + dataExchangesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder addDataExchanges( + int index, com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder builderForValue) { + if (dataExchangesBuilder_ == null) { + ensureDataExchangesIsMutable(); + dataExchanges_.add(index, builderForValue.build()); + onChanged(); + } else { + dataExchangesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder addAllDataExchanges( + java.lang.Iterable + values) { + if (dataExchangesBuilder_ == null) { + ensureDataExchangesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dataExchanges_); + onChanged(); + } else { + dataExchangesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder clearDataExchanges() { + if (dataExchangesBuilder_ == null) { + dataExchanges_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + dataExchangesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public Builder removeDataExchanges(int index) { + if (dataExchangesBuilder_ == null) { + ensureDataExchangesIsMutable(); + dataExchanges_.remove(index); + onChanged(); + } else { + dataExchangesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder getDataExchangesBuilder( + int index) { + return getDataExchangesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder + getDataExchangesOrBuilder(int index) { + if (dataExchangesBuilder_ == null) { + return dataExchanges_.get(index); + } else { + return dataExchangesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public java.util.List + getDataExchangesOrBuilderList() { + if (dataExchangesBuilder_ != null) { + return dataExchangesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dataExchanges_); + } + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder + addDataExchangesBuilder() { + return getDataExchangesFieldBuilder() + .addBuilder(com.google.cloud.bigquery.analyticshub.v1.DataExchange.getDefaultInstance()); + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder addDataExchangesBuilder( + int index) { + return getDataExchangesFieldBuilder() + .addBuilder( + index, com.google.cloud.bigquery.analyticshub.v1.DataExchange.getDefaultInstance()); + } + /** + * + * + *
+     * The list of data exchanges.
+     * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + public java.util.List + getDataExchangesBuilderList() { + return getDataExchangesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataExchange, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder> + getDataExchangesFieldBuilder() { + if (dataExchangesBuilder_ == null) { + dataExchangesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataExchange, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder>( + dataExchanges_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + dataExchanges_ = null; + } + return dataExchangesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token to request the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse) + private static final com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListOrgDataExchangesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.ListOrgDataExchangesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesResponseOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesResponseOrBuilder.java new file mode 100644 index 000000000000..8e6080b299ca --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListOrgDataExchangesResponseOrBuilder.java @@ -0,0 +1,103 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface ListOrgDataExchangesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + java.util.List getDataExchangesList(); + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + com.google.cloud.bigquery.analyticshub.v1.DataExchange getDataExchanges(int index); + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + int getDataExchangesCount(); + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + java.util.List + getDataExchangesOrBuilderList(); + /** + * + * + *
+   * The list of data exchanges.
+   * 
+ * + * repeated .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchanges = 1; + */ + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder getDataExchangesOrBuilder( + int index); + + /** + * + * + *
+   * A token to request the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token to request the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/Listing.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/Listing.java new file mode 100644 index 000000000000..645cec845f45 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/Listing.java @@ -0,0 +1,4335 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * A listing is what gets published into a data exchange that a subscriber can
+ * subscribe to. It contains a reference to the data source along with
+ * descriptive information that will help subscribers find and subscribe the
+ * data.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.Listing} + */ +public final class Listing extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.Listing) + ListingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Listing.newBuilder() to construct. + private Listing(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Listing() { + name_ = ""; + displayName_ = ""; + description_ = ""; + primaryContact_ = ""; + documentation_ = ""; + state_ = 0; + icon_ = com.google.protobuf.ByteString.EMPTY; + categories_ = java.util.Collections.emptyList(); + requestAccess_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Listing(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Listing_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Listing_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.Listing.class, + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder.class); + } + + /** + * + * + *
+   * State of the listing.
+   * 
+ * + * Protobuf enum {@code google.cloud.bigquery.analyticshub.v1.Listing.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Subscribable state. Users with dataexchange.listings.subscribe permission
+     * can subscribe to this listing.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Subscribable state. Users with dataexchange.listings.subscribe permission
+     * can subscribe to this listing.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State 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 State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + 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 State findValueByNumber(int number) { + return State.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.bigquery.analyticshub.v1.Listing.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State 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 State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.bigquery.analyticshub.v1.Listing.State) + } + + /** + * + * + *
+   * Listing categories.
+   * 
+ * + * Protobuf enum {@code google.cloud.bigquery.analyticshub.v1.Listing.Category} + */ + public enum Category implements com.google.protobuf.ProtocolMessageEnum { + /** CATEGORY_UNSPECIFIED = 0; */ + CATEGORY_UNSPECIFIED(0), + /** CATEGORY_OTHERS = 1; */ + CATEGORY_OTHERS(1), + /** CATEGORY_ADVERTISING_AND_MARKETING = 2; */ + CATEGORY_ADVERTISING_AND_MARKETING(2), + /** CATEGORY_COMMERCE = 3; */ + CATEGORY_COMMERCE(3), + /** CATEGORY_CLIMATE_AND_ENVIRONMENT = 4; */ + CATEGORY_CLIMATE_AND_ENVIRONMENT(4), + /** CATEGORY_DEMOGRAPHICS = 5; */ + CATEGORY_DEMOGRAPHICS(5), + /** CATEGORY_ECONOMICS = 6; */ + CATEGORY_ECONOMICS(6), + /** CATEGORY_EDUCATION = 7; */ + CATEGORY_EDUCATION(7), + /** CATEGORY_ENERGY = 8; */ + CATEGORY_ENERGY(8), + /** CATEGORY_FINANCIAL = 9; */ + CATEGORY_FINANCIAL(9), + /** CATEGORY_GAMING = 10; */ + CATEGORY_GAMING(10), + /** CATEGORY_GEOSPATIAL = 11; */ + CATEGORY_GEOSPATIAL(11), + /** CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE = 12; */ + CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE(12), + /** CATEGORY_MEDIA = 13; */ + CATEGORY_MEDIA(13), + /** CATEGORY_PUBLIC_SECTOR = 14; */ + CATEGORY_PUBLIC_SECTOR(14), + /** CATEGORY_RETAIL = 15; */ + CATEGORY_RETAIL(15), + /** CATEGORY_SPORTS = 16; */ + CATEGORY_SPORTS(16), + /** CATEGORY_SCIENCE_AND_RESEARCH = 17; */ + CATEGORY_SCIENCE_AND_RESEARCH(17), + /** CATEGORY_TRANSPORTATION_AND_LOGISTICS = 18; */ + CATEGORY_TRANSPORTATION_AND_LOGISTICS(18), + /** CATEGORY_TRAVEL_AND_TOURISM = 19; */ + CATEGORY_TRAVEL_AND_TOURISM(19), + UNRECOGNIZED(-1), + ; + + /** CATEGORY_UNSPECIFIED = 0; */ + public static final int CATEGORY_UNSPECIFIED_VALUE = 0; + /** CATEGORY_OTHERS = 1; */ + public static final int CATEGORY_OTHERS_VALUE = 1; + /** CATEGORY_ADVERTISING_AND_MARKETING = 2; */ + public static final int CATEGORY_ADVERTISING_AND_MARKETING_VALUE = 2; + /** CATEGORY_COMMERCE = 3; */ + public static final int CATEGORY_COMMERCE_VALUE = 3; + /** CATEGORY_CLIMATE_AND_ENVIRONMENT = 4; */ + public static final int CATEGORY_CLIMATE_AND_ENVIRONMENT_VALUE = 4; + /** CATEGORY_DEMOGRAPHICS = 5; */ + public static final int CATEGORY_DEMOGRAPHICS_VALUE = 5; + /** CATEGORY_ECONOMICS = 6; */ + public static final int CATEGORY_ECONOMICS_VALUE = 6; + /** CATEGORY_EDUCATION = 7; */ + public static final int CATEGORY_EDUCATION_VALUE = 7; + /** CATEGORY_ENERGY = 8; */ + public static final int CATEGORY_ENERGY_VALUE = 8; + /** CATEGORY_FINANCIAL = 9; */ + public static final int CATEGORY_FINANCIAL_VALUE = 9; + /** CATEGORY_GAMING = 10; */ + public static final int CATEGORY_GAMING_VALUE = 10; + /** CATEGORY_GEOSPATIAL = 11; */ + public static final int CATEGORY_GEOSPATIAL_VALUE = 11; + /** CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE = 12; */ + public static final int CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE_VALUE = 12; + /** CATEGORY_MEDIA = 13; */ + public static final int CATEGORY_MEDIA_VALUE = 13; + /** CATEGORY_PUBLIC_SECTOR = 14; */ + public static final int CATEGORY_PUBLIC_SECTOR_VALUE = 14; + /** CATEGORY_RETAIL = 15; */ + public static final int CATEGORY_RETAIL_VALUE = 15; + /** CATEGORY_SPORTS = 16; */ + public static final int CATEGORY_SPORTS_VALUE = 16; + /** CATEGORY_SCIENCE_AND_RESEARCH = 17; */ + public static final int CATEGORY_SCIENCE_AND_RESEARCH_VALUE = 17; + /** CATEGORY_TRANSPORTATION_AND_LOGISTICS = 18; */ + public static final int CATEGORY_TRANSPORTATION_AND_LOGISTICS_VALUE = 18; + /** CATEGORY_TRAVEL_AND_TOURISM = 19; */ + public static final int CATEGORY_TRAVEL_AND_TOURISM_VALUE = 19; + + 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 Category 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 Category forNumber(int value) { + switch (value) { + case 0: + return CATEGORY_UNSPECIFIED; + case 1: + return CATEGORY_OTHERS; + case 2: + return CATEGORY_ADVERTISING_AND_MARKETING; + case 3: + return CATEGORY_COMMERCE; + case 4: + return CATEGORY_CLIMATE_AND_ENVIRONMENT; + case 5: + return CATEGORY_DEMOGRAPHICS; + case 6: + return CATEGORY_ECONOMICS; + case 7: + return CATEGORY_EDUCATION; + case 8: + return CATEGORY_ENERGY; + case 9: + return CATEGORY_FINANCIAL; + case 10: + return CATEGORY_GAMING; + case 11: + return CATEGORY_GEOSPATIAL; + case 12: + return CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE; + case 13: + return CATEGORY_MEDIA; + case 14: + return CATEGORY_PUBLIC_SECTOR; + case 15: + return CATEGORY_RETAIL; + case 16: + return CATEGORY_SPORTS; + case 17: + return CATEGORY_SCIENCE_AND_RESEARCH; + case 18: + return CATEGORY_TRANSPORTATION_AND_LOGISTICS; + case 19: + return CATEGORY_TRAVEL_AND_TOURISM; + 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 Category findValueByNumber(int number) { + return Category.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.bigquery.analyticshub.v1.Listing.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final Category[] VALUES = values(); + + public static Category 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 Category(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.bigquery.analyticshub.v1.Listing.Category) + } + + public interface BigQueryDatasetSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Resource name of the dataset source for this listing.
+     * e.g. `projects/myproject/datasets/123`
+     * 
+ * + * string dataset = 1 [(.google.api.resource_reference) = { ... } + * + * @return The dataset. + */ + java.lang.String getDataset(); + /** + * + * + *
+     * Resource name of the dataset source for this listing.
+     * e.g. `projects/myproject/datasets/123`
+     * 
+ * + * string dataset = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for dataset. + */ + com.google.protobuf.ByteString getDatasetBytes(); + } + /** + * + * + *
+   * A reference to a shared dataset. It is an existing BigQuery dataset with a
+   * collection of objects such as tables and views that you want to share
+   * with subscribers.
+   * When subscriber's subscribe to a listing, Analytics Hub creates a linked
+   * dataset in
+   * the subscriber's project. A Linked dataset is an opaque, read-only BigQuery
+   * dataset that serves as a _symbolic link_ to a shared dataset.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource} + */ + public static final class BigQueryDatasetSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) + BigQueryDatasetSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use BigQueryDatasetSource.newBuilder() to construct. + private BigQueryDatasetSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BigQueryDatasetSource() { + dataset_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BigQueryDatasetSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Listing_BigQueryDatasetSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Listing_BigQueryDatasetSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.class, + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Builder + .class); + } + + public static final int DATASET_FIELD_NUMBER = 1; + private volatile java.lang.Object dataset_; + /** + * + * + *
+     * Resource name of the dataset source for this listing.
+     * e.g. `projects/myproject/datasets/123`
+     * 
+ * + * string dataset = 1 [(.google.api.resource_reference) = { ... } + * + * @return The dataset. + */ + @java.lang.Override + public java.lang.String getDataset() { + java.lang.Object ref = dataset_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataset_ = s; + return s; + } + } + /** + * + * + *
+     * Resource name of the dataset source for this listing.
+     * e.g. `projects/myproject/datasets/123`
+     * 
+ * + * string dataset = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for dataset. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatasetBytes() { + java.lang.Object ref = dataset_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataset_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, dataset_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataset_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, dataset_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = 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.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource other = + (com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) obj; + + if (!getDataset().equals(other.getDataset())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATASET_FIELD_NUMBER; + hash = (53 * hash) + getDataset().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource 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.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource parseFrom( + 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.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource parseFrom( + java.io.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.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A reference to a shared dataset. It is an existing BigQuery dataset with a
+     * collection of objects such as tables and views that you want to share
+     * with subscribers.
+     * When subscriber's subscribe to a listing, Analytics Hub creates a linked
+     * dataset in
+     * the subscriber's project. A Linked dataset is an opaque, read-only BigQuery
+     * dataset that serves as a _symbolic link_ to a shared dataset.
+     * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Listing_BigQueryDatasetSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Listing_BigQueryDatasetSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.class, + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Builder + .class); + } + + // Construct using + // com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + dataset_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Listing_BigQueryDatasetSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource build() { + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource result = + new com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource(this); + result.dataset_ = dataset_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.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.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) { + return mergeFrom( + (com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + .getDefaultInstance()) return this; + if (!other.getDataset().isEmpty()) { + dataset_ = other.dataset_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + dataset_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object dataset_ = ""; + /** + * + * + *
+       * Resource name of the dataset source for this listing.
+       * e.g. `projects/myproject/datasets/123`
+       * 
+ * + * string dataset = 1 [(.google.api.resource_reference) = { ... } + * + * @return The dataset. + */ + public java.lang.String getDataset() { + java.lang.Object ref = dataset_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataset_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Resource name of the dataset source for this listing.
+       * e.g. `projects/myproject/datasets/123`
+       * 
+ * + * string dataset = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for dataset. + */ + public com.google.protobuf.ByteString getDatasetBytes() { + java.lang.Object ref = dataset_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Resource name of the dataset source for this listing.
+       * e.g. `projects/myproject/datasets/123`
+       * 
+ * + * string dataset = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The dataset to set. + * @return This builder for chaining. + */ + public Builder setDataset(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dataset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Resource name of the dataset source for this listing.
+       * e.g. `projects/myproject/datasets/123`
+       * 
+ * + * string dataset = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearDataset() { + + dataset_ = getDefaultInstance().getDataset(); + onChanged(); + return this; + } + /** + * + * + *
+       * Resource name of the dataset source for this listing.
+       * e.g. `projects/myproject/datasets/123`
+       * 
+ * + * string dataset = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for dataset to set. + * @return This builder for chaining. + */ + public Builder setDatasetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dataset_ = 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.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) + private static final com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BigQueryDatasetSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BIGQUERY_DATASET(6), + 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 6: + return BIGQUERY_DATASET; + 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 BIGQUERY_DATASET_FIELD_NUMBER = 6; + /** + * + * + *
+   * Required. Shared dataset i.e. BigQuery dataset source.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigqueryDataset field is set. + */ + @java.lang.Override + public boolean hasBigqueryDataset() { + return sourceCase_ == 6; + } + /** + * + * + *
+   * Required. Shared dataset i.e. BigQuery dataset source.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigqueryDataset. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + getBigqueryDataset() { + if (sourceCase_ == 6) { + return (com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) source_; + } + return com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + .getDefaultInstance(); + } + /** + * + * + *
+   * Required. Shared dataset i.e. BigQuery dataset source.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSourceOrBuilder + getBigqueryDatasetOrBuilder() { + if (sourceCase_ == 6) { + return (com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) source_; + } + return com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + .getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`
+   * 
+ * + * 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 listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`
+   * 
+ * + * 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_; + /** + * + * + *
+   * Required. Human-readable display name of the listing. The display name must contain
+   * only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces
+   * ( ), ampersands (&) and can't start or end with spaces.
+   * Default value is an empty string.
+   * Max length: 63 bytes.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Human-readable display name of the listing. The display name must contain
+   * only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces
+   * ( ), ampersands (&) and can't start or end with spaces.
+   * Default value is an empty string.
+   * Max length: 63 bytes.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Optional. Short description of the listing. The description must not contain
+   * Unicode non-characters and C0 and C1 control codes except tabs (HT),
+   * new lines (LF), carriage returns (CR), and page breaks (FF).
+   * Default value is an empty string.
+   * Max length: 2000 bytes.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Short description of the listing. The description must not contain
+   * Unicode non-characters and C0 and C1 control codes except tabs (HT),
+   * new lines (LF), carriage returns (CR), and page breaks (FF).
+   * Default value is an empty string.
+   * Max length: 2000 bytes.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIMARY_CONTACT_FIELD_NUMBER = 4; + private volatile java.lang.Object primaryContact_; + /** + * + * + *
+   * Optional. Email or URL of the primary point of contact of the listing.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryContact. + */ + @java.lang.Override + public java.lang.String getPrimaryContact() { + java.lang.Object ref = primaryContact_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryContact_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Email or URL of the primary point of contact of the listing.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryContact. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrimaryContactBytes() { + java.lang.Object ref = primaryContact_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryContact_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENTATION_FIELD_NUMBER = 5; + private volatile java.lang.Object documentation_; + /** + * + * + *
+   * Optional. Documentation describing the listing.
+   * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The documentation. + */ + @java.lang.Override + public java.lang.String getDocumentation() { + java.lang.Object ref = documentation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentation_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Documentation describing the listing.
+   * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for documentation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDocumentationBytes() { + java.lang.Object ref = documentation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 7; + private int state_; + /** + * + * + *
+   * Output only. Current state of the listing.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. Current state of the listing.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.analyticshub.v1.Listing.State result = + com.google.cloud.bigquery.analyticshub.v1.Listing.State.valueOf(state_); + return result == null + ? com.google.cloud.bigquery.analyticshub.v1.Listing.State.UNRECOGNIZED + : result; + } + + public static final int ICON_FIELD_NUMBER = 8; + private com.google.protobuf.ByteString icon_; + /** + * + * + *
+   * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB
+   * Expected image dimensions are 512x512 pixels, however the API only
+   * performs validation on size of the encoded data.
+   * Note: For byte fields, the contents of the field are base64-encoded (which
+   * increases the size of the data by 33-36%) when using JSON on the wire.
+   * 
+ * + * bytes icon = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The icon. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIcon() { + return icon_; + } + + public static final int DATA_PROVIDER_FIELD_NUMBER = 9; + private com.google.cloud.bigquery.analyticshub.v1.DataProvider dataProvider_; + /** + * + * + *
+   * Optional. Details of the data provider who owns the source data.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataProvider field is set. + */ + @java.lang.Override + public boolean hasDataProvider() { + return dataProvider_ != null; + } + /** + * + * + *
+   * Optional. Details of the data provider who owns the source data.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataProvider. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataProvider getDataProvider() { + return dataProvider_ == null + ? com.google.cloud.bigquery.analyticshub.v1.DataProvider.getDefaultInstance() + : dataProvider_; + } + /** + * + * + *
+   * Optional. Details of the data provider who owns the source data.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataProviderOrBuilder + getDataProviderOrBuilder() { + return getDataProvider(); + } + + public static final int CATEGORIES_FIELD_NUMBER = 10; + private java.util.List categories_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.bigquery.analyticshub.v1.Listing.Category> + categories_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.bigquery.analyticshub.v1.Listing.Category>() { + public com.google.cloud.bigquery.analyticshub.v1.Listing.Category convert( + java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.analyticshub.v1.Listing.Category result = + com.google.cloud.bigquery.analyticshub.v1.Listing.Category.valueOf(from); + return result == null + ? com.google.cloud.bigquery.analyticshub.v1.Listing.Category.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Optional. Categories of the listing. Up to two categories are allowed.
+   * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the categories. + */ + @java.lang.Override + public java.util.List + getCategoriesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.bigquery.analyticshub.v1.Listing.Category>( + categories_, categories_converter_); + } + /** + * + * + *
+   * Optional. Categories of the listing. Up to two categories are allowed.
+   * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of categories. + */ + @java.lang.Override + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+   * Optional. Categories of the listing. Up to two categories are allowed.
+   * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing.Category getCategories(int index) { + return categories_converter_.convert(categories_.get(index)); + } + /** + * + * + *
+   * Optional. Categories of the listing. Up to two categories are allowed.
+   * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for categories. + */ + @java.lang.Override + public java.util.List getCategoriesValueList() { + return categories_; + } + /** + * + * + *
+   * Optional. Categories of the listing. Up to two categories are allowed.
+   * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of categories at the given index. + */ + @java.lang.Override + public int getCategoriesValue(int index) { + return categories_.get(index); + } + + private int categoriesMemoizedSerializedSize; + + public static final int PUBLISHER_FIELD_NUMBER = 11; + private com.google.cloud.bigquery.analyticshub.v1.Publisher publisher_; + /** + * + * + *
+   * Optional. Details of the publisher who owns the listing and who can share
+   * the source data.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the publisher field is set. + */ + @java.lang.Override + public boolean hasPublisher() { + return publisher_ != null; + } + /** + * + * + *
+   * Optional. Details of the publisher who owns the listing and who can share
+   * the source data.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The publisher. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Publisher getPublisher() { + return publisher_ == null + ? com.google.cloud.bigquery.analyticshub.v1.Publisher.getDefaultInstance() + : publisher_; + } + /** + * + * + *
+   * Optional. Details of the publisher who owns the listing and who can share
+   * the source data.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.PublisherOrBuilder getPublisherOrBuilder() { + return getPublisher(); + } + + public static final int REQUEST_ACCESS_FIELD_NUMBER = 12; + private volatile java.lang.Object requestAccess_; + /** + * + * + *
+   * Optional. Email or URL of the request access of the listing.
+   * Subscribers can use this reference to request access.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestAccess. + */ + @java.lang.Override + public java.lang.String getRequestAccess() { + java.lang.Object ref = requestAccess_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestAccess_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Email or URL of the request access of the listing.
+   * Subscribers can use this reference to request access.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestAccess. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestAccessBytes() { + java.lang.Object ref = requestAccess_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestAccess_ = 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryContact_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, primaryContact_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, documentation_); + } + if (sourceCase_ == 6) { + output.writeMessage( + 6, (com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) source_); + } + if (state_ + != com.google.cloud.bigquery.analyticshub.v1.Listing.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(7, state_); + } + if (!icon_.isEmpty()) { + output.writeBytes(8, icon_); + } + if (dataProvider_ != null) { + output.writeMessage(9, getDataProvider()); + } + if (getCategoriesList().size() > 0) { + output.writeUInt32NoTag(82); + output.writeUInt32NoTag(categoriesMemoizedSerializedSize); + } + for (int i = 0; i < categories_.size(); i++) { + output.writeEnumNoTag(categories_.get(i)); + } + if (publisher_ != null) { + output.writeMessage(11, getPublisher()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestAccess_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, requestAccess_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryContact_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, primaryContact_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, documentation_); + } + if (sourceCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) source_); + } + if (state_ + != com.google.cloud.bigquery.analyticshub.v1.Listing.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); + } + if (!icon_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(8, icon_); + } + if (dataProvider_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getDataProvider()); + } + { + int dataSize = 0; + for (int i = 0; i < categories_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(categories_.get(i)); + } + size += dataSize; + if (!getCategoriesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + categoriesMemoizedSerializedSize = dataSize; + } + if (publisher_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getPublisher()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestAccess_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, requestAccess_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = 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.bigquery.analyticshub.v1.Listing)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.Listing other = + (com.google.cloud.bigquery.analyticshub.v1.Listing) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getPrimaryContact().equals(other.getPrimaryContact())) return false; + if (!getDocumentation().equals(other.getDocumentation())) return false; + if (state_ != other.state_) return false; + if (!getIcon().equals(other.getIcon())) return false; + if (hasDataProvider() != other.hasDataProvider()) return false; + if (hasDataProvider()) { + if (!getDataProvider().equals(other.getDataProvider())) return false; + } + if (!categories_.equals(other.categories_)) return false; + if (hasPublisher() != other.hasPublisher()) return false; + if (hasPublisher()) { + if (!getPublisher().equals(other.getPublisher())) return false; + } + if (!getRequestAccess().equals(other.getRequestAccess())) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 6: + if (!getBigqueryDataset().equals(other.getBigqueryDataset())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + PRIMARY_CONTACT_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryContact().hashCode(); + hash = (37 * hash) + DOCUMENTATION_FIELD_NUMBER; + hash = (53 * hash) + getDocumentation().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + ICON_FIELD_NUMBER; + hash = (53 * hash) + getIcon().hashCode(); + if (hasDataProvider()) { + hash = (37 * hash) + DATA_PROVIDER_FIELD_NUMBER; + hash = (53 * hash) + getDataProvider().hashCode(); + } + if (getCategoriesCount() > 0) { + hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + categories_.hashCode(); + } + if (hasPublisher()) { + hash = (37 * hash) + PUBLISHER_FIELD_NUMBER; + hash = (53 * hash) + getPublisher().hashCode(); + } + hash = (37 * hash) + REQUEST_ACCESS_FIELD_NUMBER; + hash = (53 * hash) + getRequestAccess().hashCode(); + switch (sourceCase_) { + case 6: + hash = (37 * hash) + BIGQUERY_DATASET_FIELD_NUMBER; + hash = (53 * hash) + getBigqueryDataset().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing 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.bigquery.analyticshub.v1.Listing parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing parseFrom( + 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.bigquery.analyticshub.v1.Listing parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing parseFrom( + java.io.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.bigquery.analyticshub.v1.Listing parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.Listing parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.Listing prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A listing is what gets published into a data exchange that a subscriber can
+   * subscribe to. It contains a reference to the data source along with
+   * descriptive information that will help subscribers find and subscribe the
+   * data.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.Listing} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.Listing) + com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Listing_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Listing_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.Listing.class, + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder.class); + } + + // Construct using com.google.cloud.bigquery.analyticshub.v1.Listing.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (bigqueryDatasetBuilder_ != null) { + bigqueryDatasetBuilder_.clear(); + } + name_ = ""; + + displayName_ = ""; + + description_ = ""; + + primaryContact_ = ""; + + documentation_ = ""; + + state_ = 0; + + icon_ = com.google.protobuf.ByteString.EMPTY; + + if (dataProviderBuilder_ == null) { + dataProvider_ = null; + } else { + dataProvider_ = null; + dataProviderBuilder_ = null; + } + categories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + if (publisherBuilder_ == null) { + publisher_ = null; + } else { + publisher_ = null; + publisherBuilder_ = null; + } + requestAccess_ = ""; + + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Listing_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.Listing.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing build() { + com.google.cloud.bigquery.analyticshub.v1.Listing result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.Listing result = + new com.google.cloud.bigquery.analyticshub.v1.Listing(this); + int from_bitField0_ = bitField0_; + if (sourceCase_ == 6) { + if (bigqueryDatasetBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = bigqueryDatasetBuilder_.build(); + } + } + result.name_ = name_; + result.displayName_ = displayName_; + result.description_ = description_; + result.primaryContact_ = primaryContact_; + result.documentation_ = documentation_; + result.state_ = state_; + result.icon_ = icon_; + if (dataProviderBuilder_ == null) { + result.dataProvider_ = dataProvider_; + } else { + result.dataProvider_ = dataProviderBuilder_.build(); + } + if (((bitField0_ & 0x00000001) != 0)) { + categories_ = java.util.Collections.unmodifiableList(categories_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.categories_ = categories_; + if (publisherBuilder_ == null) { + result.publisher_ = publisher_; + } else { + result.publisher_ = publisherBuilder_.build(); + } + result.requestAccess_ = requestAccess_; + 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.bigquery.analyticshub.v1.Listing) { + return mergeFrom((com.google.cloud.bigquery.analyticshub.v1.Listing) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.analyticshub.v1.Listing other) { + if (other == com.google.cloud.bigquery.analyticshub.v1.Listing.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.getPrimaryContact().isEmpty()) { + primaryContact_ = other.primaryContact_; + onChanged(); + } + if (!other.getDocumentation().isEmpty()) { + documentation_ = other.documentation_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.getIcon() != com.google.protobuf.ByteString.EMPTY) { + setIcon(other.getIcon()); + } + if (other.hasDataProvider()) { + mergeDataProvider(other.getDataProvider()); + } + if (!other.categories_.isEmpty()) { + if (categories_.isEmpty()) { + categories_ = other.categories_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCategoriesIsMutable(); + categories_.addAll(other.categories_); + } + onChanged(); + } + if (other.hasPublisher()) { + mergePublisher(other.getPublisher()); + } + if (!other.getRequestAccess().isEmpty()) { + requestAccess_ = other.requestAccess_; + onChanged(); + } + switch (other.getSourceCase()) { + case BIGQUERY_DATASET: + { + mergeBigqueryDataset(other.getBigqueryDataset()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + primaryContact_ = input.readStringRequireUtf8(); + + break; + } // case 34 + case 42: + { + documentation_ = input.readStringRequireUtf8(); + + break; + } // case 42 + case 50: + { + input.readMessage(getBigqueryDatasetFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 6; + break; + } // case 50 + case 56: + { + state_ = input.readEnum(); + + break; + } // case 56 + case 66: + { + icon_ = input.readBytes(); + + break; + } // case 66 + case 74: + { + input.readMessage(getDataProviderFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 74 + case 80: + { + int tmpRaw = input.readEnum(); + ensureCategoriesIsMutable(); + categories_.add(tmpRaw); + break; + } // case 80 + case 82: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureCategoriesIsMutable(); + categories_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 82 + case 90: + { + input.readMessage(getPublisherFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 90 + case 98: + { + requestAccess_ = input.readStringRequireUtf8(); + + break; + } // case 98 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int 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 int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource, + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Builder, + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSourceOrBuilder> + bigqueryDatasetBuilder_; + /** + * + * + *
+     * Required. Shared dataset i.e. BigQuery dataset source.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigqueryDataset field is set. + */ + @java.lang.Override + public boolean hasBigqueryDataset() { + return sourceCase_ == 6; + } + /** + * + * + *
+     * Required. Shared dataset i.e. BigQuery dataset source.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigqueryDataset. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + getBigqueryDataset() { + if (bigqueryDatasetBuilder_ == null) { + if (sourceCase_ == 6) { + return (com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) source_; + } + return com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + .getDefaultInstance(); + } else { + if (sourceCase_ == 6) { + return bigqueryDatasetBuilder_.getMessage(); + } + return com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Shared dataset i.e. BigQuery dataset source.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBigqueryDataset( + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource value) { + if (bigqueryDatasetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + bigqueryDatasetBuilder_.setMessage(value); + } + sourceCase_ = 6; + return this; + } + /** + * + * + *
+     * Required. Shared dataset i.e. BigQuery dataset source.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBigqueryDataset( + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Builder + builderForValue) { + if (bigqueryDatasetBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + bigqueryDatasetBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 6; + return this; + } + /** + * + * + *
+     * Required. Shared dataset i.e. BigQuery dataset source.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBigqueryDataset( + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource value) { + if (bigqueryDatasetBuilder_ == null) { + if (sourceCase_ == 6 + && source_ + != com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + .getDefaultInstance()) { + source_ = + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.newBuilder( + (com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) + source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 6) { + bigqueryDatasetBuilder_.mergeFrom(value); + } else { + bigqueryDatasetBuilder_.setMessage(value); + } + } + sourceCase_ = 6; + return this; + } + /** + * + * + *
+     * Required. Shared dataset i.e. BigQuery dataset source.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBigqueryDataset() { + if (bigqueryDatasetBuilder_ == null) { + if (sourceCase_ == 6) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 6) { + sourceCase_ = 0; + source_ = null; + } + bigqueryDatasetBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Shared dataset i.e. BigQuery dataset source.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Builder + getBigqueryDatasetBuilder() { + return getBigqueryDatasetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Shared dataset i.e. BigQuery dataset source.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSourceOrBuilder + getBigqueryDatasetOrBuilder() { + if ((sourceCase_ == 6) && (bigqueryDatasetBuilder_ != null)) { + return bigqueryDatasetBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 6) { + return (com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) source_; + } + return com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Shared dataset i.e. BigQuery dataset source.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource, + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Builder, + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSourceOrBuilder> + getBigqueryDatasetFieldBuilder() { + if (bigqueryDatasetBuilder_ == null) { + if (!(sourceCase_ == 6)) { + source_ = + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource + .getDefaultInstance(); + } + bigqueryDatasetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource, + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Builder, + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSourceOrBuilder>( + (com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 6; + onChanged(); + ; + return bigqueryDatasetBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`
+     * 
+ * + * 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 listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`
+     * 
+ * + * 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 listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`
+     * 
+ * + * 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 listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`
+     * 
+ * + * 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 listing.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`
+     * 
+ * + * 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_ = ""; + /** + * + * + *
+     * Required. Human-readable display name of the listing. The display name must contain
+     * only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces
+     * ( ), ampersands (&) and can't start or end with spaces.
+     * Default value is an empty string.
+     * Max length: 63 bytes.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Human-readable display name of the listing. The display name must contain
+     * only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces
+     * ( ), ampersands (&) and can't start or end with spaces.
+     * Default value is an empty string.
+     * Max length: 63 bytes.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Human-readable display name of the listing. The display name must contain
+     * only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces
+     * ( ), ampersands (&) and can't start or end with spaces.
+     * Default value is an empty string.
+     * Max length: 63 bytes.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Human-readable display name of the listing. The display name must contain
+     * only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces
+     * ( ), ampersands (&) and can't start or end with spaces.
+     * Default value is an empty string.
+     * Max length: 63 bytes.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Human-readable display name of the listing. The display name must contain
+     * only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces
+     * ( ), ampersands (&) and can't start or end with spaces.
+     * Default value is an empty string.
+     * Max length: 63 bytes.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. Short description of the listing. The description must not contain
+     * Unicode non-characters and C0 and C1 control codes except tabs (HT),
+     * new lines (LF), carriage returns (CR), and page breaks (FF).
+     * Default value is an empty string.
+     * Max length: 2000 bytes.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Short description of the listing. The description must not contain
+     * Unicode non-characters and C0 and C1 control codes except tabs (HT),
+     * new lines (LF), carriage returns (CR), and page breaks (FF).
+     * Default value is an empty string.
+     * Max length: 2000 bytes.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Short description of the listing. The description must not contain
+     * Unicode non-characters and C0 and C1 control codes except tabs (HT),
+     * new lines (LF), carriage returns (CR), and page breaks (FF).
+     * Default value is an empty string.
+     * Max length: 2000 bytes.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Short description of the listing. The description must not contain
+     * Unicode non-characters and C0 and C1 control codes except tabs (HT),
+     * new lines (LF), carriage returns (CR), and page breaks (FF).
+     * Default value is an empty string.
+     * Max length: 2000 bytes.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Short description of the listing. The description must not contain
+     * Unicode non-characters and C0 and C1 control codes except tabs (HT),
+     * new lines (LF), carriage returns (CR), and page breaks (FF).
+     * Default value is an empty string.
+     * Max length: 2000 bytes.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object primaryContact_ = ""; + /** + * + * + *
+     * Optional. Email or URL of the primary point of contact of the listing.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryContact. + */ + public java.lang.String getPrimaryContact() { + java.lang.Object ref = primaryContact_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryContact_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Email or URL of the primary point of contact of the listing.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryContact. + */ + public com.google.protobuf.ByteString getPrimaryContactBytes() { + java.lang.Object ref = primaryContact_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryContact_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Email or URL of the primary point of contact of the listing.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The primaryContact to set. + * @return This builder for chaining. + */ + public Builder setPrimaryContact(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + primaryContact_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Email or URL of the primary point of contact of the listing.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPrimaryContact() { + + primaryContact_ = getDefaultInstance().getPrimaryContact(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Email or URL of the primary point of contact of the listing.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for primaryContact to set. + * @return This builder for chaining. + */ + public Builder setPrimaryContactBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + primaryContact_ = value; + onChanged(); + return this; + } + + private java.lang.Object documentation_ = ""; + /** + * + * + *
+     * Optional. Documentation describing the listing.
+     * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The documentation. + */ + public java.lang.String getDocumentation() { + java.lang.Object ref = documentation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Documentation describing the listing.
+     * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for documentation. + */ + public com.google.protobuf.ByteString getDocumentationBytes() { + java.lang.Object ref = documentation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Documentation describing the listing.
+     * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The documentation to set. + * @return This builder for chaining. + */ + public Builder setDocumentation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + documentation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Documentation describing the listing.
+     * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDocumentation() { + + documentation_ = getDefaultInstance().getDocumentation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Documentation describing the listing.
+     * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for documentation to set. + * @return This builder for chaining. + */ + public Builder setDocumentationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + documentation_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. Current state of the listing.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. Current state of the listing.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the listing.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.analyticshub.v1.Listing.State result = + com.google.cloud.bigquery.analyticshub.v1.Listing.State.valueOf(state_); + return result == null + ? com.google.cloud.bigquery.analyticshub.v1.Listing.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Current state of the listing.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.bigquery.analyticshub.v1.Listing.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the listing.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString icon_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB
+     * Expected image dimensions are 512x512 pixels, however the API only
+     * performs validation on size of the encoded data.
+     * Note: For byte fields, the contents of the field are base64-encoded (which
+     * increases the size of the data by 33-36%) when using JSON on the wire.
+     * 
+ * + * bytes icon = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The icon. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIcon() { + return icon_; + } + /** + * + * + *
+     * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB
+     * Expected image dimensions are 512x512 pixels, however the API only
+     * performs validation on size of the encoded data.
+     * Note: For byte fields, the contents of the field are base64-encoded (which
+     * increases the size of the data by 33-36%) when using JSON on the wire.
+     * 
+ * + * bytes icon = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The icon to set. + * @return This builder for chaining. + */ + public Builder setIcon(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + icon_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB
+     * Expected image dimensions are 512x512 pixels, however the API only
+     * performs validation on size of the encoded data.
+     * Note: For byte fields, the contents of the field are base64-encoded (which
+     * increases the size of the data by 33-36%) when using JSON on the wire.
+     * 
+ * + * bytes icon = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearIcon() { + + icon_ = getDefaultInstance().getIcon(); + onChanged(); + return this; + } + + private com.google.cloud.bigquery.analyticshub.v1.DataProvider dataProvider_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataProvider, + com.google.cloud.bigquery.analyticshub.v1.DataProvider.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataProviderOrBuilder> + dataProviderBuilder_; + /** + * + * + *
+     * Optional. Details of the data provider who owns the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataProvider field is set. + */ + public boolean hasDataProvider() { + return dataProviderBuilder_ != null || dataProvider_ != null; + } + /** + * + * + *
+     * Optional. Details of the data provider who owns the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataProvider. + */ + public com.google.cloud.bigquery.analyticshub.v1.DataProvider getDataProvider() { + if (dataProviderBuilder_ == null) { + return dataProvider_ == null + ? com.google.cloud.bigquery.analyticshub.v1.DataProvider.getDefaultInstance() + : dataProvider_; + } else { + return dataProviderBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Details of the data provider who owns the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDataProvider(com.google.cloud.bigquery.analyticshub.v1.DataProvider value) { + if (dataProviderBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataProvider_ = value; + onChanged(); + } else { + dataProviderBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Details of the data provider who owns the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDataProvider( + com.google.cloud.bigquery.analyticshub.v1.DataProvider.Builder builderForValue) { + if (dataProviderBuilder_ == null) { + dataProvider_ = builderForValue.build(); + onChanged(); + } else { + dataProviderBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Details of the data provider who owns the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDataProvider(com.google.cloud.bigquery.analyticshub.v1.DataProvider value) { + if (dataProviderBuilder_ == null) { + if (dataProvider_ != null) { + dataProvider_ = + com.google.cloud.bigquery.analyticshub.v1.DataProvider.newBuilder(dataProvider_) + .mergeFrom(value) + .buildPartial(); + } else { + dataProvider_ = value; + } + onChanged(); + } else { + dataProviderBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Details of the data provider who owns the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDataProvider() { + if (dataProviderBuilder_ == null) { + dataProvider_ = null; + onChanged(); + } else { + dataProvider_ = null; + dataProviderBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Details of the data provider who owns the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.DataProvider.Builder getDataProviderBuilder() { + + onChanged(); + return getDataProviderFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Details of the data provider who owns the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.DataProviderOrBuilder + getDataProviderOrBuilder() { + if (dataProviderBuilder_ != null) { + return dataProviderBuilder_.getMessageOrBuilder(); + } else { + return dataProvider_ == null + ? com.google.cloud.bigquery.analyticshub.v1.DataProvider.getDefaultInstance() + : dataProvider_; + } + } + /** + * + * + *
+     * Optional. Details of the data provider who owns the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataProvider, + com.google.cloud.bigquery.analyticshub.v1.DataProvider.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataProviderOrBuilder> + getDataProviderFieldBuilder() { + if (dataProviderBuilder_ == null) { + dataProviderBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataProvider, + com.google.cloud.bigquery.analyticshub.v1.DataProvider.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataProviderOrBuilder>( + getDataProvider(), getParentForChildren(), isClean()); + dataProvider_ = null; + } + return dataProviderBuilder_; + } + + private java.util.List categories_ = java.util.Collections.emptyList(); + + private void ensureCategoriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + categories_ = new java.util.ArrayList(categories_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Optional. Categories of the listing. Up to two categories are allowed.
+     * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the categories. + */ + public java.util.List + getCategoriesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.bigquery.analyticshub.v1.Listing.Category>( + categories_, categories_converter_); + } + /** + * + * + *
+     * Optional. Categories of the listing. Up to two categories are allowed.
+     * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+     * Optional. Categories of the listing. Up to two categories are allowed.
+     * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + public com.google.cloud.bigquery.analyticshub.v1.Listing.Category getCategories(int index) { + return categories_converter_.convert(categories_.get(index)); + } + /** + * + * + *
+     * Optional. Categories of the listing. Up to two categories are allowed.
+     * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The categories to set. + * @return This builder for chaining. + */ + public Builder setCategories( + int index, com.google.cloud.bigquery.analyticshub.v1.Listing.Category value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Categories of the listing. Up to two categories are allowed.
+     * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The categories to add. + * @return This builder for chaining. + */ + public Builder addCategories(com.google.cloud.bigquery.analyticshub.v1.Listing.Category value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Categories of the listing. Up to two categories are allowed.
+     * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The categories to add. + * @return This builder for chaining. + */ + public Builder addAllCategories( + java.lang.Iterable + values) { + ensureCategoriesIsMutable(); + for (com.google.cloud.bigquery.analyticshub.v1.Listing.Category value : values) { + categories_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Categories of the listing. Up to two categories are allowed.
+     * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearCategories() { + categories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Categories of the listing. Up to two categories are allowed.
+     * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for categories. + */ + public java.util.List getCategoriesValueList() { + return java.util.Collections.unmodifiableList(categories_); + } + /** + * + * + *
+     * Optional. Categories of the listing. Up to two categories are allowed.
+     * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of categories at the given index. + */ + public int getCategoriesValue(int index) { + return categories_.get(index); + } + /** + * + * + *
+     * Optional. Categories of the listing. Up to two categories are allowed.
+     * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for categories to set. + * @return This builder for chaining. + */ + public Builder setCategoriesValue(int index, int value) { + ensureCategoriesIsMutable(); + categories_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Categories of the listing. Up to two categories are allowed.
+     * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for categories to add. + * @return This builder for chaining. + */ + public Builder addCategoriesValue(int value) { + ensureCategoriesIsMutable(); + categories_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Categories of the listing. Up to two categories are allowed.
+     * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The enum numeric values on the wire for categories to add. + * @return This builder for chaining. + */ + public Builder addAllCategoriesValue(java.lang.Iterable values) { + ensureCategoriesIsMutable(); + for (int value : values) { + categories_.add(value); + } + onChanged(); + return this; + } + + private com.google.cloud.bigquery.analyticshub.v1.Publisher publisher_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Publisher, + com.google.cloud.bigquery.analyticshub.v1.Publisher.Builder, + com.google.cloud.bigquery.analyticshub.v1.PublisherOrBuilder> + publisherBuilder_; + /** + * + * + *
+     * Optional. Details of the publisher who owns the listing and who can share
+     * the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the publisher field is set. + */ + public boolean hasPublisher() { + return publisherBuilder_ != null || publisher_ != null; + } + /** + * + * + *
+     * Optional. Details of the publisher who owns the listing and who can share
+     * the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The publisher. + */ + public com.google.cloud.bigquery.analyticshub.v1.Publisher getPublisher() { + if (publisherBuilder_ == null) { + return publisher_ == null + ? com.google.cloud.bigquery.analyticshub.v1.Publisher.getDefaultInstance() + : publisher_; + } else { + return publisherBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Details of the publisher who owns the listing and who can share
+     * the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPublisher(com.google.cloud.bigquery.analyticshub.v1.Publisher value) { + if (publisherBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + publisher_ = value; + onChanged(); + } else { + publisherBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Details of the publisher who owns the listing and who can share
+     * the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPublisher( + com.google.cloud.bigquery.analyticshub.v1.Publisher.Builder builderForValue) { + if (publisherBuilder_ == null) { + publisher_ = builderForValue.build(); + onChanged(); + } else { + publisherBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Details of the publisher who owns the listing and who can share
+     * the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergePublisher(com.google.cloud.bigquery.analyticshub.v1.Publisher value) { + if (publisherBuilder_ == null) { + if (publisher_ != null) { + publisher_ = + com.google.cloud.bigquery.analyticshub.v1.Publisher.newBuilder(publisher_) + .mergeFrom(value) + .buildPartial(); + } else { + publisher_ = value; + } + onChanged(); + } else { + publisherBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Details of the publisher who owns the listing and who can share
+     * the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPublisher() { + if (publisherBuilder_ == null) { + publisher_ = null; + onChanged(); + } else { + publisher_ = null; + publisherBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Details of the publisher who owns the listing and who can share
+     * the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.Publisher.Builder getPublisherBuilder() { + + onChanged(); + return getPublisherFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Details of the publisher who owns the listing and who can share
+     * the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.PublisherOrBuilder getPublisherOrBuilder() { + if (publisherBuilder_ != null) { + return publisherBuilder_.getMessageOrBuilder(); + } else { + return publisher_ == null + ? com.google.cloud.bigquery.analyticshub.v1.Publisher.getDefaultInstance() + : publisher_; + } + } + /** + * + * + *
+     * Optional. Details of the publisher who owns the listing and who can share
+     * the source data.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Publisher, + com.google.cloud.bigquery.analyticshub.v1.Publisher.Builder, + com.google.cloud.bigquery.analyticshub.v1.PublisherOrBuilder> + getPublisherFieldBuilder() { + if (publisherBuilder_ == null) { + publisherBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Publisher, + com.google.cloud.bigquery.analyticshub.v1.Publisher.Builder, + com.google.cloud.bigquery.analyticshub.v1.PublisherOrBuilder>( + getPublisher(), getParentForChildren(), isClean()); + publisher_ = null; + } + return publisherBuilder_; + } + + private java.lang.Object requestAccess_ = ""; + /** + * + * + *
+     * Optional. Email or URL of the request access of the listing.
+     * Subscribers can use this reference to request access.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestAccess. + */ + public java.lang.String getRequestAccess() { + java.lang.Object ref = requestAccess_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestAccess_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Email or URL of the request access of the listing.
+     * Subscribers can use this reference to request access.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestAccess. + */ + public com.google.protobuf.ByteString getRequestAccessBytes() { + java.lang.Object ref = requestAccess_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestAccess_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Email or URL of the request access of the listing.
+     * Subscribers can use this reference to request access.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestAccess to set. + * @return This builder for chaining. + */ + public Builder setRequestAccess(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestAccess_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Email or URL of the request access of the listing.
+     * Subscribers can use this reference to request access.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestAccess() { + + requestAccess_ = getDefaultInstance().getRequestAccess(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Email or URL of the request access of the listing.
+     * Subscribers can use this reference to request access.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestAccess to set. + * @return This builder for chaining. + */ + public Builder setRequestAccessBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestAccess_ = 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.bigquery.analyticshub.v1.Listing) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.Listing) + private static final com.google.cloud.bigquery.analyticshub.v1.Listing DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.Listing(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Listing getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Listing parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.Listing getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListingName.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListingName.java new file mode 100644 index 000000000000..b1be73460900 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListingName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ListingName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_DATA_EXCHANGE_LISTING = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String dataExchange; + private final String listing; + + @Deprecated + protected ListingName() { + project = null; + location = null; + dataExchange = null; + listing = null; + } + + private ListingName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + dataExchange = Preconditions.checkNotNull(builder.getDataExchange()); + listing = Preconditions.checkNotNull(builder.getListing()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataExchange() { + return dataExchange; + } + + public String getListing() { + return listing; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ListingName of( + String project, String location, String dataExchange, String listing) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataExchange(dataExchange) + .setListing(listing) + .build(); + } + + public static String format( + String project, String location, String dataExchange, String listing) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataExchange(dataExchange) + .setListing(listing) + .build() + .toString(); + } + + public static ListingName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_DATA_EXCHANGE_LISTING.validatedMatch( + formattedString, "ListingName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("data_exchange"), + matchMap.get("listing")); + } + + 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 (ListingName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DATA_EXCHANGE_LISTING.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (dataExchange != null) { + fieldMapBuilder.put("data_exchange", dataExchange); + } + if (listing != null) { + fieldMapBuilder.put("listing", listing); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_DATA_EXCHANGE_LISTING.instantiate( + "project", + project, + "location", + location, + "data_exchange", + dataExchange, + "listing", + listing); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ListingName that = ((ListingName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.dataExchange, that.dataExchange) + && Objects.equals(this.listing, that.listing); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(dataExchange); + h *= 1000003; + h ^= Objects.hashCode(listing); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}. + */ + public static class Builder { + private String project; + private String location; + private String dataExchange; + private String listing; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataExchange() { + return dataExchange; + } + + public String getListing() { + return listing; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDataExchange(String dataExchange) { + this.dataExchange = dataExchange; + return this; + } + + public Builder setListing(String listing) { + this.listing = listing; + return this; + } + + private Builder(ListingName listingName) { + this.project = listingName.project; + this.location = listingName.location; + this.dataExchange = listingName.dataExchange; + this.listing = listingName.listing; + } + + public ListingName build() { + return new ListingName(this); + } + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListingOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListingOrBuilder.java new file mode 100644 index 000000000000..e33d5191f04d --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/ListingOrBuilder.java @@ -0,0 +1,447 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface ListingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.Listing) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Shared dataset i.e. BigQuery dataset source.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigqueryDataset field is set. + */ + boolean hasBigqueryDataset(); + /** + * + * + *
+   * Required. Shared dataset i.e. BigQuery dataset source.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigqueryDataset. + */ + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource getBigqueryDataset(); + /** + * + * + *
+   * Required. Shared dataset i.e. BigQuery dataset source.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource bigquery_dataset = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSourceOrBuilder + getBigqueryDatasetOrBuilder(); + + /** + * + * + *
+   * Output only. The resource name of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the listing.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Human-readable display name of the listing. The display name must contain
+   * only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces
+   * ( ), ampersands (&) and can't start or end with spaces.
+   * Default value is an empty string.
+   * Max length: 63 bytes.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. Human-readable display name of the listing. The display name must contain
+   * only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces
+   * ( ), ampersands (&) and can't start or end with spaces.
+   * Default value is an empty string.
+   * Max length: 63 bytes.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Optional. Short description of the listing. The description must not contain
+   * Unicode non-characters and C0 and C1 control codes except tabs (HT),
+   * new lines (LF), carriage returns (CR), and page breaks (FF).
+   * Default value is an empty string.
+   * Max length: 2000 bytes.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. Short description of the listing. The description must not contain
+   * Unicode non-characters and C0 and C1 control codes except tabs (HT),
+   * new lines (LF), carriage returns (CR), and page breaks (FF).
+   * Default value is an empty string.
+   * Max length: 2000 bytes.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Optional. Email or URL of the primary point of contact of the listing.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryContact. + */ + java.lang.String getPrimaryContact(); + /** + * + * + *
+   * Optional. Email or URL of the primary point of contact of the listing.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryContact. + */ + com.google.protobuf.ByteString getPrimaryContactBytes(); + + /** + * + * + *
+   * Optional. Documentation describing the listing.
+   * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The documentation. + */ + java.lang.String getDocumentation(); + /** + * + * + *
+   * Optional. Documentation describing the listing.
+   * 
+ * + * string documentation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for documentation. + */ + com.google.protobuf.ByteString getDocumentationBytes(); + + /** + * + * + *
+   * Output only. Current state of the listing.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. Current state of the listing.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.bigquery.analyticshub.v1.Listing.State getState(); + + /** + * + * + *
+   * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB
+   * Expected image dimensions are 512x512 pixels, however the API only
+   * performs validation on size of the encoded data.
+   * Note: For byte fields, the contents of the field are base64-encoded (which
+   * increases the size of the data by 33-36%) when using JSON on the wire.
+   * 
+ * + * bytes icon = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The icon. + */ + com.google.protobuf.ByteString getIcon(); + + /** + * + * + *
+   * Optional. Details of the data provider who owns the source data.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataProvider field is set. + */ + boolean hasDataProvider(); + /** + * + * + *
+   * Optional. Details of the data provider who owns the source data.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataProvider. + */ + com.google.cloud.bigquery.analyticshub.v1.DataProvider getDataProvider(); + /** + * + * + *
+   * Optional. Details of the data provider who owns the source data.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataProvider data_provider = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.bigquery.analyticshub.v1.DataProviderOrBuilder getDataProviderOrBuilder(); + + /** + * + * + *
+   * Optional. Categories of the listing. Up to two categories are allowed.
+   * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the categories. + */ + java.util.List getCategoriesList(); + /** + * + * + *
+   * Optional. Categories of the listing. Up to two categories are allowed.
+   * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of categories. + */ + int getCategoriesCount(); + /** + * + * + *
+   * Optional. Categories of the listing. Up to two categories are allowed.
+   * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + com.google.cloud.bigquery.analyticshub.v1.Listing.Category getCategories(int index); + /** + * + * + *
+   * Optional. Categories of the listing. Up to two categories are allowed.
+   * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for categories. + */ + java.util.List getCategoriesValueList(); + /** + * + * + *
+   * Optional. Categories of the listing. Up to two categories are allowed.
+   * 
+ * + * + * repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of categories at the given index. + */ + int getCategoriesValue(int index); + + /** + * + * + *
+   * Optional. Details of the publisher who owns the listing and who can share
+   * the source data.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the publisher field is set. + */ + boolean hasPublisher(); + /** + * + * + *
+   * Optional. Details of the publisher who owns the listing and who can share
+   * the source data.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The publisher. + */ + com.google.cloud.bigquery.analyticshub.v1.Publisher getPublisher(); + /** + * + * + *
+   * Optional. Details of the publisher who owns the listing and who can share
+   * the source data.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Publisher publisher = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.bigquery.analyticshub.v1.PublisherOrBuilder getPublisherOrBuilder(); + + /** + * + * + *
+   * Optional. Email or URL of the request access of the listing.
+   * Subscribers can use this reference to request access.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestAccess. + */ + java.lang.String getRequestAccess(); + /** + * + * + *
+   * Optional. Email or URL of the request access of the listing.
+   * Subscribers can use this reference to request access.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string request_access = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestAccess. + */ + com.google.protobuf.ByteString getRequestAccessBytes(); + + public com.google.cloud.bigquery.analyticshub.v1.Listing.SourceCase getSourceCase(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/LocationName.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/LocationName.java new file mode 100644 index 000000000000..ed075ad23fb8 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.analyticshub.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/Publisher.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/Publisher.java new file mode 100644 index 000000000000..52ac87e7f288 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/Publisher.java @@ -0,0 +1,800 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Contains details of the listing publisher.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.Publisher} + */ +public final class Publisher extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.Publisher) + PublisherOrBuilder { + private static final long serialVersionUID = 0L; + // Use Publisher.newBuilder() to construct. + private Publisher(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Publisher() { + name_ = ""; + primaryContact_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Publisher(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Publisher_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Publisher_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.Publisher.class, + com.google.cloud.bigquery.analyticshub.v1.Publisher.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Optional. Name of the listing publisher.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Name of the listing publisher.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 PRIMARY_CONTACT_FIELD_NUMBER = 2; + private volatile java.lang.Object primaryContact_; + /** + * + * + *
+   * Optional. Email or URL of the listing publisher.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryContact. + */ + @java.lang.Override + public java.lang.String getPrimaryContact() { + java.lang.Object ref = primaryContact_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryContact_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Email or URL of the listing publisher.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryContact. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrimaryContactBytes() { + java.lang.Object ref = primaryContact_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryContact_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryContact_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, primaryContact_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryContact_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, primaryContact_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = 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.bigquery.analyticshub.v1.Publisher)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.Publisher other = + (com.google.cloud.bigquery.analyticshub.v1.Publisher) obj; + + if (!getName().equals(other.getName())) return false; + if (!getPrimaryContact().equals(other.getPrimaryContact())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PRIMARY_CONTACT_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryContact().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.Publisher parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Publisher 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.bigquery.analyticshub.v1.Publisher parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Publisher parseFrom( + 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.bigquery.analyticshub.v1.Publisher parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Publisher parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Publisher parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Publisher parseFrom( + java.io.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.bigquery.analyticshub.v1.Publisher parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Publisher parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.Publisher parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Publisher parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.Publisher prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Contains details of the listing publisher.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.Publisher} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.Publisher) + com.google.cloud.bigquery.analyticshub.v1.PublisherOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Publisher_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Publisher_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.Publisher.class, + com.google.cloud.bigquery.analyticshub.v1.Publisher.Builder.class); + } + + // Construct using com.google.cloud.bigquery.analyticshub.v1.Publisher.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + primaryContact_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_Publisher_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Publisher getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.Publisher.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Publisher build() { + com.google.cloud.bigquery.analyticshub.v1.Publisher result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Publisher buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.Publisher result = + new com.google.cloud.bigquery.analyticshub.v1.Publisher(this); + result.name_ = name_; + result.primaryContact_ = primaryContact_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.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.bigquery.analyticshub.v1.Publisher) { + return mergeFrom((com.google.cloud.bigquery.analyticshub.v1.Publisher) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.analyticshub.v1.Publisher other) { + if (other == com.google.cloud.bigquery.analyticshub.v1.Publisher.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getPrimaryContact().isEmpty()) { + primaryContact_ = other.primaryContact_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + primaryContact_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Optional. Name of the listing publisher.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Name of the listing publisher.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Name of the listing publisher.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. Name of the listing publisher.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Name of the listing publisher.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 primaryContact_ = ""; + /** + * + * + *
+     * Optional. Email or URL of the listing publisher.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryContact. + */ + public java.lang.String getPrimaryContact() { + java.lang.Object ref = primaryContact_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryContact_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Email or URL of the listing publisher.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryContact. + */ + public com.google.protobuf.ByteString getPrimaryContactBytes() { + java.lang.Object ref = primaryContact_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryContact_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Email or URL of the listing publisher.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The primaryContact to set. + * @return This builder for chaining. + */ + public Builder setPrimaryContact(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + primaryContact_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Email or URL of the listing publisher.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPrimaryContact() { + + primaryContact_ = getDefaultInstance().getPrimaryContact(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Email or URL of the listing publisher.
+     * Max Length: 1000 bytes.
+     * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for primaryContact to set. + * @return This builder for chaining. + */ + public Builder setPrimaryContactBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + primaryContact_ = 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.bigquery.analyticshub.v1.Publisher) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.Publisher) + private static final com.google.cloud.bigquery.analyticshub.v1.Publisher DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.Publisher(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.Publisher getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Publisher parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.Publisher getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/PublisherOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/PublisherOrBuilder.java new file mode 100644 index 000000000000..443ab98a3ab3 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/PublisherOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface PublisherOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.Publisher) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Name of the listing publisher.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Optional. Name of the listing publisher.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Email or URL of the listing publisher.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryContact. + */ + java.lang.String getPrimaryContact(); + /** + * + * + *
+   * Optional. Email or URL of the listing publisher.
+   * Max Length: 1000 bytes.
+   * 
+ * + * string primary_contact = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryContact. + */ + com.google.protobuf.ByteString getPrimaryContactBytes(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingRequest.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingRequest.java new file mode 100644 index 000000000000..ceb9aed89436 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingRequest.java @@ -0,0 +1,1037 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for subscribing to a listing.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest} + */ +public final class SubscribeListingRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest) + SubscribeListingRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubscribeListingRequest.newBuilder() to construct. + private SubscribeListingRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SubscribeListingRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SubscribeListingRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest.class, + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest.Builder.class); + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DESTINATION_DATASET(3), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(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 DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 3: + return DESTINATION_DATASET; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int DESTINATION_DATASET_FIELD_NUMBER = 3; + /** + * + * + *
+   * BigQuery destination dataset to create for the subscriber.
+   * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + * + * @return Whether the destinationDataset field is set. + */ + @java.lang.Override + public boolean hasDestinationDataset() { + return destinationCase_ == 3; + } + /** + * + * + *
+   * BigQuery destination dataset to create for the subscriber.
+   * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + * + * @return The destinationDataset. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DestinationDataset getDestinationDataset() { + if (destinationCase_ == 3) { + return (com.google.cloud.bigquery.analyticshub.v1.DestinationDataset) destination_; + } + return com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.getDefaultInstance(); + } + /** + * + * + *
+   * BigQuery destination dataset to create for the subscriber.
+   * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetOrBuilder + getDestinationDatasetOrBuilder() { + if (destinationCase_ == 3) { + return (com.google.cloud.bigquery.analyticshub.v1.DestinationDataset) destination_; + } + return com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Resource name of the listing that you want to subscribe to.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name of the listing that you want to subscribe to.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (destinationCase_ == 3) { + output.writeMessage( + 3, (com.google.cloud.bigquery.analyticshub.v1.DestinationDataset) destination_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (destinationCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.bigquery.analyticshub.v1.DestinationDataset) destination_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest other = + (com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 3: + if (!getDestinationDataset().equals(other.getDestinationDataset())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + switch (destinationCase_) { + case 3: + hash = (37 * hash) + DESTINATION_DATASET_FIELD_NUMBER; + hash = (53 * hash) + getDestinationDataset().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest 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.bigquery.analyticshub.v1.SubscribeListingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest parseFrom( + 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.bigquery.analyticshub.v1.SubscribeListingRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest parseFrom( + java.io.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.bigquery.analyticshub.v1.SubscribeListingRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest + parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.SubscribeListingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.SubscribeListingRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for subscribing to a listing.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest) + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest.class, + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (destinationDatasetBuilder_ != null) { + destinationDatasetBuilder_.clear(); + } + name_ = ""; + + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest build() { + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest result = + new com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest(this); + if (destinationCase_ == 3) { + if (destinationDatasetBuilder_ == null) { + result.destination_ = destination_; + } else { + result.destination_ = destinationDatasetBuilder_.build(); + } + } + result.name_ = name_; + result.destinationCase_ = destinationCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.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.bigquery.analyticshub.v1.SubscribeListingRequest) { + return mergeFrom((com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + switch (other.getDestinationCase()) { + case DESTINATION_DATASET: + { + mergeDestinationDataset(other.getDestinationDataset()); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 26: + { + input.readMessage( + getDestinationDatasetFieldBuilder().getBuilder(), extensionRegistry); + destinationCase_ = 3; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset, + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.Builder, + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetOrBuilder> + destinationDatasetBuilder_; + /** + * + * + *
+     * BigQuery destination dataset to create for the subscriber.
+     * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + * + * + * @return Whether the destinationDataset field is set. + */ + @java.lang.Override + public boolean hasDestinationDataset() { + return destinationCase_ == 3; + } + /** + * + * + *
+     * BigQuery destination dataset to create for the subscriber.
+     * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + * + * + * @return The destinationDataset. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DestinationDataset getDestinationDataset() { + if (destinationDatasetBuilder_ == null) { + if (destinationCase_ == 3) { + return (com.google.cloud.bigquery.analyticshub.v1.DestinationDataset) destination_; + } + return com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.getDefaultInstance(); + } else { + if (destinationCase_ == 3) { + return destinationDatasetBuilder_.getMessage(); + } + return com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery destination dataset to create for the subscriber.
+     * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + * + */ + public Builder setDestinationDataset( + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset value) { + if (destinationDatasetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + destinationDatasetBuilder_.setMessage(value); + } + destinationCase_ = 3; + return this; + } + /** + * + * + *
+     * BigQuery destination dataset to create for the subscriber.
+     * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + * + */ + public Builder setDestinationDataset( + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.Builder builderForValue) { + if (destinationDatasetBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + destinationDatasetBuilder_.setMessage(builderForValue.build()); + } + destinationCase_ = 3; + return this; + } + /** + * + * + *
+     * BigQuery destination dataset to create for the subscriber.
+     * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + * + */ + public Builder mergeDestinationDataset( + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset value) { + if (destinationDatasetBuilder_ == null) { + if (destinationCase_ == 3 + && destination_ + != com.google.cloud.bigquery.analyticshub.v1.DestinationDataset + .getDefaultInstance()) { + destination_ = + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.newBuilder( + (com.google.cloud.bigquery.analyticshub.v1.DestinationDataset) destination_) + .mergeFrom(value) + .buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + if (destinationCase_ == 3) { + destinationDatasetBuilder_.mergeFrom(value); + } else { + destinationDatasetBuilder_.setMessage(value); + } + } + destinationCase_ = 3; + return this; + } + /** + * + * + *
+     * BigQuery destination dataset to create for the subscriber.
+     * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + * + */ + public Builder clearDestinationDataset() { + if (destinationDatasetBuilder_ == null) { + if (destinationCase_ == 3) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + } else { + if (destinationCase_ == 3) { + destinationCase_ = 0; + destination_ = null; + } + destinationDatasetBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * BigQuery destination dataset to create for the subscriber.
+     * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.Builder + getDestinationDatasetBuilder() { + return getDestinationDatasetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * BigQuery destination dataset to create for the subscriber.
+     * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetOrBuilder + getDestinationDatasetOrBuilder() { + if ((destinationCase_ == 3) && (destinationDatasetBuilder_ != null)) { + return destinationDatasetBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 3) { + return (com.google.cloud.bigquery.analyticshub.v1.DestinationDataset) destination_; + } + return com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery destination dataset to create for the subscriber.
+     * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset, + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.Builder, + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetOrBuilder> + getDestinationDatasetFieldBuilder() { + if (destinationDatasetBuilder_ == null) { + if (!(destinationCase_ == 3)) { + destination_ = + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.getDefaultInstance(); + } + destinationDatasetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset, + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset.Builder, + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetOrBuilder>( + (com.google.cloud.bigquery.analyticshub.v1.DestinationDataset) destination_, + getParentForChildren(), + isClean()); + destination_ = null; + } + destinationCase_ = 3; + onChanged(); + ; + return destinationDatasetBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name of the listing that you want to subscribe to.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the listing that you want to subscribe to.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the listing that you want to subscribe to.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the listing that you want to subscribe to.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the listing that you want to subscribe to.
+     * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest) + private static final com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubscribeListingRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.SubscribeListingRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingRequestOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingRequestOrBuilder.java new file mode 100644 index 000000000000..30a4342d2603 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface SubscribeListingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * BigQuery destination dataset to create for the subscriber.
+   * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + * + * @return Whether the destinationDataset field is set. + */ + boolean hasDestinationDataset(); + /** + * + * + *
+   * BigQuery destination dataset to create for the subscriber.
+   * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + * + * @return The destinationDataset. + */ + com.google.cloud.bigquery.analyticshub.v1.DestinationDataset getDestinationDataset(); + /** + * + * + *
+   * BigQuery destination dataset to create for the subscriber.
+   * 
+ * + * .google.cloud.bigquery.analyticshub.v1.DestinationDataset destination_dataset = 3; + */ + com.google.cloud.bigquery.analyticshub.v1.DestinationDatasetOrBuilder + getDestinationDatasetOrBuilder(); + + /** + * + * + *
+   * Required. Resource name of the listing that you want to subscribe to.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name of the listing that you want to subscribe to.
+   * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + public com.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest.DestinationCase + getDestinationCase(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingResponse.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingResponse.java new file mode 100644 index 000000000000..d5bbdbd9c3d0 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingResponse.java @@ -0,0 +1,447 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for response when you subscribe to a listing.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse} + */ +public final class SubscribeListingResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse) + SubscribeListingResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubscribeListingResponse.newBuilder() to construct. + private SubscribeListingResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SubscribeListingResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SubscribeListingResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse.class, + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse other = + (com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse 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.bigquery.analyticshub.v1.SubscribeListingResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse parseFrom( + 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.bigquery.analyticshub.v1.SubscribeListingResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse parseFrom( + java.io.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.bigquery.analyticshub.v1.SubscribeListingResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse + parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.SubscribeListingResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.SubscribeListingResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response when you subscribe to a listing.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse) + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse.class, + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_SubscribeListingResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse build() { + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse result = + new com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse) { + return mergeFrom( + (com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse) + private static final com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubscribeListingResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.SubscribeListingResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingResponseOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingResponseOrBuilder.java new file mode 100644 index 000000000000..18ef5218a150 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/SubscribeListingResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface SubscribeListingResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateDataExchangeRequest.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateDataExchangeRequest.java new file mode 100644 index 000000000000..6a33d85a0932 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateDataExchangeRequest.java @@ -0,0 +1,1040 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for updating a data exchange.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest} + */ +public final class UpdateDataExchangeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest) + UpdateDataExchangeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateDataExchangeRequest.newBuilder() to construct. + private UpdateDataExchangeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateDataExchangeRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateDataExchangeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_UpdateDataExchangeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_UpdateDataExchangeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest.class, + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Field mask specifies the fields to update in the data exchange
+   * resource. The fields specified in the
+   * `updateMask` are relative to the resource and are not a full request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Field mask specifies the fields to update in the data exchange
+   * resource. The fields specified in the
+   * `updateMask` are relative to the resource and are not a full request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Field mask specifies the fields to update in the data exchange
+   * resource. The fields specified in the
+   * `updateMask` are relative to the resource and are not a full request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int DATA_EXCHANGE_FIELD_NUMBER = 2; + private com.google.cloud.bigquery.analyticshub.v1.DataExchange dataExchange_; + /** + * + * + *
+   * Required. The data exchange to update.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataExchange field is set. + */ + @java.lang.Override + public boolean hasDataExchange() { + return dataExchange_ != null; + } + /** + * + * + *
+   * Required. The data exchange to update.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataExchange. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataExchange getDataExchange() { + return dataExchange_ == null + ? com.google.cloud.bigquery.analyticshub.v1.DataExchange.getDefaultInstance() + : dataExchange_; + } + /** + * + * + *
+   * Required. The data exchange to update.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder + getDataExchangeOrBuilder() { + return getDataExchange(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (dataExchange_ != null) { + output.writeMessage(2, getDataExchange()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (dataExchange_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDataExchange()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = 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.bigquery.analyticshub.v1.UpdateDataExchangeRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest other = + (com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasDataExchange() != other.hasDataExchange()) return false; + if (hasDataExchange()) { + if (!getDataExchange().equals(other.getDataExchange())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasDataExchange()) { + hash = (37 * hash) + DATA_EXCHANGE_FIELD_NUMBER; + hash = (53 * hash) + getDataExchange().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest 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.bigquery.analyticshub.v1.UpdateDataExchangeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest parseFrom( + 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.bigquery.analyticshub.v1.UpdateDataExchangeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest parseFrom( + java.io.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.bigquery.analyticshub.v1.UpdateDataExchangeRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest + parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.UpdateDataExchangeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.UpdateDataExchangeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for updating a data exchange.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest) + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_UpdateDataExchangeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_UpdateDataExchangeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest.class, + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (dataExchangeBuilder_ == null) { + dataExchange_ = null; + } else { + dataExchange_ = null; + dataExchangeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_UpdateDataExchangeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest build() { + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest result = + new com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (dataExchangeBuilder_ == null) { + result.dataExchange_ = dataExchange_; + } else { + result.dataExchange_ = dataExchangeBuilder_.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.bigquery.analyticshub.v1.UpdateDataExchangeRequest) { + return mergeFrom( + (com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest + .getDefaultInstance()) return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasDataExchange()) { + mergeDataExchange(other.getDataExchange()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getDataExchangeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the data exchange
+     * resource. The fields specified in the
+     * `updateMask` are relative to the resource and are not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the data exchange
+     * resource. The fields specified in the
+     * `updateMask` are relative to the resource and are not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the data exchange
+     * resource. The fields specified in the
+     * `updateMask` are relative to the resource and are not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the data exchange
+     * resource. The fields specified in the
+     * `updateMask` are relative to the resource and are not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the data exchange
+     * resource. The fields specified in the
+     * `updateMask` are relative to the resource and are not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the data exchange
+     * resource. The fields specified in the
+     * `updateMask` are relative to the resource and are not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the data exchange
+     * resource. The fields specified in the
+     * `updateMask` are relative to the resource and are not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the data exchange
+     * resource. The fields specified in the
+     * `updateMask` are relative to the resource and are not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the data exchange
+     * resource. The fields specified in the
+     * `updateMask` are relative to the resource and are not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.bigquery.analyticshub.v1.DataExchange dataExchange_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataExchange, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder> + dataExchangeBuilder_; + /** + * + * + *
+     * Required. The data exchange to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataExchange field is set. + */ + public boolean hasDataExchange() { + return dataExchangeBuilder_ != null || dataExchange_ != null; + } + /** + * + * + *
+     * Required. The data exchange to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataExchange. + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange getDataExchange() { + if (dataExchangeBuilder_ == null) { + return dataExchange_ == null + ? com.google.cloud.bigquery.analyticshub.v1.DataExchange.getDefaultInstance() + : dataExchange_; + } else { + return dataExchangeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The data exchange to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDataExchange(com.google.cloud.bigquery.analyticshub.v1.DataExchange value) { + if (dataExchangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataExchange_ = value; + onChanged(); + } else { + dataExchangeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The data exchange to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDataExchange( + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder builderForValue) { + if (dataExchangeBuilder_ == null) { + dataExchange_ = builderForValue.build(); + onChanged(); + } else { + dataExchangeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The data exchange to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDataExchange(com.google.cloud.bigquery.analyticshub.v1.DataExchange value) { + if (dataExchangeBuilder_ == null) { + if (dataExchange_ != null) { + dataExchange_ = + com.google.cloud.bigquery.analyticshub.v1.DataExchange.newBuilder(dataExchange_) + .mergeFrom(value) + .buildPartial(); + } else { + dataExchange_ = value; + } + onChanged(); + } else { + dataExchangeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The data exchange to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDataExchange() { + if (dataExchangeBuilder_ == null) { + dataExchange_ = null; + onChanged(); + } else { + dataExchange_ = null; + dataExchangeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The data exchange to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder getDataExchangeBuilder() { + + onChanged(); + return getDataExchangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The data exchange to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder + getDataExchangeOrBuilder() { + if (dataExchangeBuilder_ != null) { + return dataExchangeBuilder_.getMessageOrBuilder(); + } else { + return dataExchange_ == null + ? com.google.cloud.bigquery.analyticshub.v1.DataExchange.getDefaultInstance() + : dataExchange_; + } + } + /** + * + * + *
+     * Required. The data exchange to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataExchange, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder> + getDataExchangeFieldBuilder() { + if (dataExchangeBuilder_ == null) { + dataExchangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.DataExchange, + com.google.cloud.bigquery.analyticshub.v1.DataExchange.Builder, + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder>( + getDataExchange(), getParentForChildren(), isClean()); + dataExchange_ = null; + } + return dataExchangeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(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.bigquery.analyticshub.v1.UpdateDataExchangeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest) + private static final com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateDataExchangeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.UpdateDataExchangeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateDataExchangeRequestOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateDataExchangeRequestOrBuilder.java new file mode 100644 index 000000000000..dcad677a109e --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateDataExchangeRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface UpdateDataExchangeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Field mask specifies the fields to update in the data exchange
+   * resource. The fields specified in the
+   * `updateMask` are relative to the resource and are not a full request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Field mask specifies the fields to update in the data exchange
+   * resource. The fields specified in the
+   * `updateMask` are relative to the resource and are not a full request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Field mask specifies the fields to update in the data exchange
+   * resource. The fields specified in the
+   * `updateMask` are relative to the resource and are not a full request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The data exchange to update.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataExchange field is set. + */ + boolean hasDataExchange(); + /** + * + * + *
+   * Required. The data exchange to update.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataExchange. + */ + com.google.cloud.bigquery.analyticshub.v1.DataExchange getDataExchange(); + /** + * + * + *
+   * Required. The data exchange to update.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.DataExchange data_exchange = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.bigquery.analyticshub.v1.DataExchangeOrBuilder getDataExchangeOrBuilder(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateListingRequest.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateListingRequest.java new file mode 100644 index 000000000000..e4463ec1769c --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateListingRequest.java @@ -0,0 +1,1033 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +/** + * + * + *
+ * Message for updating a Listing.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.UpdateListingRequest} + */ +public final class UpdateListingRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.analyticshub.v1.UpdateListingRequest) + UpdateListingRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateListingRequest.newBuilder() to construct. + private UpdateListingRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateListingRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateListingRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_UpdateListingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_UpdateListingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest.class, + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Field mask specifies the fields to update in the listing resource. The
+   * fields specified in the `updateMask` are relative to the resource and are
+   * not a full request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Field mask specifies the fields to update in the listing resource. The
+   * fields specified in the `updateMask` are relative to the resource and are
+   * not a full request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Field mask specifies the fields to update in the listing resource. The
+   * fields specified in the `updateMask` are relative to the resource and are
+   * not a full request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int LISTING_FIELD_NUMBER = 2; + private com.google.cloud.bigquery.analyticshub.v1.Listing listing_; + /** + * + * + *
+   * Required. The listing to update.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the listing field is set. + */ + @java.lang.Override + public boolean hasListing() { + return listing_ != null; + } + /** + * + * + *
+   * Required. The listing to update.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The listing. + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.Listing getListing() { + return listing_ == null + ? com.google.cloud.bigquery.analyticshub.v1.Listing.getDefaultInstance() + : listing_; + } + /** + * + * + *
+   * Required. The listing to update.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder getListingOrBuilder() { + return getListing(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (listing_ != null) { + output.writeMessage(2, getListing()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (listing_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getListing()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = 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.bigquery.analyticshub.v1.UpdateListingRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest other = + (com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasListing() != other.hasListing()) return false; + if (hasListing()) { + if (!getListing().equals(other.getListing())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasListing()) { + hash = (37 * hash) + LISTING_FIELD_NUMBER; + hash = (53 * hash) + getListing().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest 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.bigquery.analyticshub.v1.UpdateListingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest parseFrom( + 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.bigquery.analyticshub.v1.UpdateListingRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest parseFrom( + java.io.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.bigquery.analyticshub.v1.UpdateListingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest parseDelimitedFrom( + java.io.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.bigquery.analyticshub.v1.UpdateListingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.bigquery.analyticshub.v1.UpdateListingRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for updating a Listing.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.analyticshub.v1.UpdateListingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.analyticshub.v1.UpdateListingRequest) + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_UpdateListingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_UpdateListingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest.class, + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (listingBuilder_ == null) { + listing_ = null; + } else { + listing_ = null; + listingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.analyticshub.v1.AnalyticsHubProto + .internal_static_google_cloud_bigquery_analyticshub_v1_UpdateListingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest build() { + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest buildPartial() { + com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest result = + new com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (listingBuilder_ == null) { + result.listing_ = listing_; + } else { + result.listing_ = listingBuilder_.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.bigquery.analyticshub.v1.UpdateListingRequest) { + return mergeFrom((com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest other) { + if (other + == com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasListing()) { + mergeListing(other.getListing()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getListingFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the listing resource. The
+     * fields specified in the `updateMask` are relative to the resource and are
+     * not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the listing resource. The
+     * fields specified in the `updateMask` are relative to the resource and are
+     * not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the listing resource. The
+     * fields specified in the `updateMask` are relative to the resource and are
+     * not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the listing resource. The
+     * fields specified in the `updateMask` are relative to the resource and are
+     * not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the listing resource. The
+     * fields specified in the `updateMask` are relative to the resource and are
+     * not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the listing resource. The
+     * fields specified in the `updateMask` are relative to the resource and are
+     * not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the listing resource. The
+     * fields specified in the `updateMask` are relative to the resource and are
+     * not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the listing resource. The
+     * fields specified in the `updateMask` are relative to the resource and are
+     * not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Field mask specifies the fields to update in the listing resource. The
+     * fields specified in the `updateMask` are relative to the resource and are
+     * not a full request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.bigquery.analyticshub.v1.Listing listing_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Listing, + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder, + com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder> + listingBuilder_; + /** + * + * + *
+     * Required. The listing to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the listing field is set. + */ + public boolean hasListing() { + return listingBuilder_ != null || listing_ != null; + } + /** + * + * + *
+     * Required. The listing to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The listing. + */ + public com.google.cloud.bigquery.analyticshub.v1.Listing getListing() { + if (listingBuilder_ == null) { + return listing_ == null + ? com.google.cloud.bigquery.analyticshub.v1.Listing.getDefaultInstance() + : listing_; + } else { + return listingBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The listing to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setListing(com.google.cloud.bigquery.analyticshub.v1.Listing value) { + if (listingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + listing_ = value; + onChanged(); + } else { + listingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The listing to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setListing( + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder builderForValue) { + if (listingBuilder_ == null) { + listing_ = builderForValue.build(); + onChanged(); + } else { + listingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The listing to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeListing(com.google.cloud.bigquery.analyticshub.v1.Listing value) { + if (listingBuilder_ == null) { + if (listing_ != null) { + listing_ = + com.google.cloud.bigquery.analyticshub.v1.Listing.newBuilder(listing_) + .mergeFrom(value) + .buildPartial(); + } else { + listing_ = value; + } + onChanged(); + } else { + listingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The listing to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearListing() { + if (listingBuilder_ == null) { + listing_ = null; + onChanged(); + } else { + listing_ = null; + listingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The listing to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.Listing.Builder getListingBuilder() { + + onChanged(); + return getListingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The listing to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder getListingOrBuilder() { + if (listingBuilder_ != null) { + return listingBuilder_.getMessageOrBuilder(); + } else { + return listing_ == null + ? com.google.cloud.bigquery.analyticshub.v1.Listing.getDefaultInstance() + : listing_; + } + } + /** + * + * + *
+     * Required. The listing to update.
+     * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Listing, + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder, + com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder> + getListingFieldBuilder() { + if (listingBuilder_ == null) { + listingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.analyticshub.v1.Listing, + com.google.cloud.bigquery.analyticshub.v1.Listing.Builder, + com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder>( + getListing(), getParentForChildren(), isClean()); + listing_ = null; + } + return listingBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(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.bigquery.analyticshub.v1.UpdateListingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.analyticshub.v1.UpdateListingRequest) + private static final com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest(); + } + + public static com.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateListingRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.bigquery.analyticshub.v1.UpdateListingRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateListingRequestOrBuilder.java b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateListingRequestOrBuilder.java new file mode 100644 index 000000000000..4b26e10684f2 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/java/com/google/cloud/bigquery/analyticshub/v1/UpdateListingRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * 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/bigquery/analyticshub/v1/analyticshub.proto + +package com.google.cloud.bigquery.analyticshub.v1; + +public interface UpdateListingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.analyticshub.v1.UpdateListingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Field mask specifies the fields to update in the listing resource. The
+   * fields specified in the `updateMask` are relative to the resource and are
+   * not a full request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Field mask specifies the fields to update in the listing resource. The
+   * fields specified in the `updateMask` are relative to the resource and are
+   * not a full request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Field mask specifies the fields to update in the listing resource. The
+   * fields specified in the `updateMask` are relative to the resource and are
+   * not a full request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The listing to update.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the listing field is set. + */ + boolean hasListing(); + /** + * + * + *
+   * Required. The listing to update.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The listing. + */ + com.google.cloud.bigquery.analyticshub.v1.Listing getListing(); + /** + * + * + *
+   * Required. The listing to update.
+   * 
+ * + * + * .google.cloud.bigquery.analyticshub.v1.Listing listing = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.bigquery.analyticshub.v1.ListingOrBuilder getListingOrBuilder(); +} diff --git a/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/proto/google/cloud/bigquery/analyticshub/v1/analyticshub.proto b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/proto/google/cloud/bigquery/analyticshub/v1/analyticshub.proto new file mode 100644 index 000000000000..7adf65844432 --- /dev/null +++ b/java-analyticshub/proto-google-cloud-analyticshub-v1/src/main/proto/google/cloud/bigquery/analyticshub/v1/analyticshub.proto @@ -0,0 +1,651 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.analyticshub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.AnalyticsHub.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/analyticshub/v1;analyticshub"; +option java_multiple_files = true; +option java_outer_classname = "AnalyticsHubProto"; +option java_package = "com.google.cloud.bigquery.analyticshub.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\AnalyticsHub\\V1"; +option ruby_package = "Google::Cloud::Bigquery::AnalyticsHub::V1"; +option (google.api.resource_definition) = { + type: "bigquery.googleapis.com/Dataset" + pattern: "projects/{project}/datasets/{dataset}" +}; + +// The `AnalyticsHubService` API facilitates data sharing within and across +// organizations. It allows data providers to publish listings that reference +// shared datasets. With Analytics Hub, users can discover and search for +// listings that they have access to. Subscribers can view and subscribe to +// listings. When you subscribe to a listing, Analytics Hub creates a linked +// dataset in your project. +service AnalyticsHubService { + option (google.api.default_host) = "analyticshub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all data exchanges in a given project and location. + rpc ListDataExchanges(ListDataExchangesRequest) returns (ListDataExchangesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/dataExchanges" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all data exchanges from projects in a given organization and + // location. + rpc ListOrgDataExchanges(ListOrgDataExchangesRequest) returns (ListOrgDataExchangesResponse) { + option (google.api.http) = { + get: "/v1/{organization=organizations/*/locations/*}/dataExchanges" + }; + option (google.api.method_signature) = "organization"; + } + + // Gets the details of a data exchange. + rpc GetDataExchange(GetDataExchangeRequest) returns (DataExchange) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dataExchanges/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new data exchange. + rpc CreateDataExchange(CreateDataExchangeRequest) returns (DataExchange) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/dataExchanges" + body: "data_exchange" + }; + option (google.api.method_signature) = "parent,data_exchange"; + } + + // Updates an existing data exchange. + rpc UpdateDataExchange(UpdateDataExchangeRequest) returns (DataExchange) { + option (google.api.http) = { + patch: "/v1/{data_exchange.name=projects/*/locations/*/dataExchanges/*}" + body: "data_exchange" + }; + option (google.api.method_signature) = "data_exchange,update_mask"; + } + + // Deletes an existing data exchange. + rpc DeleteDataExchange(DeleteDataExchangeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/dataExchanges/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all listings in a given project and location. + rpc ListListings(ListListingsRequest) returns (ListListingsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/dataExchanges/*}/listings" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a listing. + rpc GetListing(GetListingRequest) returns (Listing) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new listing. + rpc CreateListing(CreateListingRequest) returns (Listing) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/dataExchanges/*}/listings" + body: "listing" + }; + option (google.api.method_signature) = "parent,listing"; + } + + // Updates an existing listing. + rpc UpdateListing(UpdateListingRequest) returns (Listing) { + option (google.api.http) = { + patch: "/v1/{listing.name=projects/*/locations/*/dataExchanges/*/listings/*}" + body: "listing" + }; + option (google.api.method_signature) = "listing,update_mask"; + } + + // Deletes a listing. + rpc DeleteListing(DeleteListingRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Subscribes to a listing. + // + // Currently, with Analytics Hub, you can create listings that + // reference only BigQuery datasets. + // Upon subscription to a listing for a BigQuery dataset, Analytics Hub + // creates a linked dataset in the subscriber's project. + rpc SubscribeListing(SubscribeListingRequest) returns (SubscribeListingResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}:subscribe" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the IAM policy. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/dataExchanges/*}:getIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:getIamPolicy" + body: "*" + } + }; + } + + // Sets the IAM policy. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/dataExchanges/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:setIamPolicy" + body: "*" + } + }; + } + + // Returns the permissions that a caller has. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/dataExchanges/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:testIamPermissions" + body: "*" + } + }; + } +} + +// A data exchange is a container that lets you share data. Along with the +// descriptive information about the data exchange, it contains listings that +// reference shared datasets. +message DataExchange { + option (google.api.resource) = { + type: "analyticshub.googleapis.com/DataExchange" + pattern: "projects/{project}/locations/{location}/dataExchanges/{data_exchange}" + }; + + // Output only. The resource name of the data exchange. + // e.g. `projects/myproject/locations/US/dataExchanges/123`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Human-readable display name of the data exchange. The display name must + // contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), + // spaces ( ), ampersands (&) and must not start or end with spaces. + // Default value is an empty string. + // Max length: 63 bytes. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description of the data exchange. The description must not contain Unicode + // non-characters as well as C0 and C1 control codes except tabs (HT), + // new lines (LF), carriage returns (CR), and page breaks (FF). + // Default value is an empty string. + // Max length: 2000 bytes. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Email or URL of the primary point of contact of the data exchange. + // Max Length: 1000 bytes. + string primary_contact = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Documentation describing the data exchange. + string documentation = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Number of listings contained in the data exchange. + int32 listing_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB + // Expected image dimensions are 512x512 pixels, however the API only + // performs validation on size of the encoded data. + // Note: For byte fields, the content of the fields are base64-encoded (which + // increases the size of the data by 33-36%) when using JSON on the wire. + bytes icon = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Contains details of the data provider. +message DataProvider { + // Optional. Name of the data provider. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Email or URL of the data provider. + // Max Length: 1000 bytes. + string primary_contact = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Contains details of the listing publisher. +message Publisher { + // Optional. Name of the listing publisher. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Email or URL of the listing publisher. + // Max Length: 1000 bytes. + string primary_contact = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Contains the reference that identifies a destination bigquery dataset. +message DestinationDatasetReference { + // Required. A unique ID for this dataset, without the project name. The ID + // must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). + // The maximum length is 1,024 characters. + string dataset_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the project containing this dataset. + string project_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Defines the destination bigquery dataset. +message DestinationDataset { + // Required. A reference that identifies the destination dataset. + DestinationDatasetReference dataset_reference = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A descriptive name for the dataset. + google.protobuf.StringValue friendly_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A user-friendly description of the dataset. + google.protobuf.StringValue description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels associated with this dataset. You can use these + // to organize and group your datasets. + // You can set this property when inserting or updating a dataset. + // See https://cloud.google.com/resource-manager/docs/creating-managing-labels + // for more information. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The geographic location where the dataset should reside. See + // https://cloud.google.com/bigquery/docs/locations for supported + // locations. + string location = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// A listing is what gets published into a data exchange that a subscriber can +// subscribe to. It contains a reference to the data source along with +// descriptive information that will help subscribers find and subscribe the +// data. +message Listing { + option (google.api.resource) = { + type: "analyticshub.googleapis.com/Listing" + pattern: "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" + }; + + // A reference to a shared dataset. It is an existing BigQuery dataset with a + // collection of objects such as tables and views that you want to share + // with subscribers. + // When subscriber's subscribe to a listing, Analytics Hub creates a linked + // dataset in + // the subscriber's project. A Linked dataset is an opaque, read-only BigQuery + // dataset that serves as a _symbolic link_ to a shared dataset. + message BigQueryDatasetSource { + // Resource name of the dataset source for this listing. + // e.g. `projects/myproject/datasets/123` + string dataset = 1 [(google.api.resource_reference) = { + type: "bigquery.googleapis.com/Dataset" + }]; + } + + // State of the listing. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // Subscribable state. Users with dataexchange.listings.subscribe permission + // can subscribe to this listing. + ACTIVE = 1; + } + + // Listing categories. + enum Category { + CATEGORY_UNSPECIFIED = 0; + + CATEGORY_OTHERS = 1; + + CATEGORY_ADVERTISING_AND_MARKETING = 2; + + CATEGORY_COMMERCE = 3; + + CATEGORY_CLIMATE_AND_ENVIRONMENT = 4; + + CATEGORY_DEMOGRAPHICS = 5; + + CATEGORY_ECONOMICS = 6; + + CATEGORY_EDUCATION = 7; + + CATEGORY_ENERGY = 8; + + CATEGORY_FINANCIAL = 9; + + CATEGORY_GAMING = 10; + + CATEGORY_GEOSPATIAL = 11; + + CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE = 12; + + CATEGORY_MEDIA = 13; + + CATEGORY_PUBLIC_SECTOR = 14; + + CATEGORY_RETAIL = 15; + + CATEGORY_SPORTS = 16; + + CATEGORY_SCIENCE_AND_RESEARCH = 17; + + CATEGORY_TRANSPORTATION_AND_LOGISTICS = 18; + + CATEGORY_TRAVEL_AND_TOURISM = 19; + } + + // Listing source. + oneof source { + // Required. Shared dataset i.e. BigQuery dataset source. + BigQueryDatasetSource bigquery_dataset = 6 [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. The resource name of the listing. + // e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Human-readable display name of the listing. The display name must contain + // only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces + // ( ), ampersands (&) and can't start or end with spaces. + // Default value is an empty string. + // Max length: 63 bytes. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Short description of the listing. The description must not contain + // Unicode non-characters and C0 and C1 control codes except tabs (HT), + // new lines (LF), carriage returns (CR), and page breaks (FF). + // Default value is an empty string. + // Max length: 2000 bytes. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Email or URL of the primary point of contact of the listing. + // Max Length: 1000 bytes. + string primary_contact = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Documentation describing the listing. + string documentation = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the listing. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB + // Expected image dimensions are 512x512 pixels, however the API only + // performs validation on size of the encoded data. + // Note: For byte fields, the contents of the field are base64-encoded (which + // increases the size of the data by 33-36%) when using JSON on the wire. + bytes icon = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Details of the data provider who owns the source data. + DataProvider data_provider = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Categories of the listing. Up to two categories are allowed. + repeated Category categories = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Details of the publisher who owns the listing and who can share + // the source data. + Publisher publisher = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Email or URL of the request access of the listing. + // Subscribers can use this reference to request access. + // Max Length: 1000 bytes. + string request_access = 12 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting the list of data exchanges. +message ListDataExchangesRequest { + // Required. The parent resource path of the data exchanges. + // e.g. `projects/myproject/locations/US`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of results to return in a single response page. Leverage + // the page tokens to iterate through the entire collection. + int32 page_size = 2; + + // Page token, returned by a previous call, to request the next page of + // results. + string page_token = 3; +} + +// Message for response to the list of data exchanges. +message ListDataExchangesResponse { + // The list of data exchanges. + repeated DataExchange data_exchanges = 1; + + // A token to request the next page of results. + string next_page_token = 2; +} + +// Message for requesting the list of data exchanges from projects in an +// organization and location. +message ListOrgDataExchangesRequest { + // Required. The organization resource path of the projects containing DataExchanges. + // e.g. `organizations/myorg/locations/US`. + string organization = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results to return in a single response page. Leverage + // the page tokens to iterate through the entire collection. + int32 page_size = 2; + + // Page token, returned by a previous call, to request the next page of + // results. + string page_token = 3; +} + +// Message for response to listing data exchanges in an organization and +// location. +message ListOrgDataExchangesResponse { + // The list of data exchanges. + repeated DataExchange data_exchanges = 1; + + // A token to request the next page of results. + string next_page_token = 2; +} + +// Message for getting a data exchange. +message GetDataExchangeRequest { + // Required. The resource name of the data exchange. + // e.g. `projects/myproject/locations/US/dataExchanges/123`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/DataExchange" + } + ]; +} + +// Message for creating a data exchange. +message CreateDataExchangeRequest { + // Required. The parent resource path of the data exchange. + // e.g. `projects/myproject/locations/US`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The ID of the data exchange. + // Must contain only Unicode letters, numbers (0-9), underscores (_). + // Should not use characters that require URL-escaping, or characters + // outside of ASCII, spaces. + // Max length: 100 bytes. + string data_exchange_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The data exchange to create. + DataExchange data_exchange = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message for updating a data exchange. +message UpdateDataExchangeRequest { + // Required. Field mask specifies the fields to update in the data exchange + // resource. The fields specified in the + // `updateMask` are relative to the resource and are not a full request. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The data exchange to update. + DataExchange data_exchange = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Message for deleting a data exchange. +message DeleteDataExchangeRequest { + // Required. The full name of the data exchange resource that you want to delete. + // For example, `projects/myproject/locations/US/dataExchanges/123`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/DataExchange" + } + ]; +} + +// Message for requesting the list of listings. +message ListListingsRequest { + // Required. The parent resource path of the listing. + // e.g. `projects/myproject/locations/US/dataExchanges/123`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/DataExchange" + } + ]; + + // The maximum number of results to return in a single response page. Leverage + // the page tokens to iterate through the entire collection. + int32 page_size = 2; + + // Page token, returned by a previous call, to request the next page of + // results. + string page_token = 3; +} + +// Message for response to the list of Listings. +message ListListingsResponse { + // The list of Listing. + repeated Listing listings = 1; + + // A token to request the next page of results. + string next_page_token = 2; +} + +// Message for getting a listing. +message GetListingRequest { + // Required. The resource name of the listing. + // e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/Listing" + } + ]; +} + +// Message for creating a listing. +message CreateListingRequest { + // Required. The parent resource path of the listing. + // e.g. `projects/myproject/locations/US/dataExchanges/123`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/DataExchange" + } + ]; + + // Required. The ID of the listing to create. + // Must contain only Unicode letters, numbers (0-9), underscores (_). + // Should not use characters that require URL-escaping, or characters + // outside of ASCII, spaces. + // Max length: 100 bytes. + string listing_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The listing to create. + Listing listing = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message for updating a Listing. +message UpdateListingRequest { + // Required. Field mask specifies the fields to update in the listing resource. The + // fields specified in the `updateMask` are relative to the resource and are + // not a full request. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The listing to update. + Listing listing = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Message for deleting a listing. +message DeleteListingRequest { + // Required. Resource name of the listing to delete. + // e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/Listing" + } + ]; +} + +// Message for subscribing to a listing. +message SubscribeListingRequest { + // Resulting destination of the listing that you subscribed to. + oneof destination { + // BigQuery destination dataset to create for the subscriber. + DestinationDataset destination_dataset = 3; + } + + // Required. Resource name of the listing that you want to subscribe to. + // e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/Listing" + } + ]; +} + +// Message for response when you subscribe to a listing. +message SubscribeListingResponse { + +} diff --git a/java-analyticshub/versions.txt b/java-analyticshub/versions.txt new file mode 100644 index 000000000000..537545281804 --- /dev/null +++ b/java-analyticshub/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-analyticshub:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-analyticshub-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-analyticshub-v1:0.0.0:0.0.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index 8cd2a9ddcc7c..0990331cc04a 100644 --- a/pom.xml +++ b/pom.xml @@ -56,6 +56,7 @@ java-aiplatform java-analytics-admin java-analytics-data + java-analyticshub java-api-gateway java-apigee-connect java-apigee-registry diff --git a/release-please-config.json b/release-please-config.json index 8818189e4262..ca2c661d0835 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -32,6 +32,10 @@ "component": "google-analytics-data", "skip-github-release": true }, + "java-analyticshub": { + "component": "google-cloud-analyticshub", + "skip-github-release": true + }, "java-api-gateway": { "component": "google-cloud-api-gateway", "skip-github-release": true