From d59789378247a31be8df4769b95aff63939b5b43 Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Wed, 24 Apr 2024 15:55:21 -0400 Subject: [PATCH] feat: [shopping-merchant-notifications] new module for shopping-merchant-notifications (#10748) --- generation_config.yaml | 15 + .../.OwlBot-hermetic.yaml | 35 + .../.repo-metadata.json | 16 + .../README.md | 225 ++ .../pom.xml | 43 + .../pom.xml | 113 + .../v1beta/NotificationsApiServiceClient.java | 1110 ++++++++ .../NotificationsApiServiceSettings.java | 273 ++ .../notifications/v1beta/gapic_metadata.json | 33 + .../notifications/v1beta/package-info.java | 46 + ...otificationsApiServiceCallableFactory.java | 115 + .../stub/GrpcNotificationsApiServiceStub.java | 355 +++ ...otificationsApiServiceCallableFactory.java | 103 + .../HttpJsonNotificationsApiServiceStub.java | 512 ++++ .../stub/NotificationsApiServiceStub.java | 83 + .../NotificationsApiServiceStubSettings.java | 565 ++++ .../reflect-config.json | 1469 +++++++++++ .../v1beta/MockNotificationsApiService.java | 59 + .../MockNotificationsApiServiceImpl.java | 170 ++ ...ficationsApiServiceClientHttpJsonTest.java | 527 ++++ .../NotificationsApiServiceClientTest.java | 479 ++++ .../pom.xml | 45 + .../v1beta/NotificationsApiServiceGrpc.java | 1019 ++++++++ .../owlbot.py | 36 + java-shopping-merchant-notifications/pom.xml | 55 + .../clirr-ignored-differences.xml | 19 + .../pom.xml | 37 + .../notifications/v1beta/AccountName.java | 168 ++ .../notifications/v1beta/Attribute.java | 158 ++ ...CreateNotificationSubscriptionRequest.java | 1030 ++++++++ ...ificationSubscriptionRequestOrBuilder.java | 100 + ...DeleteNotificationSubscriptionRequest.java | 696 +++++ ...ificationSubscriptionRequestOrBuilder.java | 55 + .../GetNotificationSubscriptionRequest.java | 678 +++++ ...ificationSubscriptionRequestOrBuilder.java | 55 + .../ListNotificationSubscriptionsRequest.java | 992 +++++++ ...ficationSubscriptionsRequestOrBuilder.java | 99 + ...ListNotificationSubscriptionsResponse.java | 1278 +++++++++ ...icationSubscriptionsResponseOrBuilder.java | 120 + .../v1beta/NotificationSubscription.java | 1660 ++++++++++++ .../v1beta/NotificationSubscriptionName.java | 202 ++ .../NotificationSubscriptionOrBuilder.java | 186 ++ .../v1beta/NotificationsApiProto.java | 306 +++ .../notifications/v1beta/ProductChange.java | 1315 ++++++++++ .../v1beta/ProductChangeOrBuilder.java | 180 ++ .../v1beta/ProductStatusChangeMessage.java | 2305 +++++++++++++++++ .../ProductStatusChangeMessageOrBuilder.java | 319 +++ .../notifications/v1beta/Resource.java | 158 ++ ...UpdateNotificationSubscriptionRequest.java | 1102 ++++++++ ...ificationSubscriptionRequestOrBuilder.java | 107 + .../v1beta/notificationsapi.proto | 289 +++ .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../AsyncCreateNotificationSubscription.java | 54 + .../SyncCreateNotificationSubscription.java | 49 + ...onAccountnameNotificationsubscription.java | 48 + ...riptionStringNotificationsubscription.java | 48 + .../AsyncDeleteNotificationSubscription.java | 55 + .../SyncDeleteNotificationSubscription.java | 49 + ...scriptionNotificationsubscriptionname.java | 45 + ...cDeleteNotificationSubscriptionString.java | 44 + .../AsyncGetNotificationSubscription.java | 53 + .../SyncGetNotificationSubscription.java | 50 + ...scriptionNotificationsubscriptionname.java | 46 + ...SyncGetNotificationSubscriptionString.java | 45 + .../AsyncListNotificationSubscriptions.java | 57 + ...yncListNotificationSubscriptionsPaged.java | 63 + .../SyncListNotificationSubscriptions.java | 52 + ...tNotificationSubscriptionsAccountname.java | 46 + ...ncListNotificationSubscriptionsString.java | 46 + .../AsyncUpdateNotificationSubscription.java | 54 + .../SyncUpdateNotificationSubscription.java | 49 + ...tionNotificationsubscriptionFieldmask.java | 48 + .../SyncGetNotificationSubscription.java | 50 + .../SyncGetNotificationSubscription.java | 50 + pom.xml | 1 + versions.txt | 3 + 78 files changed, 22348 insertions(+) create mode 100644 java-shopping-merchant-notifications/.OwlBot-hermetic.yaml create mode 100644 java-shopping-merchant-notifications/.repo-metadata.json create mode 100644 java-shopping-merchant-notifications/README.md create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications-bom/pom.xml create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/pom.xml create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceClient.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceSettings.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/gapic_metadata.json create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/package-info.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/GrpcNotificationsApiServiceCallableFactory.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/GrpcNotificationsApiServiceStub.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/HttpJsonNotificationsApiServiceCallableFactory.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/HttpJsonNotificationsApiServiceStub.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/NotificationsApiServiceStub.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/NotificationsApiServiceStubSettings.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/resources/META-INF/native-image/com.google.shopping.merchant.notifications.v1beta/reflect-config.json create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/MockNotificationsApiService.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/MockNotificationsApiServiceImpl.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceClientHttpJsonTest.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceClientTest.java create mode 100644 java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1beta/pom.xml create mode 100644 java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceGrpc.java create mode 100644 java-shopping-merchant-notifications/owlbot.py create mode 100644 java-shopping-merchant-notifications/pom.xml create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/clirr-ignored-differences.xml create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/pom.xml create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/AccountName.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/Attribute.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/CreateNotificationSubscriptionRequest.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/CreateNotificationSubscriptionRequestOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/DeleteNotificationSubscriptionRequest.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/DeleteNotificationSubscriptionRequestOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/GetNotificationSubscriptionRequest.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/GetNotificationSubscriptionRequestOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsRequest.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsRequestOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsResponse.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsResponseOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationSubscriptionName.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationSubscriptionOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiProto.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductChange.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductChangeOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductStatusChangeMessage.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductStatusChangeMessageOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/Resource.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/UpdateNotificationSubscriptionRequest.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/UpdateNotificationSubscriptionRequestOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/proto/google/shopping/merchant/notifications/v1beta/notificationsapi.proto create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/create/SyncCreateSetEndpoint.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/AsyncCreateNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionAccountnameNotificationsubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionStringNotificationsubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/AsyncDeleteNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionNotificationsubscriptionname.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionString.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/AsyncGetNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionNotificationsubscriptionname.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionString.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptions.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptionsPaged.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptions.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsAccountname.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsString.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/updatenotificationsubscription/AsyncUpdateNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscriptionNotificationsubscriptionFieldmask.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservicesettings/getnotificationsubscription/SyncGetNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/stub/notificationsapiservicestubsettings/getnotificationsubscription/SyncGetNotificationSubscription.java diff --git a/generation_config.yaml b/generation_config.yaml index 147dc1663259..f1f8ae2412b3 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1746,6 +1746,21 @@ libraries: GAPICs: - proto_path: google/shopping/merchant/inventories/v1beta +- api_shortname: shopping-merchant-notifications + name_pretty: Merchant Notifications API + product_documentation: https://developers.google.com/merchant/api + api_description: Programmatically manage your Merchant Center accounts. + client_documentation: + https://cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/overview + release_level: preview + distribution_name: com.google.shopping:google-shopping-merchant-notifications + api_id: shopping-merchant-notifications.googleapis.com + library_type: GAPIC_AUTO + group_id: com.google.shopping + cloud_api: false + GAPICs: + - proto_path: google/shopping/merchant/notifications/v1beta + requires_billing: true - api_shortname: shopping-merchant-quota name_pretty: Merchant Quota API product_documentation: https://developers.google.com/merchant/api diff --git a/java-shopping-merchant-notifications/.OwlBot-hermetic.yaml b/java-shopping-merchant-notifications/.OwlBot-hermetic.yaml new file mode 100644 index 000000000000..12a56a2d6063 --- /dev/null +++ b/java-shopping-merchant-notifications/.OwlBot-hermetic.yaml @@ -0,0 +1,35 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +deep-remove-regex: +- "/java-shopping-merchant-notifications/grpc-google-.*/src" +- "/java-shopping-merchant-notifications/proto-google-.*/src" +- "/java-shopping-merchant-notifications/google-.*/src" +- "/java-shopping-merchant-notifications/samples/snippets/generated" + +deep-preserve-regex: +- "/java-shopping-merchant-notifications/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/shopping/merchant/notifications/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-shopping-merchant-notifications/$1/proto-google-shopping-merchant-notifications-$1/src" +- source: "/google/shopping/merchant/notifications/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-shopping-merchant-notifications/$1/grpc-google-shopping-merchant-notifications-$1/src" +- source: "/google/shopping/merchant/notifications/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-shopping-merchant-notifications/$1/google-shopping-merchant-notifications/src" +- source: "/google/shopping/merchant/notifications/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-shopping-merchant-notifications/$1/samples/snippets/generated" + +api-name: shopping-merchant-notifications \ No newline at end of file diff --git a/java-shopping-merchant-notifications/.repo-metadata.json b/java-shopping-merchant-notifications/.repo-metadata.json new file mode 100644 index 000000000000..4651759f3c04 --- /dev/null +++ b/java-shopping-merchant-notifications/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "shopping-merchant-notifications", + "name_pretty": "Merchant Notifications API", + "product_documentation": "https://developers.google.com/merchant/api", + "api_description": "Programmatically manage your Merchant Center accounts.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-shopping-merchant-notifications", + "distribution_name": "com.google.shopping:google-shopping-merchant-notifications", + "api_id": "shopping-merchant-notifications.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-shopping-merchant-notifications/README.md b/java-shopping-merchant-notifications/README.md new file mode 100644 index 000000000000..dc9458fb3ac7 --- /dev/null +++ b/java-shopping-merchant-notifications/README.md @@ -0,0 +1,225 @@ +# Google Merchant Notifications API Client for Java + +Java idiomatic client for [Merchant Notifications 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 with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.37.0 + pom + import + + + + + + + com.google.shopping + google-shopping-merchant-notifications + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.shopping + google-shopping-merchant-notifications + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.shopping:google-shopping-merchant-notifications:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.shopping" % "google-shopping-merchant-notifications" % "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 Merchant Notifications API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Merchant Notifications API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Merchant Notifications API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Merchant Notifications 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 Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-shopping-merchant-notifications` library. See the [Quickstart](#quickstart) section +to add `google-shopping-merchant-notifications` as a dependency in your code. + +## About Merchant Notifications API + + +[Merchant Notifications API][product-docs] Programmatically manage your Merchant Center accounts. + +See the [Merchant Notifications API client library docs][javadocs] to learn how to +use this Merchant Notifications API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Merchant Notifications API uses both gRPC and HTTP/JSON 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://developers.google.com/merchant/api +[javadocs]: https://cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.shopping/google-shopping-merchant-notifications.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.shopping/google-shopping-merchant-notifications/0.0.0 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=shopping-merchant-notifications.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-shopping-merchant-notifications/google-shopping-merchant-notifications-bom/pom.xml b/java-shopping-merchant-notifications/google-shopping-merchant-notifications-bom/pom.xml new file mode 100644 index 000000000000..b7242da1e069 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications-bom/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + com.google.shopping + google-shopping-merchant-notifications-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-pom-parent + 1.36.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Merchant Notifications API BOM + + BOM for Merchant Notifications API + + + + true + + + + + + com.google.shopping + google-shopping-merchant-notifications + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-notifications-v1beta + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + proto-google-shopping-merchant-notifications-v1beta + 0.0.1-SNAPSHOT + + + + diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/pom.xml b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/pom.xml new file mode 100644 index 000000000000..874494d73ef9 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.shopping + google-shopping-merchant-notifications + 0.0.1-SNAPSHOT + jar + Google Merchant Notifications API + Merchant Notifications API Programmatically manage your Merchant Center accounts. + + com.google.shopping + google-shopping-merchant-notifications-parent + 0.0.1-SNAPSHOT + + + google-shopping-merchant-notifications + + + + 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.shopping.api.grpc + proto-google-shopping-merchant-notifications-v1beta + + + 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.shopping.api.grpc + grpc-google-shopping-merchant-notifications-v1beta + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceClient.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceClient.java new file mode 100644 index 000000000000..93cd14a7f4a6 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceClient.java @@ -0,0 +1,1110 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.notifications.v1beta.stub.NotificationsApiServiceStub; +import com.google.shopping.merchant.notifications.v1beta.stub.NotificationsApiServiceStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service to manage notification subscriptions for merchants + * + *

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 (NotificationsApiServiceClient notificationsApiServiceClient =
+ *     NotificationsApiServiceClient.create()) {
+ *   NotificationSubscriptionName name =
+ *       NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]");
+ *   NotificationSubscription response =
+ *       notificationsApiServiceClient.getNotificationSubscription(name);
+ * }
+ * }
+ * + *

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

GetNotificationSubscription

Gets notification subscriptions for an account.

+ *

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

+ *
    + *
  • getNotificationSubscription(GetNotificationSubscriptionRequest request) + *

+ *

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

+ *
    + *
  • getNotificationSubscription(NotificationSubscriptionName name) + *

  • getNotificationSubscription(String name) + *

+ *

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

+ *
    + *
  • getNotificationSubscriptionCallable() + *

+ *

CreateNotificationSubscription

Creates a notification subscription for a merchant. We will allow the following types of notification subscriptions to exist together (per merchant as a subscriber per event type): 1. Subscription for all managed accounts + subscription for self 2. Multiple "partial" subscriptions for managed accounts + subscription for self + *

we will not allow (per merchant as a subscriber per event type): 1. multiple self subscriptions. 2. multiple "all managed accounts" subscriptions. 3. all and partial subscriptions at the same time. 4. multiple partial subscriptions for the same target account

+ *

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

+ *
    + *
  • createNotificationSubscription(CreateNotificationSubscriptionRequest request) + *

+ *

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

+ *
    + *
  • createNotificationSubscription(AccountName parent, NotificationSubscription notificationSubscription) + *

  • createNotificationSubscription(String parent, NotificationSubscription notificationSubscription) + *

+ *

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

+ *
    + *
  • createNotificationSubscriptionCallable() + *

+ *

UpdateNotificationSubscription

Updates an existing notification subscription for a merchant.

+ *

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

+ *
    + *
  • updateNotificationSubscription(UpdateNotificationSubscriptionRequest request) + *

+ *

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

+ *
    + *
  • updateNotificationSubscription(NotificationSubscription notificationSubscription, FieldMask updateMask) + *

+ *

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

+ *
    + *
  • updateNotificationSubscriptionCallable() + *

+ *

DeleteNotificationSubscription

Deletes a notification subscription for a merchant.

+ *

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

+ *
    + *
  • deleteNotificationSubscription(DeleteNotificationSubscriptionRequest request) + *

+ *

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

+ *
    + *
  • deleteNotificationSubscription(NotificationSubscriptionName name) + *

  • deleteNotificationSubscription(String name) + *

+ *

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

+ *
    + *
  • deleteNotificationSubscriptionCallable() + *

+ *

ListNotificationSubscriptions

Gets all the notification subscriptions for a merchant.

+ *

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

+ *
    + *
  • listNotificationSubscriptions(ListNotificationSubscriptionsRequest request) + *

+ *

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

+ *
    + *
  • listNotificationSubscriptions(AccountName parent) + *

  • listNotificationSubscriptions(String parent) + *

+ *

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

+ *
    + *
  • listNotificationSubscriptionsPagedCallable() + *

  • listNotificationSubscriptionsCallable() + *

+ *
+ * + *

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 + * NotificationsApiServiceSettings 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
+ * NotificationsApiServiceSettings notificationsApiServiceSettings =
+ *     NotificationsApiServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * NotificationsApiServiceClient notificationsApiServiceClient =
+ *     NotificationsApiServiceClient.create(notificationsApiServiceSettings);
+ * }
+ * + *

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
+ * NotificationsApiServiceSettings notificationsApiServiceSettings =
+ *     NotificationsApiServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * NotificationsApiServiceClient notificationsApiServiceClient =
+ *     NotificationsApiServiceClient.create(notificationsApiServiceSettings);
+ * }
+ * + *

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
+ * NotificationsApiServiceSettings notificationsApiServiceSettings =
+ *     NotificationsApiServiceSettings.newHttpJsonBuilder().build();
+ * NotificationsApiServiceClient notificationsApiServiceClient =
+ *     NotificationsApiServiceClient.create(notificationsApiServiceSettings);
+ * }
+ * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   NotificationSubscriptionName name =
+   *       NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]");
+   *   NotificationSubscription response =
+   *       notificationsApiServiceClient.getNotificationSubscription(name);
+   * }
+   * }
+ * + * @param name Required. The `name` of the notification subscription. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NotificationSubscription getNotificationSubscription( + NotificationSubscriptionName name) { + GetNotificationSubscriptionRequest request = + GetNotificationSubscriptionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getNotificationSubscription(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets notification subscriptions for an account. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   String name =
+   *       NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]").toString();
+   *   NotificationSubscription response =
+   *       notificationsApiServiceClient.getNotificationSubscription(name);
+   * }
+   * }
+ * + * @param name Required. The `name` of the notification subscription. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NotificationSubscription getNotificationSubscription(String name) { + GetNotificationSubscriptionRequest request = + GetNotificationSubscriptionRequest.newBuilder().setName(name).build(); + return getNotificationSubscription(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets notification subscriptions for an account. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   GetNotificationSubscriptionRequest request =
+   *       GetNotificationSubscriptionRequest.newBuilder()
+   *           .setName(
+   *               NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]")
+   *                   .toString())
+   *           .build();
+   *   NotificationSubscription response =
+   *       notificationsApiServiceClient.getNotificationSubscription(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NotificationSubscription getNotificationSubscription( + GetNotificationSubscriptionRequest request) { + return getNotificationSubscriptionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets notification subscriptions for an account. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   GetNotificationSubscriptionRequest request =
+   *       GetNotificationSubscriptionRequest.newBuilder()
+   *           .setName(
+   *               NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       notificationsApiServiceClient.getNotificationSubscriptionCallable().futureCall(request);
+   *   // Do something.
+   *   NotificationSubscription response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getNotificationSubscriptionCallable() { + return stub.getNotificationSubscriptionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a notification subscription for a merchant. We will allow the following types of + * notification subscriptions to exist together (per merchant as a subscriber per event type): 1. + * Subscription for all managed accounts + subscription for self 2. Multiple "partial" + * subscriptions for managed accounts + subscription for self + * + *

we will not allow (per merchant as a subscriber per event type): 1. multiple self + * subscriptions. 2. multiple "all managed accounts" subscriptions. 3. all and partial + * subscriptions at the same time. 4. multiple partial subscriptions for the same target account + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   AccountName parent = AccountName.of("[ACCOUNT]");
+   *   NotificationSubscription notificationSubscription =
+   *       NotificationSubscription.newBuilder().build();
+   *   NotificationSubscription response =
+   *       notificationsApiServiceClient.createNotificationSubscription(
+   *           parent, notificationSubscription);
+   * }
+   * }
+ * + * @param parent Required. The merchant account that owns the new notification subscription. + * Format: `accounts/{account}` + * @param notificationSubscription Required. The notification subscription to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NotificationSubscription createNotificationSubscription( + AccountName parent, NotificationSubscription notificationSubscription) { + CreateNotificationSubscriptionRequest request = + CreateNotificationSubscriptionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setNotificationSubscription(notificationSubscription) + .build(); + return createNotificationSubscription(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a notification subscription for a merchant. We will allow the following types of + * notification subscriptions to exist together (per merchant as a subscriber per event type): 1. + * Subscription for all managed accounts + subscription for self 2. Multiple "partial" + * subscriptions for managed accounts + subscription for self + * + *

we will not allow (per merchant as a subscriber per event type): 1. multiple self + * subscriptions. 2. multiple "all managed accounts" subscriptions. 3. all and partial + * subscriptions at the same time. 4. multiple partial subscriptions for the same target account + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   String parent = AccountName.of("[ACCOUNT]").toString();
+   *   NotificationSubscription notificationSubscription =
+   *       NotificationSubscription.newBuilder().build();
+   *   NotificationSubscription response =
+   *       notificationsApiServiceClient.createNotificationSubscription(
+   *           parent, notificationSubscription);
+   * }
+   * }
+ * + * @param parent Required. The merchant account that owns the new notification subscription. + * Format: `accounts/{account}` + * @param notificationSubscription Required. The notification subscription to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NotificationSubscription createNotificationSubscription( + String parent, NotificationSubscription notificationSubscription) { + CreateNotificationSubscriptionRequest request = + CreateNotificationSubscriptionRequest.newBuilder() + .setParent(parent) + .setNotificationSubscription(notificationSubscription) + .build(); + return createNotificationSubscription(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a notification subscription for a merchant. We will allow the following types of + * notification subscriptions to exist together (per merchant as a subscriber per event type): 1. + * Subscription for all managed accounts + subscription for self 2. Multiple "partial" + * subscriptions for managed accounts + subscription for self + * + *

we will not allow (per merchant as a subscriber per event type): 1. multiple self + * subscriptions. 2. multiple "all managed accounts" subscriptions. 3. all and partial + * subscriptions at the same time. 4. multiple partial subscriptions for the same target account + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   CreateNotificationSubscriptionRequest request =
+   *       CreateNotificationSubscriptionRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setNotificationSubscription(NotificationSubscription.newBuilder().build())
+   *           .build();
+   *   NotificationSubscription response =
+   *       notificationsApiServiceClient.createNotificationSubscription(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NotificationSubscription createNotificationSubscription( + CreateNotificationSubscriptionRequest request) { + return createNotificationSubscriptionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a notification subscription for a merchant. We will allow the following types of + * notification subscriptions to exist together (per merchant as a subscriber per event type): 1. + * Subscription for all managed accounts + subscription for self 2. Multiple "partial" + * subscriptions for managed accounts + subscription for self + * + *

we will not allow (per merchant as a subscriber per event type): 1. multiple self + * subscriptions. 2. multiple "all managed accounts" subscriptions. 3. all and partial + * subscriptions at the same time. 4. multiple partial subscriptions for the same target account + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   CreateNotificationSubscriptionRequest request =
+   *       CreateNotificationSubscriptionRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setNotificationSubscription(NotificationSubscription.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       notificationsApiServiceClient
+   *           .createNotificationSubscriptionCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   NotificationSubscription response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createNotificationSubscriptionCallable() { + return stub.createNotificationSubscriptionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing notification subscription for a merchant. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   NotificationSubscription notificationSubscription =
+   *       NotificationSubscription.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   NotificationSubscription response =
+   *       notificationsApiServiceClient.updateNotificationSubscription(
+   *           notificationSubscription, updateMask);
+   * }
+   * }
+ * + * @param notificationSubscription Required. The new version of the notification subscription that + * should be updated. + * @param updateMask List of fields being updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NotificationSubscription updateNotificationSubscription( + NotificationSubscription notificationSubscription, FieldMask updateMask) { + UpdateNotificationSubscriptionRequest request = + UpdateNotificationSubscriptionRequest.newBuilder() + .setNotificationSubscription(notificationSubscription) + .setUpdateMask(updateMask) + .build(); + return updateNotificationSubscription(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing notification subscription for a merchant. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   NotificationSubscriptionName name =
+   *       NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]");
+   *   notificationsApiServiceClient.deleteNotificationSubscription(name);
+   * }
+   * }
+ * + * @param name Required. The name of the notification subscription to be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteNotificationSubscription(NotificationSubscriptionName name) { + DeleteNotificationSubscriptionRequest request = + DeleteNotificationSubscriptionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteNotificationSubscription(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a notification subscription for a merchant. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   String name =
+   *       NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]").toString();
+   *   notificationsApiServiceClient.deleteNotificationSubscription(name);
+   * }
+   * }
+ * + * @param name Required. The name of the notification subscription to be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteNotificationSubscription(String name) { + DeleteNotificationSubscriptionRequest request = + DeleteNotificationSubscriptionRequest.newBuilder().setName(name).build(); + deleteNotificationSubscription(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a notification subscription for a merchant. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   DeleteNotificationSubscriptionRequest request =
+   *       DeleteNotificationSubscriptionRequest.newBuilder()
+   *           .setName(
+   *               NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]")
+   *                   .toString())
+   *           .build();
+   *   notificationsApiServiceClient.deleteNotificationSubscription(request);
+   * }
+   * }
+ * + * @param request The request 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 deleteNotificationSubscription(DeleteNotificationSubscriptionRequest request) { + deleteNotificationSubscriptionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a notification subscription for a merchant. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   DeleteNotificationSubscriptionRequest request =
+   *       DeleteNotificationSubscriptionRequest.newBuilder()
+   *           .setName(
+   *               NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       notificationsApiServiceClient
+   *           .deleteNotificationSubscriptionCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteNotificationSubscriptionCallable() { + return stub.deleteNotificationSubscriptionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets all the notification subscriptions for a merchant. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   AccountName parent = AccountName.of("[ACCOUNT]");
+   *   for (NotificationSubscription element :
+   *       notificationsApiServiceClient.listNotificationSubscriptions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The merchant account who owns the notification subscriptions. Format: + * `accounts/{account}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNotificationSubscriptionsPagedResponse listNotificationSubscriptions( + AccountName parent) { + ListNotificationSubscriptionsRequest request = + ListNotificationSubscriptionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listNotificationSubscriptions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets all the notification subscriptions for a merchant. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   String parent = AccountName.of("[ACCOUNT]").toString();
+   *   for (NotificationSubscription element :
+   *       notificationsApiServiceClient.listNotificationSubscriptions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The merchant account who owns the notification subscriptions. Format: + * `accounts/{account}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNotificationSubscriptionsPagedResponse listNotificationSubscriptions( + String parent) { + ListNotificationSubscriptionsRequest request = + ListNotificationSubscriptionsRequest.newBuilder().setParent(parent).build(); + return listNotificationSubscriptions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets all the notification subscriptions for a merchant. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   ListNotificationSubscriptionsRequest request =
+   *       ListNotificationSubscriptionsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (NotificationSubscription element :
+   *       notificationsApiServiceClient.listNotificationSubscriptions(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 ListNotificationSubscriptionsPagedResponse listNotificationSubscriptions( + ListNotificationSubscriptionsRequest request) { + return listNotificationSubscriptionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets all the notification subscriptions for a merchant. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   ListNotificationSubscriptionsRequest request =
+   *       ListNotificationSubscriptionsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       notificationsApiServiceClient
+   *           .listNotificationSubscriptionsPagedCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   for (NotificationSubscription element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListNotificationSubscriptionsRequest, ListNotificationSubscriptionsPagedResponse> + listNotificationSubscriptionsPagedCallable() { + return stub.listNotificationSubscriptionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets all the notification subscriptions for a merchant. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   ListNotificationSubscriptionsRequest request =
+   *       ListNotificationSubscriptionsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListNotificationSubscriptionsResponse response =
+   *         notificationsApiServiceClient.listNotificationSubscriptionsCallable().call(request);
+   *     for (NotificationSubscription element : response.getNotificationSubscriptionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListNotificationSubscriptionsRequest, ListNotificationSubscriptionsResponse> + listNotificationSubscriptionsCallable() { + return stub.listNotificationSubscriptionsCallable(); + } + + @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 ListNotificationSubscriptionsPagedResponse + extends AbstractPagedListResponse< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + NotificationSubscription, + ListNotificationSubscriptionsPage, + ListNotificationSubscriptionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + NotificationSubscription> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListNotificationSubscriptionsPage.createEmptyPage() + .createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListNotificationSubscriptionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListNotificationSubscriptionsPagedResponse(ListNotificationSubscriptionsPage page) { + super(page, ListNotificationSubscriptionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListNotificationSubscriptionsPage + extends AbstractPage< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + NotificationSubscription, + ListNotificationSubscriptionsPage> { + + private ListNotificationSubscriptionsPage( + PageContext< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + NotificationSubscription> + context, + ListNotificationSubscriptionsResponse response) { + super(context, response); + } + + private static ListNotificationSubscriptionsPage createEmptyPage() { + return new ListNotificationSubscriptionsPage(null, null); + } + + @Override + protected ListNotificationSubscriptionsPage createPage( + PageContext< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + NotificationSubscription> + context, + ListNotificationSubscriptionsResponse response) { + return new ListNotificationSubscriptionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + NotificationSubscription> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListNotificationSubscriptionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + NotificationSubscription, + ListNotificationSubscriptionsPage, + ListNotificationSubscriptionsFixedSizeCollection> { + + private ListNotificationSubscriptionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListNotificationSubscriptionsFixedSizeCollection createEmptyCollection() { + return new ListNotificationSubscriptionsFixedSizeCollection(null, 0); + } + + @Override + protected ListNotificationSubscriptionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListNotificationSubscriptionsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceSettings.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceSettings.java new file mode 100644 index 000000000000..3bccb63d8e8d --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceSettings.java @@ -0,0 +1,273 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta; + +import static com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse; + +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.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1beta.stub.NotificationsApiServiceStubSettings; +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 NotificationsApiServiceClient}. + * + *

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

    + *
  • The default service address (merchantapi.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 getNotificationSubscription 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
+ * NotificationsApiServiceSettings.Builder notificationsApiServiceSettingsBuilder =
+ *     NotificationsApiServiceSettings.newBuilder();
+ * notificationsApiServiceSettingsBuilder
+ *     .getNotificationSubscriptionSettings()
+ *     .setRetrySettings(
+ *         notificationsApiServiceSettingsBuilder
+ *             .getNotificationSubscriptionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * NotificationsApiServiceSettings notificationsApiServiceSettings =
+ *     notificationsApiServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class NotificationsApiServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to getNotificationSubscription. */ + public UnaryCallSettings + getNotificationSubscriptionSettings() { + return ((NotificationsApiServiceStubSettings) getStubSettings()) + .getNotificationSubscriptionSettings(); + } + + /** Returns the object with the settings used for calls to createNotificationSubscription. */ + public UnaryCallSettings + createNotificationSubscriptionSettings() { + return ((NotificationsApiServiceStubSettings) getStubSettings()) + .createNotificationSubscriptionSettings(); + } + + /** Returns the object with the settings used for calls to updateNotificationSubscription. */ + public UnaryCallSettings + updateNotificationSubscriptionSettings() { + return ((NotificationsApiServiceStubSettings) getStubSettings()) + .updateNotificationSubscriptionSettings(); + } + + /** Returns the object with the settings used for calls to deleteNotificationSubscription. */ + public UnaryCallSettings + deleteNotificationSubscriptionSettings() { + return ((NotificationsApiServiceStubSettings) getStubSettings()) + .deleteNotificationSubscriptionSettings(); + } + + /** Returns the object with the settings used for calls to listNotificationSubscriptions. */ + public PagedCallSettings< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + ListNotificationSubscriptionsPagedResponse> + listNotificationSubscriptionsSettings() { + return ((NotificationsApiServiceStubSettings) getStubSettings()) + .listNotificationSubscriptionsSettings(); + } + + public static final NotificationsApiServiceSettings create( + NotificationsApiServiceStubSettings stub) throws IOException { + return new NotificationsApiServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return NotificationsApiServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return NotificationsApiServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return NotificationsApiServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return NotificationsApiServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return NotificationsApiServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return NotificationsApiServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return NotificationsApiServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return NotificationsApiServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected NotificationsApiServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for NotificationsApiServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(NotificationsApiServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(NotificationsApiServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(NotificationsApiServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(NotificationsApiServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(NotificationsApiServiceStubSettings.newHttpJsonBuilder()); + } + + public NotificationsApiServiceStubSettings.Builder getStubSettingsBuilder() { + return ((NotificationsApiServiceStubSettings.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 getNotificationSubscription. */ + public UnaryCallSettings.Builder + getNotificationSubscriptionSettings() { + return getStubSettingsBuilder().getNotificationSubscriptionSettings(); + } + + /** Returns the builder for the settings used for calls to createNotificationSubscription. */ + public UnaryCallSettings.Builder< + CreateNotificationSubscriptionRequest, NotificationSubscription> + createNotificationSubscriptionSettings() { + return getStubSettingsBuilder().createNotificationSubscriptionSettings(); + } + + /** Returns the builder for the settings used for calls to updateNotificationSubscription. */ + public UnaryCallSettings.Builder< + UpdateNotificationSubscriptionRequest, NotificationSubscription> + updateNotificationSubscriptionSettings() { + return getStubSettingsBuilder().updateNotificationSubscriptionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteNotificationSubscription. */ + public UnaryCallSettings.Builder + deleteNotificationSubscriptionSettings() { + return getStubSettingsBuilder().deleteNotificationSubscriptionSettings(); + } + + /** Returns the builder for the settings used for calls to listNotificationSubscriptions. */ + public PagedCallSettings.Builder< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + ListNotificationSubscriptionsPagedResponse> + listNotificationSubscriptionsSettings() { + return getStubSettingsBuilder().listNotificationSubscriptionsSettings(); + } + + @Override + public NotificationsApiServiceSettings build() throws IOException { + return new NotificationsApiServiceSettings(this); + } + } +} diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/gapic_metadata.json b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/gapic_metadata.json new file mode 100644 index 000000000000..cd62797bde02 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.shopping.merchant.notifications.v1beta", + "libraryPackage": "com.google.shopping.merchant.notifications.v1beta", + "services": { + "NotificationsApiService": { + "clients": { + "grpc": { + "libraryClient": "NotificationsApiServiceClient", + "rpcs": { + "CreateNotificationSubscription": { + "methods": ["createNotificationSubscription", "createNotificationSubscription", "createNotificationSubscription", "createNotificationSubscriptionCallable"] + }, + "DeleteNotificationSubscription": { + "methods": ["deleteNotificationSubscription", "deleteNotificationSubscription", "deleteNotificationSubscription", "deleteNotificationSubscriptionCallable"] + }, + "GetNotificationSubscription": { + "methods": ["getNotificationSubscription", "getNotificationSubscription", "getNotificationSubscription", "getNotificationSubscriptionCallable"] + }, + "ListNotificationSubscriptions": { + "methods": ["listNotificationSubscriptions", "listNotificationSubscriptions", "listNotificationSubscriptions", "listNotificationSubscriptionsPagedCallable", "listNotificationSubscriptionsCallable"] + }, + "UpdateNotificationSubscription": { + "methods": ["updateNotificationSubscription", "updateNotificationSubscription", "updateNotificationSubscriptionCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/package-info.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/package-info.java new file mode 100644 index 000000000000..5760ad53eeec --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/package-info.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Merchant API + * + *

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

======================= NotificationsApiServiceClient ======================= + * + *

Service Description: Service to manage notification subscriptions for merchants + * + *

Sample for NotificationsApiServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotificationsApiServiceClient notificationsApiServiceClient =
+ *     NotificationsApiServiceClient.create()) {
+ *   NotificationSubscriptionName name =
+ *       NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]");
+ *   NotificationSubscription response =
+ *       notificationsApiServiceClient.getNotificationSubscription(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.shopping.merchant.notifications.v1beta; + +import javax.annotation.Generated; diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/GrpcNotificationsApiServiceCallableFactory.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/GrpcNotificationsApiServiceCallableFactory.java new file mode 100644 index 000000000000..4a498f6d8793 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/GrpcNotificationsApiServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the NotificationsApiService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcNotificationsApiServiceCallableFactory 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-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/GrpcNotificationsApiServiceStub.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/GrpcNotificationsApiServiceStub.java new file mode 100644 index 000000000000..bf0e76f4bf1d --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/GrpcNotificationsApiServiceStub.java @@ -0,0 +1,355 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.stub; + +import static com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest; +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 NotificationsApiService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcNotificationsApiServiceStub extends NotificationsApiServiceStub { + private static final MethodDescriptor< + GetNotificationSubscriptionRequest, NotificationSubscription> + getNotificationSubscriptionMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.notifications.v1beta.NotificationsApiService/GetNotificationSubscription") + .setRequestMarshaller( + ProtoUtils.marshaller(GetNotificationSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(NotificationSubscription.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + CreateNotificationSubscriptionRequest, NotificationSubscription> + createNotificationSubscriptionMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.notifications.v1beta.NotificationsApiService/CreateNotificationSubscription") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateNotificationSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(NotificationSubscription.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + UpdateNotificationSubscriptionRequest, NotificationSubscription> + updateNotificationSubscriptionMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.notifications.v1beta.NotificationsApiService/UpdateNotificationSubscription") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateNotificationSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(NotificationSubscription.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteNotificationSubscriptionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.notifications.v1beta.NotificationsApiService/DeleteNotificationSubscription") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteNotificationSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListNotificationSubscriptionsRequest, ListNotificationSubscriptionsResponse> + listNotificationSubscriptionsMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.notifications.v1beta.NotificationsApiService/ListNotificationSubscriptions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListNotificationSubscriptionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListNotificationSubscriptionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable + getNotificationSubscriptionCallable; + private final UnaryCallable + createNotificationSubscriptionCallable; + private final UnaryCallable + updateNotificationSubscriptionCallable; + private final UnaryCallable + deleteNotificationSubscriptionCallable; + private final UnaryCallable< + ListNotificationSubscriptionsRequest, ListNotificationSubscriptionsResponse> + listNotificationSubscriptionsCallable; + private final UnaryCallable< + ListNotificationSubscriptionsRequest, ListNotificationSubscriptionsPagedResponse> + listNotificationSubscriptionsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcNotificationsApiServiceStub create( + NotificationsApiServiceStubSettings settings) throws IOException { + return new GrpcNotificationsApiServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcNotificationsApiServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcNotificationsApiServiceStub( + NotificationsApiServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcNotificationsApiServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcNotificationsApiServiceStub( + NotificationsApiServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcNotificationsApiServiceStub, 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 GrpcNotificationsApiServiceStub( + NotificationsApiServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcNotificationsApiServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcNotificationsApiServiceStub, 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 GrpcNotificationsApiServiceStub( + NotificationsApiServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + getNotificationSubscriptionTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(getNotificationSubscriptionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + createNotificationSubscriptionTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(createNotificationSubscriptionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + updateNotificationSubscriptionTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(updateNotificationSubscriptionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "notification_subscription.name", + String.valueOf(request.getNotificationSubscription().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + deleteNotificationSubscriptionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteNotificationSubscriptionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listNotificationSubscriptionsTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(listNotificationSubscriptionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.getNotificationSubscriptionCallable = + callableFactory.createUnaryCallable( + getNotificationSubscriptionTransportSettings, + settings.getNotificationSubscriptionSettings(), + clientContext); + this.createNotificationSubscriptionCallable = + callableFactory.createUnaryCallable( + createNotificationSubscriptionTransportSettings, + settings.createNotificationSubscriptionSettings(), + clientContext); + this.updateNotificationSubscriptionCallable = + callableFactory.createUnaryCallable( + updateNotificationSubscriptionTransportSettings, + settings.updateNotificationSubscriptionSettings(), + clientContext); + this.deleteNotificationSubscriptionCallable = + callableFactory.createUnaryCallable( + deleteNotificationSubscriptionTransportSettings, + settings.deleteNotificationSubscriptionSettings(), + clientContext); + this.listNotificationSubscriptionsCallable = + callableFactory.createUnaryCallable( + listNotificationSubscriptionsTransportSettings, + settings.listNotificationSubscriptionsSettings(), + clientContext); + this.listNotificationSubscriptionsPagedCallable = + callableFactory.createPagedCallable( + listNotificationSubscriptionsTransportSettings, + settings.listNotificationSubscriptionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + getNotificationSubscriptionCallable() { + return getNotificationSubscriptionCallable; + } + + @Override + public UnaryCallable + createNotificationSubscriptionCallable() { + return createNotificationSubscriptionCallable; + } + + @Override + public UnaryCallable + updateNotificationSubscriptionCallable() { + return updateNotificationSubscriptionCallable; + } + + @Override + public UnaryCallable + deleteNotificationSubscriptionCallable() { + return deleteNotificationSubscriptionCallable; + } + + @Override + public UnaryCallable + listNotificationSubscriptionsCallable() { + return listNotificationSubscriptionsCallable; + } + + @Override + public UnaryCallable< + ListNotificationSubscriptionsRequest, ListNotificationSubscriptionsPagedResponse> + listNotificationSubscriptionsPagedCallable() { + return listNotificationSubscriptionsPagedCallable; + } + + @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-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/HttpJsonNotificationsApiServiceCallableFactory.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/HttpJsonNotificationsApiServiceCallableFactory.java new file mode 100644 index 000000000000..0b6169183f0e --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/HttpJsonNotificationsApiServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.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 NotificationsApiService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonNotificationsApiServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/HttpJsonNotificationsApiServiceStub.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/HttpJsonNotificationsApiServiceStub.java new file mode 100644 index 000000000000..ea614a830e7f --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/HttpJsonNotificationsApiServiceStub.java @@ -0,0 +1,512 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.stub; + +import static com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest; +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 NotificationsApiService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonNotificationsApiServiceStub extends NotificationsApiServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor< + GetNotificationSubscriptionRequest, NotificationSubscription> + getNotificationSubscriptionMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.shopping.merchant.notifications.v1beta.NotificationsApiService/GetNotificationSubscription") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/notifications/v1beta/{name=accounts/*/notificationsubscriptions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(NotificationSubscription.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + CreateNotificationSubscriptionRequest, NotificationSubscription> + createNotificationSubscriptionMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.shopping.merchant.notifications.v1beta.NotificationsApiService/CreateNotificationSubscription") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/notifications/v1beta/{parent=accounts/*}/notificationsubscriptions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "notificationSubscription", + request.getNotificationSubscription(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(NotificationSubscription.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + UpdateNotificationSubscriptionRequest, NotificationSubscription> + updateNotificationSubscriptionMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.shopping.merchant.notifications.v1beta.NotificationsApiService/UpdateNotificationSubscription") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/notifications/v1beta/{notificationSubscription.name=accounts/*/notificationsubscriptions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "notificationSubscription.name", + request.getNotificationSubscription().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "notificationSubscription", + request.getNotificationSubscription(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(NotificationSubscription.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteNotificationSubscriptionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.notifications.v1beta.NotificationsApiService/DeleteNotificationSubscription") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/notifications/v1beta/{name=accounts/*/notificationsubscriptions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListNotificationSubscriptionsRequest, ListNotificationSubscriptionsResponse> + listNotificationSubscriptionsMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.shopping.merchant.notifications.v1beta.NotificationsApiService/ListNotificationSubscriptions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/notifications/v1beta/{parent=accounts/*}/notificationsubscriptions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance( + ListNotificationSubscriptionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + getNotificationSubscriptionCallable; + private final UnaryCallable + createNotificationSubscriptionCallable; + private final UnaryCallable + updateNotificationSubscriptionCallable; + private final UnaryCallable + deleteNotificationSubscriptionCallable; + private final UnaryCallable< + ListNotificationSubscriptionsRequest, ListNotificationSubscriptionsResponse> + listNotificationSubscriptionsCallable; + private final UnaryCallable< + ListNotificationSubscriptionsRequest, ListNotificationSubscriptionsPagedResponse> + listNotificationSubscriptionsPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonNotificationsApiServiceStub create( + NotificationsApiServiceStubSettings settings) throws IOException { + return new HttpJsonNotificationsApiServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonNotificationsApiServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonNotificationsApiServiceStub( + NotificationsApiServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonNotificationsApiServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonNotificationsApiServiceStub( + NotificationsApiServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonNotificationsApiServiceStub, 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 HttpJsonNotificationsApiServiceStub( + NotificationsApiServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonNotificationsApiServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonNotificationsApiServiceStub, 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 HttpJsonNotificationsApiServiceStub( + NotificationsApiServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + getNotificationSubscriptionTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getNotificationSubscriptionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + createNotificationSubscriptionTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(createNotificationSubscriptionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + updateNotificationSubscriptionTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(updateNotificationSubscriptionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "notification_subscription.name", + String.valueOf(request.getNotificationSubscription().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + deleteNotificationSubscriptionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteNotificationSubscriptionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings< + ListNotificationSubscriptionsRequest, ListNotificationSubscriptionsResponse> + listNotificationSubscriptionsTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(listNotificationSubscriptionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.getNotificationSubscriptionCallable = + callableFactory.createUnaryCallable( + getNotificationSubscriptionTransportSettings, + settings.getNotificationSubscriptionSettings(), + clientContext); + this.createNotificationSubscriptionCallable = + callableFactory.createUnaryCallable( + createNotificationSubscriptionTransportSettings, + settings.createNotificationSubscriptionSettings(), + clientContext); + this.updateNotificationSubscriptionCallable = + callableFactory.createUnaryCallable( + updateNotificationSubscriptionTransportSettings, + settings.updateNotificationSubscriptionSettings(), + clientContext); + this.deleteNotificationSubscriptionCallable = + callableFactory.createUnaryCallable( + deleteNotificationSubscriptionTransportSettings, + settings.deleteNotificationSubscriptionSettings(), + clientContext); + this.listNotificationSubscriptionsCallable = + callableFactory.createUnaryCallable( + listNotificationSubscriptionsTransportSettings, + settings.listNotificationSubscriptionsSettings(), + clientContext); + this.listNotificationSubscriptionsPagedCallable = + callableFactory.createPagedCallable( + listNotificationSubscriptionsTransportSettings, + settings.listNotificationSubscriptionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getNotificationSubscriptionMethodDescriptor); + methodDescriptors.add(createNotificationSubscriptionMethodDescriptor); + methodDescriptors.add(updateNotificationSubscriptionMethodDescriptor); + methodDescriptors.add(deleteNotificationSubscriptionMethodDescriptor); + methodDescriptors.add(listNotificationSubscriptionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + getNotificationSubscriptionCallable() { + return getNotificationSubscriptionCallable; + } + + @Override + public UnaryCallable + createNotificationSubscriptionCallable() { + return createNotificationSubscriptionCallable; + } + + @Override + public UnaryCallable + updateNotificationSubscriptionCallable() { + return updateNotificationSubscriptionCallable; + } + + @Override + public UnaryCallable + deleteNotificationSubscriptionCallable() { + return deleteNotificationSubscriptionCallable; + } + + @Override + public UnaryCallable + listNotificationSubscriptionsCallable() { + return listNotificationSubscriptionsCallable; + } + + @Override + public UnaryCallable< + ListNotificationSubscriptionsRequest, ListNotificationSubscriptionsPagedResponse> + listNotificationSubscriptionsPagedCallable() { + return listNotificationSubscriptionsPagedCallable; + } + + @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-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/NotificationsApiServiceStub.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/NotificationsApiServiceStub.java new file mode 100644 index 000000000000..01bf8d6eb0c5 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/NotificationsApiServiceStub.java @@ -0,0 +1,83 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.stub; + +import static com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the NotificationsApiService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class NotificationsApiServiceStub implements BackgroundResource { + + public UnaryCallable + getNotificationSubscriptionCallable() { + throw new UnsupportedOperationException( + "Not implemented: getNotificationSubscriptionCallable()"); + } + + public UnaryCallable + createNotificationSubscriptionCallable() { + throw new UnsupportedOperationException( + "Not implemented: createNotificationSubscriptionCallable()"); + } + + public UnaryCallable + updateNotificationSubscriptionCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateNotificationSubscriptionCallable()"); + } + + public UnaryCallable + deleteNotificationSubscriptionCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteNotificationSubscriptionCallable()"); + } + + public UnaryCallable< + ListNotificationSubscriptionsRequest, ListNotificationSubscriptionsPagedResponse> + listNotificationSubscriptionsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listNotificationSubscriptionsPagedCallable()"); + } + + public UnaryCallable + listNotificationSubscriptionsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listNotificationSubscriptionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/NotificationsApiServiceStubSettings.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/NotificationsApiServiceStubSettings.java new file mode 100644 index 000000000000..843ed13f52f2 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/stub/NotificationsApiServiceStubSettings.java @@ -0,0 +1,565 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.stub; + +import static com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest; +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 NotificationsApiServiceStub}. + * + *

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

    + *
  • The default service address (merchantapi.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 getNotificationSubscription 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
+ * NotificationsApiServiceStubSettings.Builder notificationsApiServiceSettingsBuilder =
+ *     NotificationsApiServiceStubSettings.newBuilder();
+ * notificationsApiServiceSettingsBuilder
+ *     .getNotificationSubscriptionSettings()
+ *     .setRetrySettings(
+ *         notificationsApiServiceSettingsBuilder
+ *             .getNotificationSubscriptionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * NotificationsApiServiceStubSettings notificationsApiServiceSettings =
+ *     notificationsApiServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class NotificationsApiServiceStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/content").build(); + + private final UnaryCallSettings + getNotificationSubscriptionSettings; + private final UnaryCallSettings + createNotificationSubscriptionSettings; + private final UnaryCallSettings + updateNotificationSubscriptionSettings; + private final UnaryCallSettings + deleteNotificationSubscriptionSettings; + private final PagedCallSettings< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + ListNotificationSubscriptionsPagedResponse> + listNotificationSubscriptionsSettings; + + private static final PagedListDescriptor< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + NotificationSubscription> + LIST_NOTIFICATION_SUBSCRIPTIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + NotificationSubscription>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListNotificationSubscriptionsRequest injectToken( + ListNotificationSubscriptionsRequest payload, String token) { + return ListNotificationSubscriptionsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListNotificationSubscriptionsRequest injectPageSize( + ListNotificationSubscriptionsRequest payload, int pageSize) { + return ListNotificationSubscriptionsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListNotificationSubscriptionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListNotificationSubscriptionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListNotificationSubscriptionsResponse payload) { + return payload.getNotificationSubscriptionsList() == null + ? ImmutableList.of() + : payload.getNotificationSubscriptionsList(); + } + }; + + private static final PagedListResponseFactory< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + ListNotificationSubscriptionsPagedResponse> + LIST_NOTIFICATION_SUBSCRIPTIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + ListNotificationSubscriptionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable< + ListNotificationSubscriptionsRequest, ListNotificationSubscriptionsResponse> + callable, + ListNotificationSubscriptionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + NotificationSubscription> + pageContext = + PageContext.create( + callable, + LIST_NOTIFICATION_SUBSCRIPTIONS_PAGE_STR_DESC, + request, + context); + return ListNotificationSubscriptionsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getNotificationSubscription. */ + public UnaryCallSettings + getNotificationSubscriptionSettings() { + return getNotificationSubscriptionSettings; + } + + /** Returns the object with the settings used for calls to createNotificationSubscription. */ + public UnaryCallSettings + createNotificationSubscriptionSettings() { + return createNotificationSubscriptionSettings; + } + + /** Returns the object with the settings used for calls to updateNotificationSubscription. */ + public UnaryCallSettings + updateNotificationSubscriptionSettings() { + return updateNotificationSubscriptionSettings; + } + + /** Returns the object with the settings used for calls to deleteNotificationSubscription. */ + public UnaryCallSettings + deleteNotificationSubscriptionSettings() { + return deleteNotificationSubscriptionSettings; + } + + /** Returns the object with the settings used for calls to listNotificationSubscriptions. */ + public PagedCallSettings< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + ListNotificationSubscriptionsPagedResponse> + listNotificationSubscriptionsSettings() { + return listNotificationSubscriptionsSettings; + } + + public NotificationsApiServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcNotificationsApiServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonNotificationsApiServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "merchantapi"; + } + + /** 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 "merchantapi.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "merchantapi.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(NotificationsApiServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(NotificationsApiServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return NotificationsApiServiceStubSettings.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 NotificationsApiServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getNotificationSubscriptionSettings = + settingsBuilder.getNotificationSubscriptionSettings().build(); + createNotificationSubscriptionSettings = + settingsBuilder.createNotificationSubscriptionSettings().build(); + updateNotificationSubscriptionSettings = + settingsBuilder.updateNotificationSubscriptionSettings().build(); + deleteNotificationSubscriptionSettings = + settingsBuilder.deleteNotificationSubscriptionSettings().build(); + listNotificationSubscriptionsSettings = + settingsBuilder.listNotificationSubscriptionsSettings().build(); + } + + /** Builder for NotificationsApiServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder< + GetNotificationSubscriptionRequest, NotificationSubscription> + getNotificationSubscriptionSettings; + private final UnaryCallSettings.Builder< + CreateNotificationSubscriptionRequest, NotificationSubscription> + createNotificationSubscriptionSettings; + private final UnaryCallSettings.Builder< + UpdateNotificationSubscriptionRequest, NotificationSubscription> + updateNotificationSubscriptionSettings; + private final UnaryCallSettings.Builder + deleteNotificationSubscriptionSettings; + private final PagedCallSettings.Builder< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + ListNotificationSubscriptionsPagedResponse> + listNotificationSubscriptionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(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); + + getNotificationSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createNotificationSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateNotificationSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteNotificationSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listNotificationSubscriptionsSettings = + PagedCallSettings.newBuilder(LIST_NOTIFICATION_SUBSCRIPTIONS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getNotificationSubscriptionSettings, + createNotificationSubscriptionSettings, + updateNotificationSubscriptionSettings, + deleteNotificationSubscriptionSettings, + listNotificationSubscriptionsSettings); + initDefaults(this); + } + + protected Builder(NotificationsApiServiceStubSettings settings) { + super(settings); + + getNotificationSubscriptionSettings = + settings.getNotificationSubscriptionSettings.toBuilder(); + createNotificationSubscriptionSettings = + settings.createNotificationSubscriptionSettings.toBuilder(); + updateNotificationSubscriptionSettings = + settings.updateNotificationSubscriptionSettings.toBuilder(); + deleteNotificationSubscriptionSettings = + settings.deleteNotificationSubscriptionSettings.toBuilder(); + listNotificationSubscriptionsSettings = + settings.listNotificationSubscriptionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getNotificationSubscriptionSettings, + createNotificationSubscriptionSettings, + updateNotificationSubscriptionSettings, + deleteNotificationSubscriptionSettings, + listNotificationSubscriptionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getNotificationSubscriptionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createNotificationSubscriptionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateNotificationSubscriptionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteNotificationSubscriptionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listNotificationSubscriptionsSettings() + .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 getNotificationSubscription. */ + public UnaryCallSettings.Builder + getNotificationSubscriptionSettings() { + return getNotificationSubscriptionSettings; + } + + /** Returns the builder for the settings used for calls to createNotificationSubscription. */ + public UnaryCallSettings.Builder< + CreateNotificationSubscriptionRequest, NotificationSubscription> + createNotificationSubscriptionSettings() { + return createNotificationSubscriptionSettings; + } + + /** Returns the builder for the settings used for calls to updateNotificationSubscription. */ + public UnaryCallSettings.Builder< + UpdateNotificationSubscriptionRequest, NotificationSubscription> + updateNotificationSubscriptionSettings() { + return updateNotificationSubscriptionSettings; + } + + /** Returns the builder for the settings used for calls to deleteNotificationSubscription. */ + public UnaryCallSettings.Builder + deleteNotificationSubscriptionSettings() { + return deleteNotificationSubscriptionSettings; + } + + /** Returns the builder for the settings used for calls to listNotificationSubscriptions. */ + public PagedCallSettings.Builder< + ListNotificationSubscriptionsRequest, + ListNotificationSubscriptionsResponse, + ListNotificationSubscriptionsPagedResponse> + listNotificationSubscriptionsSettings() { + return listNotificationSubscriptionsSettings; + } + + @Override + public NotificationsApiServiceStubSettings build() throws IOException { + return new NotificationsApiServiceStubSettings(this); + } + } +} diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/resources/META-INF/native-image/com.google.shopping.merchant.notifications.v1beta/reflect-config.json b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/resources/META-INF/native-image/com.google.shopping.merchant.notifications.v1beta/reflect-config.json new file mode 100644 index 000000000000..a7ef1e302dd9 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/resources/META-INF/native-image/com.google.shopping.merchant.notifications.v1beta/reflect-config.json @@ -0,0 +1,1469 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.Attribute", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.NotificationSubscription", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.NotificationSubscription$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.NotificationSubscription$NotificationEventType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.ProductChange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.ProductChange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.Resource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Channel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Channel$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Channel$ChannelEnum", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.CustomAttribute", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.CustomAttribute$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Destination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Destination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Destination$DestinationEnum", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Price", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Price$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.ReportingContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.ReportingContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.ReportingContext$ReportingContextEnum", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/MockNotificationsApiService.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/MockNotificationsApiService.java new file mode 100644 index 000000000000..0cd11a72f346 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/MockNotificationsApiService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta; + +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 MockNotificationsApiService implements MockGrpcService { + private final MockNotificationsApiServiceImpl serviceImpl; + + public MockNotificationsApiService() { + serviceImpl = new MockNotificationsApiServiceImpl(); + } + + @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-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/MockNotificationsApiServiceImpl.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/MockNotificationsApiServiceImpl.java new file mode 100644 index 000000000000..c7dec97d8b4a --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/MockNotificationsApiServiceImpl.java @@ -0,0 +1,170 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceGrpc.NotificationsApiServiceImplBase; +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 MockNotificationsApiServiceImpl extends NotificationsApiServiceImplBase { + private List requests; + private Queue responses; + + public MockNotificationsApiServiceImpl() { + 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 getNotificationSubscription( + GetNotificationSubscriptionRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof NotificationSubscription) { + requests.add(request); + responseObserver.onNext(((NotificationSubscription) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetNotificationSubscription, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + NotificationSubscription.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createNotificationSubscription( + CreateNotificationSubscriptionRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof NotificationSubscription) { + requests.add(request); + responseObserver.onNext(((NotificationSubscription) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateNotificationSubscription, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + NotificationSubscription.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateNotificationSubscription( + UpdateNotificationSubscriptionRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof NotificationSubscription) { + requests.add(request); + responseObserver.onNext(((NotificationSubscription) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateNotificationSubscription, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + NotificationSubscription.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteNotificationSubscription( + DeleteNotificationSubscriptionRequest 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 DeleteNotificationSubscription, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listNotificationSubscriptions( + ListNotificationSubscriptionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListNotificationSubscriptionsResponse) { + requests.add(request); + responseObserver.onNext(((ListNotificationSubscriptionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListNotificationSubscriptions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListNotificationSubscriptionsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceClientHttpJsonTest.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..282fec4ce0c4 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceClientHttpJsonTest.java @@ -0,0 +1,527 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta; + +import static com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.notifications.v1beta.stub.HttpJsonNotificationsApiServiceStub; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class NotificationsApiServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static NotificationsApiServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonNotificationsApiServiceStub.getMethodDescriptors(), + NotificationsApiServiceSettings.getDefaultEndpoint()); + NotificationsApiServiceSettings settings = + NotificationsApiServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + NotificationsApiServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = NotificationsApiServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getNotificationSubscriptionTest() throws Exception { + NotificationSubscription expectedResponse = + NotificationSubscription.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setCallBackUri("callBackUri-760667449") + .build(); + mockService.addResponse(expectedResponse); + + NotificationSubscriptionName name = + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + + NotificationSubscription actualResponse = client.getNotificationSubscription(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 getNotificationSubscriptionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + NotificationSubscriptionName name = + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + client.getNotificationSubscription(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getNotificationSubscriptionTest2() throws Exception { + NotificationSubscription expectedResponse = + NotificationSubscription.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setCallBackUri("callBackUri-760667449") + .build(); + mockService.addResponse(expectedResponse); + + String name = "accounts/account-7245/notificationsubscriptions/notificationsubscription-7245"; + + NotificationSubscription actualResponse = client.getNotificationSubscription(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 getNotificationSubscriptionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "accounts/account-7245/notificationsubscriptions/notificationsubscription-7245"; + client.getNotificationSubscription(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createNotificationSubscriptionTest() throws Exception { + NotificationSubscription expectedResponse = + NotificationSubscription.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setCallBackUri("callBackUri-760667449") + .build(); + mockService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder().build(); + + NotificationSubscription actualResponse = + client.createNotificationSubscription(parent, notificationSubscription); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createNotificationSubscriptionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder().build(); + client.createNotificationSubscription(parent, notificationSubscription); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createNotificationSubscriptionTest2() throws Exception { + NotificationSubscription expectedResponse = + NotificationSubscription.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setCallBackUri("callBackUri-760667449") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "accounts/account-4811"; + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder().build(); + + NotificationSubscription actualResponse = + client.createNotificationSubscription(parent, notificationSubscription); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createNotificationSubscriptionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "accounts/account-4811"; + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder().build(); + client.createNotificationSubscription(parent, notificationSubscription); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateNotificationSubscriptionTest() throws Exception { + NotificationSubscription expectedResponse = + NotificationSubscription.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setCallBackUri("callBackUri-760667449") + .build(); + mockService.addResponse(expectedResponse); + + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setCallBackUri("callBackUri-760667449") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + NotificationSubscription actualResponse = + client.updateNotificationSubscription(notificationSubscription, 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 updateNotificationSubscriptionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setCallBackUri("callBackUri-760667449") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateNotificationSubscription(notificationSubscription, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteNotificationSubscriptionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + NotificationSubscriptionName name = + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + + client.deleteNotificationSubscription(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 deleteNotificationSubscriptionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + NotificationSubscriptionName name = + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + client.deleteNotificationSubscription(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteNotificationSubscriptionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "accounts/account-7245/notificationsubscriptions/notificationsubscription-7245"; + + client.deleteNotificationSubscription(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 deleteNotificationSubscriptionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "accounts/account-7245/notificationsubscriptions/notificationsubscription-7245"; + client.deleteNotificationSubscription(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listNotificationSubscriptionsTest() throws Exception { + NotificationSubscription responsesElement = NotificationSubscription.newBuilder().build(); + ListNotificationSubscriptionsResponse expectedResponse = + ListNotificationSubscriptionsResponse.newBuilder() + .setNextPageToken("") + .addAllNotificationSubscriptions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListNotificationSubscriptionsPagedResponse pagedListResponse = + client.listNotificationSubscriptions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getNotificationSubscriptionsList().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 listNotificationSubscriptionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + client.listNotificationSubscriptions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listNotificationSubscriptionsTest2() throws Exception { + NotificationSubscription responsesElement = NotificationSubscription.newBuilder().build(); + ListNotificationSubscriptionsResponse expectedResponse = + ListNotificationSubscriptionsResponse.newBuilder() + .setNextPageToken("") + .addAllNotificationSubscriptions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "accounts/account-4811"; + + ListNotificationSubscriptionsPagedResponse pagedListResponse = + client.listNotificationSubscriptions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getNotificationSubscriptionsList().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 listNotificationSubscriptionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "accounts/account-4811"; + client.listNotificationSubscriptions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceClientTest.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceClientTest.java new file mode 100644 index 000000000000..4be549a61b55 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceClientTest.java @@ -0,0 +1,479 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta; + +import static com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class NotificationsApiServiceClientTest { + private static MockNotificationsApiService mockNotificationsApiService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private NotificationsApiServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockNotificationsApiService = new MockNotificationsApiService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockNotificationsApiService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + NotificationsApiServiceSettings settings = + NotificationsApiServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = NotificationsApiServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getNotificationSubscriptionTest() throws Exception { + NotificationSubscription expectedResponse = + NotificationSubscription.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setCallBackUri("callBackUri-760667449") + .build(); + mockNotificationsApiService.addResponse(expectedResponse); + + NotificationSubscriptionName name = + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + + NotificationSubscription actualResponse = client.getNotificationSubscription(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNotificationsApiService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetNotificationSubscriptionRequest actualRequest = + ((GetNotificationSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getNotificationSubscriptionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNotificationsApiService.addException(exception); + + try { + NotificationSubscriptionName name = + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + client.getNotificationSubscription(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getNotificationSubscriptionTest2() throws Exception { + NotificationSubscription expectedResponse = + NotificationSubscription.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setCallBackUri("callBackUri-760667449") + .build(); + mockNotificationsApiService.addResponse(expectedResponse); + + String name = "name3373707"; + + NotificationSubscription actualResponse = client.getNotificationSubscription(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNotificationsApiService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetNotificationSubscriptionRequest actualRequest = + ((GetNotificationSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getNotificationSubscriptionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNotificationsApiService.addException(exception); + + try { + String name = "name3373707"; + client.getNotificationSubscription(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createNotificationSubscriptionTest() throws Exception { + NotificationSubscription expectedResponse = + NotificationSubscription.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setCallBackUri("callBackUri-760667449") + .build(); + mockNotificationsApiService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder().build(); + + NotificationSubscription actualResponse = + client.createNotificationSubscription(parent, notificationSubscription); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNotificationsApiService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateNotificationSubscriptionRequest actualRequest = + ((CreateNotificationSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(notificationSubscription, actualRequest.getNotificationSubscription()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createNotificationSubscriptionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNotificationsApiService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder().build(); + client.createNotificationSubscription(parent, notificationSubscription); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createNotificationSubscriptionTest2() throws Exception { + NotificationSubscription expectedResponse = + NotificationSubscription.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setCallBackUri("callBackUri-760667449") + .build(); + mockNotificationsApiService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder().build(); + + NotificationSubscription actualResponse = + client.createNotificationSubscription(parent, notificationSubscription); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNotificationsApiService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateNotificationSubscriptionRequest actualRequest = + ((CreateNotificationSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(notificationSubscription, actualRequest.getNotificationSubscription()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createNotificationSubscriptionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNotificationsApiService.addException(exception); + + try { + String parent = "parent-995424086"; + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder().build(); + client.createNotificationSubscription(parent, notificationSubscription); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateNotificationSubscriptionTest() throws Exception { + NotificationSubscription expectedResponse = + NotificationSubscription.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setCallBackUri("callBackUri-760667449") + .build(); + mockNotificationsApiService.addResponse(expectedResponse); + + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + NotificationSubscription actualResponse = + client.updateNotificationSubscription(notificationSubscription, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNotificationsApiService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateNotificationSubscriptionRequest actualRequest = + ((UpdateNotificationSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(notificationSubscription, actualRequest.getNotificationSubscription()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateNotificationSubscriptionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNotificationsApiService.addException(exception); + + try { + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateNotificationSubscription(notificationSubscription, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteNotificationSubscriptionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockNotificationsApiService.addResponse(expectedResponse); + + NotificationSubscriptionName name = + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + + client.deleteNotificationSubscription(name); + + List actualRequests = mockNotificationsApiService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteNotificationSubscriptionRequest actualRequest = + ((DeleteNotificationSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteNotificationSubscriptionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNotificationsApiService.addException(exception); + + try { + NotificationSubscriptionName name = + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + client.deleteNotificationSubscription(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteNotificationSubscriptionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockNotificationsApiService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteNotificationSubscription(name); + + List actualRequests = mockNotificationsApiService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteNotificationSubscriptionRequest actualRequest = + ((DeleteNotificationSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteNotificationSubscriptionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNotificationsApiService.addException(exception); + + try { + String name = "name3373707"; + client.deleteNotificationSubscription(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listNotificationSubscriptionsTest() throws Exception { + NotificationSubscription responsesElement = NotificationSubscription.newBuilder().build(); + ListNotificationSubscriptionsResponse expectedResponse = + ListNotificationSubscriptionsResponse.newBuilder() + .setNextPageToken("") + .addAllNotificationSubscriptions(Arrays.asList(responsesElement)) + .build(); + mockNotificationsApiService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListNotificationSubscriptionsPagedResponse pagedListResponse = + client.listNotificationSubscriptions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getNotificationSubscriptionsList().get(0), resources.get(0)); + + List actualRequests = mockNotificationsApiService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListNotificationSubscriptionsRequest actualRequest = + ((ListNotificationSubscriptionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listNotificationSubscriptionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNotificationsApiService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + client.listNotificationSubscriptions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listNotificationSubscriptionsTest2() throws Exception { + NotificationSubscription responsesElement = NotificationSubscription.newBuilder().build(); + ListNotificationSubscriptionsResponse expectedResponse = + ListNotificationSubscriptionsResponse.newBuilder() + .setNextPageToken("") + .addAllNotificationSubscriptions(Arrays.asList(responsesElement)) + .build(); + mockNotificationsApiService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListNotificationSubscriptionsPagedResponse pagedListResponse = + client.listNotificationSubscriptions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getNotificationSubscriptionsList().get(0), resources.get(0)); + + List actualRequests = mockNotificationsApiService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListNotificationSubscriptionsRequest actualRequest = + ((ListNotificationSubscriptionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listNotificationSubscriptionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNotificationsApiService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listNotificationSubscriptions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1beta/pom.xml b/java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1beta/pom.xml new file mode 100644 index 000000000000..5e0c12d840fc --- /dev/null +++ b/java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1beta/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.shopping.api.grpc + grpc-google-shopping-merchant-notifications-v1beta + 0.0.1-SNAPSHOT + grpc-google-shopping-merchant-notifications-v1beta + GRPC library for google-shopping-merchant-notifications + + com.google.shopping + google-shopping-merchant-notifications-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.shopping.api.grpc + proto-google-shopping-merchant-notifications-v1beta + + + com.google.guava + guava + + + diff --git a/java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceGrpc.java b/java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceGrpc.java new file mode 100644 index 000000000000..8496e90b473d --- /dev/null +++ b/java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceGrpc.java @@ -0,0 +1,1019 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.shopping.merchant.notifications.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to manage notification subscriptions for merchants
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class NotificationsApiServiceGrpc { + + private NotificationsApiServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.shopping.merchant.notifications.v1beta.NotificationsApiService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + getGetNotificationSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetNotificationSubscription", + requestType = + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + .class, + responseType = + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + getGetNotificationSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + getGetNotificationSubscriptionMethod; + if ((getGetNotificationSubscriptionMethod = + NotificationsApiServiceGrpc.getGetNotificationSubscriptionMethod) + == null) { + synchronized (NotificationsApiServiceGrpc.class) { + if ((getGetNotificationSubscriptionMethod = + NotificationsApiServiceGrpc.getGetNotificationSubscriptionMethod) + == null) { + NotificationsApiServiceGrpc.getGetNotificationSubscriptionMethod = + getGetNotificationSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetNotificationSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1beta + .GetNotificationSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1beta + .NotificationSubscription.getDefaultInstance())) + .setSchemaDescriptor( + new NotificationsApiServiceMethodDescriptorSupplier( + "GetNotificationSubscription")) + .build(); + } + } + } + return getGetNotificationSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + getCreateNotificationSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateNotificationSubscription", + requestType = + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + .class, + responseType = + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + getCreateNotificationSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + getCreateNotificationSubscriptionMethod; + if ((getCreateNotificationSubscriptionMethod = + NotificationsApiServiceGrpc.getCreateNotificationSubscriptionMethod) + == null) { + synchronized (NotificationsApiServiceGrpc.class) { + if ((getCreateNotificationSubscriptionMethod = + NotificationsApiServiceGrpc.getCreateNotificationSubscriptionMethod) + == null) { + NotificationsApiServiceGrpc.getCreateNotificationSubscriptionMethod = + getCreateNotificationSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateNotificationSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1beta + .NotificationSubscription.getDefaultInstance())) + .setSchemaDescriptor( + new NotificationsApiServiceMethodDescriptorSupplier( + "CreateNotificationSubscription")) + .build(); + } + } + } + return getCreateNotificationSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + getUpdateNotificationSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateNotificationSubscription", + requestType = + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + .class, + responseType = + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + getUpdateNotificationSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + getUpdateNotificationSubscriptionMethod; + if ((getUpdateNotificationSubscriptionMethod = + NotificationsApiServiceGrpc.getUpdateNotificationSubscriptionMethod) + == null) { + synchronized (NotificationsApiServiceGrpc.class) { + if ((getUpdateNotificationSubscriptionMethod = + NotificationsApiServiceGrpc.getUpdateNotificationSubscriptionMethod) + == null) { + NotificationsApiServiceGrpc.getUpdateNotificationSubscriptionMethod = + getUpdateNotificationSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateNotificationSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1beta + .NotificationSubscription.getDefaultInstance())) + .setSchemaDescriptor( + new NotificationsApiServiceMethodDescriptorSupplier( + "UpdateNotificationSubscription")) + .build(); + } + } + } + return getUpdateNotificationSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest, + com.google.protobuf.Empty> + getDeleteNotificationSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteNotificationSubscription", + requestType = + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + .class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest, + com.google.protobuf.Empty> + getDeleteNotificationSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest, + com.google.protobuf.Empty> + getDeleteNotificationSubscriptionMethod; + if ((getDeleteNotificationSubscriptionMethod = + NotificationsApiServiceGrpc.getDeleteNotificationSubscriptionMethod) + == null) { + synchronized (NotificationsApiServiceGrpc.class) { + if ((getDeleteNotificationSubscriptionMethod = + NotificationsApiServiceGrpc.getDeleteNotificationSubscriptionMethod) + == null) { + NotificationsApiServiceGrpc.getDeleteNotificationSubscriptionMethod = + getDeleteNotificationSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteNotificationSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new NotificationsApiServiceMethodDescriptorSupplier( + "DeleteNotificationSubscription")) + .build(); + } + } + } + return getDeleteNotificationSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest, + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse> + getListNotificationSubscriptionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListNotificationSubscriptions", + requestType = + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + .class, + responseType = + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + .class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest, + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse> + getListNotificationSubscriptionsMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest, + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse> + getListNotificationSubscriptionsMethod; + if ((getListNotificationSubscriptionsMethod = + NotificationsApiServiceGrpc.getListNotificationSubscriptionsMethod) + == null) { + synchronized (NotificationsApiServiceGrpc.class) { + if ((getListNotificationSubscriptionsMethod = + NotificationsApiServiceGrpc.getListNotificationSubscriptionsMethod) + == null) { + NotificationsApiServiceGrpc.getListNotificationSubscriptionsMethod = + getListNotificationSubscriptionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListNotificationSubscriptions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new NotificationsApiServiceMethodDescriptorSupplier( + "ListNotificationSubscriptions")) + .build(); + } + } + } + return getListNotificationSubscriptionsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static NotificationsApiServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public NotificationsApiServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NotificationsApiServiceStub(channel, callOptions); + } + }; + return NotificationsApiServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static NotificationsApiServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public NotificationsApiServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NotificationsApiServiceBlockingStub(channel, callOptions); + } + }; + return NotificationsApiServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static NotificationsApiServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public NotificationsApiServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NotificationsApiServiceFutureStub(channel, callOptions); + } + }; + return NotificationsApiServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to manage notification subscriptions for merchants
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Gets notification subscriptions for an account.
+     * 
+ */ + default void getNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetNotificationSubscriptionMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a notification subscription for a merchant. We will allow the
+     * following types of notification subscriptions to exist together (per
+     * merchant as a subscriber per event type):
+     * 1. Subscription for all managed accounts + subscription for self
+     * 2. Multiple "partial" subscriptions for managed accounts + subscription
+     * for self
+     * we will not allow (per merchant as a subscriber per event type):
+     * 1. multiple self subscriptions.
+     * 2. multiple "all managed accounts" subscriptions.
+     * 3. all and partial subscriptions at the same time.
+     * 4. multiple partial subscriptions for the same target account
+     * 
+ */ + default void createNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateNotificationSubscriptionMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an existing notification subscription for a merchant.
+     * 
+ */ + default void updateNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateNotificationSubscriptionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a notification subscription for a merchant.
+     * 
+ */ + default void deleteNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteNotificationSubscriptionMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets all the notification subscriptions for a merchant.
+     * 
+ */ + default void listNotificationSubscriptions( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListNotificationSubscriptionsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service NotificationsApiService. + * + *
+   * Service to manage notification subscriptions for merchants
+   * 
+ */ + public abstract static class NotificationsApiServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return NotificationsApiServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service NotificationsApiService. + * + *
+   * Service to manage notification subscriptions for merchants
+   * 
+ */ + public static final class NotificationsApiServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private NotificationsApiServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected NotificationsApiServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NotificationsApiServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets notification subscriptions for an account.
+     * 
+ */ + public void getNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetNotificationSubscriptionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a notification subscription for a merchant. We will allow the
+     * following types of notification subscriptions to exist together (per
+     * merchant as a subscriber per event type):
+     * 1. Subscription for all managed accounts + subscription for self
+     * 2. Multiple "partial" subscriptions for managed accounts + subscription
+     * for self
+     * we will not allow (per merchant as a subscriber per event type):
+     * 1. multiple self subscriptions.
+     * 2. multiple "all managed accounts" subscriptions.
+     * 3. all and partial subscriptions at the same time.
+     * 4. multiple partial subscriptions for the same target account
+     * 
+ */ + public void createNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateNotificationSubscriptionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an existing notification subscription for a merchant.
+     * 
+ */ + public void updateNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateNotificationSubscriptionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a notification subscription for a merchant.
+     * 
+ */ + public void deleteNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteNotificationSubscriptionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets all the notification subscriptions for a merchant.
+     * 
+ */ + public void listNotificationSubscriptions( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListNotificationSubscriptionsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service NotificationsApiService. + * + *
+   * Service to manage notification subscriptions for merchants
+   * 
+ */ + public static final class NotificationsApiServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private NotificationsApiServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected NotificationsApiServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NotificationsApiServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets notification subscriptions for an account.
+     * 
+ */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + getNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetNotificationSubscriptionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a notification subscription for a merchant. We will allow the
+     * following types of notification subscriptions to exist together (per
+     * merchant as a subscriber per event type):
+     * 1. Subscription for all managed accounts + subscription for self
+     * 2. Multiple "partial" subscriptions for managed accounts + subscription
+     * for self
+     * we will not allow (per merchant as a subscriber per event type):
+     * 1. multiple self subscriptions.
+     * 2. multiple "all managed accounts" subscriptions.
+     * 3. all and partial subscriptions at the same time.
+     * 4. multiple partial subscriptions for the same target account
+     * 
+ */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + createNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateNotificationSubscriptionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing notification subscription for a merchant.
+     * 
+ */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + updateNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateNotificationSubscriptionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a notification subscription for a merchant.
+     * 
+ */ + public com.google.protobuf.Empty deleteNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteNotificationSubscriptionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets all the notification subscriptions for a merchant.
+     * 
+ */ + public com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + listNotificationSubscriptions( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListNotificationSubscriptionsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * NotificationsApiService. + * + *
+   * Service to manage notification subscriptions for merchants
+   * 
+ */ + public static final class NotificationsApiServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private NotificationsApiServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected NotificationsApiServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NotificationsApiServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets notification subscriptions for an account.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + getNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetNotificationSubscriptionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a notification subscription for a merchant. We will allow the
+     * following types of notification subscriptions to exist together (per
+     * merchant as a subscriber per event type):
+     * 1. Subscription for all managed accounts + subscription for self
+     * 2. Multiple "partial" subscriptions for managed accounts + subscription
+     * for self
+     * we will not allow (per merchant as a subscriber per event type):
+     * 1. multiple self subscriptions.
+     * 2. multiple "all managed accounts" subscriptions.
+     * 3. all and partial subscriptions at the same time.
+     * 4. multiple partial subscriptions for the same target account
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + createNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateNotificationSubscriptionMethod(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Updates an existing notification subscription for a merchant.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + updateNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateNotificationSubscriptionMethod(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Deletes a notification subscription for a merchant.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteNotificationSubscriptionMethod(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Gets all the notification subscriptions for a merchant.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse> + listNotificationSubscriptions( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListNotificationSubscriptionsMethod(), getCallOptions()), + request); + } + } + + private static final int METHODID_GET_NOTIFICATION_SUBSCRIPTION = 0; + private static final int METHODID_CREATE_NOTIFICATION_SUBSCRIPTION = 1; + private static final int METHODID_UPDATE_NOTIFICATION_SUBSCRIPTION = 2; + private static final int METHODID_DELETE_NOTIFICATION_SUBSCRIPTION = 3; + private static final int METHODID_LIST_NOTIFICATION_SUBSCRIPTIONS = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_NOTIFICATION_SUBSCRIPTION: + serviceImpl.getNotificationSubscription( + (com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription>) + responseObserver); + break; + case METHODID_CREATE_NOTIFICATION_SUBSCRIPTION: + serviceImpl.createNotificationSubscription( + (com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription>) + responseObserver); + break; + case METHODID_UPDATE_NOTIFICATION_SUBSCRIPTION: + serviceImpl.updateNotificationSubscription( + (com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription>) + responseObserver); + break; + case METHODID_DELETE_NOTIFICATION_SUBSCRIPTION: + serviceImpl.deleteNotificationSubscription( + (com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest) + request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_NOTIFICATION_SUBSCRIPTIONS: + serviceImpl.listNotificationSubscriptions( + (com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetNotificationSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.notifications.v1beta + .GetNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription>( + service, METHODID_GET_NOTIFICATION_SUBSCRIPTION))) + .addMethod( + getCreateNotificationSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription>( + service, METHODID_CREATE_NOTIFICATION_SUBSCRIPTION))) + .addMethod( + getUpdateNotificationSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription>( + service, METHODID_UPDATE_NOTIFICATION_SUBSCRIPTION))) + .addMethod( + getDeleteNotificationSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_NOTIFICATION_SUBSCRIPTION))) + .addMethod( + getListNotificationSubscriptionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest, + com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse>( + service, METHODID_LIST_NOTIFICATION_SUBSCRIPTIONS))) + .build(); + } + + private abstract static class NotificationsApiServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + NotificationsApiServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("NotificationsApiService"); + } + } + + private static final class NotificationsApiServiceFileDescriptorSupplier + extends NotificationsApiServiceBaseDescriptorSupplier { + NotificationsApiServiceFileDescriptorSupplier() {} + } + + private static final class NotificationsApiServiceMethodDescriptorSupplier + extends NotificationsApiServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + NotificationsApiServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (NotificationsApiServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new NotificationsApiServiceFileDescriptorSupplier()) + .addMethod(getGetNotificationSubscriptionMethod()) + .addMethod(getCreateNotificationSubscriptionMethod()) + .addMethod(getUpdateNotificationSubscriptionMethod()) + .addMethod(getDeleteNotificationSubscriptionMethod()) + .addMethod(getListNotificationSubscriptionsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-shopping-merchant-notifications/owlbot.py b/java-shopping-merchant-notifications/owlbot.py new file mode 100644 index 000000000000..2ba11e6bba67 --- /dev/null +++ b/java-shopping-merchant-notifications/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-shopping-merchant-notifications/pom.xml b/java-shopping-merchant-notifications/pom.xml new file mode 100644 index 000000000000..b615e58eec00 --- /dev/null +++ b/java-shopping-merchant-notifications/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + com.google.shopping + google-shopping-merchant-notifications-parent + pom + 0.0.1-SNAPSHOT + Google Merchant Notifications API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.36.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-shopping-merchant-notifications-parent + + + + + + com.google.shopping + google-shopping-merchant-notifications + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-notifications-v1beta + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + proto-google-shopping-merchant-notifications-v1beta + 0.0.1-SNAPSHOT + + + + + + + google-shopping-merchant-notifications + grpc-google-shopping-merchant-notifications-v1beta + proto-google-shopping-merchant-notifications-v1beta + google-shopping-merchant-notifications-bom + + + diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/clirr-ignored-differences.xml b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/clirr-ignored-differences.xml new file mode 100644 index 000000000000..051d4bb6db8d --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/shopping/merchant/notifications/v1beta/*OrBuilder + * get*(*) + + + 7012 + com/google/shopping/merchant/notifications/v1beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/shopping/merchant/notifications/v1beta/*OrBuilder + boolean has*(*) + + diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/pom.xml b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/pom.xml new file mode 100644 index 000000000000..a950693c2382 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.shopping.api.grpc + proto-google-shopping-merchant-notifications-v1beta + 0.0.1-SNAPSHOT + proto-google-shopping-merchant-notifications-v1beta + Proto library for google-shopping-merchant-notifications + + com.google.shopping + google-shopping-merchant-notifications-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 + + + diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/AccountName.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/AccountName.java new file mode 100644 index 000000000000..efca22ad6b2f --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/AccountName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta; + +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 AccountName implements ResourceName { + private static final PathTemplate ACCOUNT = + PathTemplate.createWithoutUrlEncoding("accounts/{account}"); + private volatile Map fieldValuesMap; + private final String account; + + @Deprecated + protected AccountName() { + account = null; + } + + private AccountName(Builder builder) { + account = Preconditions.checkNotNull(builder.getAccount()); + } + + public String getAccount() { + return account; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AccountName of(String account) { + return newBuilder().setAccount(account).build(); + } + + public static String format(String account) { + return newBuilder().setAccount(account).build().toString(); + } + + public static AccountName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT.validatedMatch( + formattedString, "AccountName.parse: formattedString not in valid format"); + return of(matchMap.get("account")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (AccountName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ACCOUNT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (account != null) { + fieldMapBuilder.put("account", account); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ACCOUNT.instantiate("account", account); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + AccountName that = ((AccountName) o); + return Objects.equals(this.account, that.account); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(account); + return h; + } + + /** Builder for accounts/{account}. */ + public static class Builder { + private String account; + + protected Builder() {} + + public String getAccount() { + return account; + } + + public Builder setAccount(String account) { + this.account = account; + return this; + } + + private Builder(AccountName accountName) { + this.account = accountName.account; + } + + public AccountName build() { + return new AccountName(this); + } + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/Attribute.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/Attribute.java new file mode 100644 index 000000000000..a64d9364c5a1 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/Attribute.java @@ -0,0 +1,158 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +/** + * + * + *
+ * Enum to specify the attribute in the resource that is being changed to
+ * notify the merchant about.
+ * 
+ * + * Protobuf enum {@code google.shopping.merchant.notifications.v1beta.Attribute} + */ +public enum Attribute implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified attribute
+   * 
+ * + * ATTRIBUTE_UNSPECIFIED = 0; + */ + ATTRIBUTE_UNSPECIFIED(0), + /** + * + * + *
+   * Status of the changed entity
+   * 
+ * + * STATUS = 1; + */ + STATUS(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified attribute
+   * 
+ * + * ATTRIBUTE_UNSPECIFIED = 0; + */ + public static final int ATTRIBUTE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Status of the changed entity
+   * 
+ * + * STATUS = 1; + */ + public static final int STATUS_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 Attribute 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 Attribute forNumber(int value) { + switch (value) { + case 0: + return ATTRIBUTE_UNSPECIFIED; + case 1: + return STATUS; + 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 Attribute findValueByNumber(int number) { + return Attribute.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.shopping.merchant.notifications.v1beta.NotificationsApiProto.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final Attribute[] VALUES = values(); + + public static Attribute 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 Attribute(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.merchant.notifications.v1beta.Attribute) +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/CreateNotificationSubscriptionRequest.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/CreateNotificationSubscriptionRequest.java new file mode 100644 index 000000000000..0af88d416625 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/CreateNotificationSubscriptionRequest.java @@ -0,0 +1,1030 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +/** + * + * + *
+ * Request message for the CreateNotificationSubscription method.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest} + */ +public final class CreateNotificationSubscriptionRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest) + CreateNotificationSubscriptionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateNotificationSubscriptionRequest.newBuilder() to construct. + private CreateNotificationSubscriptionRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateNotificationSubscriptionRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateNotificationSubscriptionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_CreateNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_CreateNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + .class, + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + .Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The merchant account that owns the new notification subscription.
+   * Format: `accounts/{account}`
+   * 
+ * + * + * 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 merchant account that owns the new notification subscription.
+   * Format: `accounts/{account}`
+   * 
+ * + * + * 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 NOTIFICATION_SUBSCRIPTION_FIELD_NUMBER = 2; + private com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + notificationSubscription_; + /** + * + * + *
+   * Required. The notification subscription to create.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the notificationSubscription field is set. + */ + @java.lang.Override + public boolean hasNotificationSubscription() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The notification subscription to create.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationSubscription. + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + getNotificationSubscription() { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } + /** + * + * + *
+   * Required. The notification subscription to create.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder + getNotificationSubscriptionOrBuilder() { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getNotificationSubscription()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getNotificationSubscription()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest other = + (com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest) + obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasNotificationSubscription() != other.hasNotificationSubscription()) return false; + if (hasNotificationSubscription()) { + if (!getNotificationSubscription().equals(other.getNotificationSubscription())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasNotificationSubscription()) { + hash = (37 * hash) + NOTIFICATION_SUBSCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getNotificationSubscription().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the CreateNotificationSubscription method.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest) + com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_CreateNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_CreateNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest.class, + com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getNotificationSubscriptionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + notificationSubscription_ = null; + if (notificationSubscriptionBuilder_ != null) { + notificationSubscriptionBuilder_.dispose(); + notificationSubscriptionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_CreateNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + build() { + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + buildPartial() { + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + result = + new com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.notificationSubscription_ = + notificationSubscriptionBuilder_ == null + ? notificationSubscription_ + : notificationSubscriptionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + other) { + if (other + == com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasNotificationSubscription()) { + mergeNotificationSubscription(other.getNotificationSubscription()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getNotificationSubscriptionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The merchant account that owns the new notification subscription.
+     * Format: `accounts/{account}`
+     * 
+ * + * + * 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 merchant account that owns the new notification subscription.
+     * Format: `accounts/{account}`
+     * 
+ * + * + * 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 merchant account that owns the new notification subscription.
+     * Format: `accounts/{account}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The merchant account that owns the new notification subscription.
+     * Format: `accounts/{account}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The merchant account that owns the new notification subscription.
+     * Format: `accounts/{account}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + notificationSubscription_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder> + notificationSubscriptionBuilder_; + /** + * + * + *
+     * Required. The notification subscription to create.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the notificationSubscription field is set. + */ + public boolean hasNotificationSubscription() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The notification subscription to create.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationSubscription. + */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + getNotificationSubscription() { + if (notificationSubscriptionBuilder_ == null) { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } else { + return notificationSubscriptionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The notification subscription to create.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription value) { + if (notificationSubscriptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + notificationSubscription_ = value; + } else { + notificationSubscriptionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The notification subscription to create.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder + builderForValue) { + if (notificationSubscriptionBuilder_ == null) { + notificationSubscription_ = builderForValue.build(); + } else { + notificationSubscriptionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The notification subscription to create.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription value) { + if (notificationSubscriptionBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && notificationSubscription_ != null + && notificationSubscription_ + != com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance()) { + getNotificationSubscriptionBuilder().mergeFrom(value); + } else { + notificationSubscription_ = value; + } + } else { + notificationSubscriptionBuilder_.mergeFrom(value); + } + if (notificationSubscription_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The notification subscription to create.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearNotificationSubscription() { + bitField0_ = (bitField0_ & ~0x00000002); + notificationSubscription_ = null; + if (notificationSubscriptionBuilder_ != null) { + notificationSubscriptionBuilder_.dispose(); + notificationSubscriptionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The notification subscription to create.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder + getNotificationSubscriptionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getNotificationSubscriptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The notification subscription to create.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder + getNotificationSubscriptionOrBuilder() { + if (notificationSubscriptionBuilder_ != null) { + return notificationSubscriptionBuilder_.getMessageOrBuilder(); + } else { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } + } + /** + * + * + *
+     * Required. The notification subscription to create.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder> + getNotificationSubscriptionFieldBuilder() { + if (notificationSubscriptionBuilder_ == null) { + notificationSubscriptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1beta + .NotificationSubscriptionOrBuilder>( + getNotificationSubscription(), getParentForChildren(), isClean()); + notificationSubscription_ = null; + } + return notificationSubscriptionBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest) + private static final com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest(); + } + + public static com.google.shopping.merchant.notifications.v1beta + .CreateNotificationSubscriptionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateNotificationSubscriptionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/CreateNotificationSubscriptionRequestOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/CreateNotificationSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..6517122af249 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/CreateNotificationSubscriptionRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +public interface CreateNotificationSubscriptionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The merchant account that owns the new notification subscription.
+   * Format: `accounts/{account}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The merchant account that owns the new notification subscription.
+   * Format: `accounts/{account}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The notification subscription to create.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the notificationSubscription field is set. + */ + boolean hasNotificationSubscription(); + /** + * + * + *
+   * Required. The notification subscription to create.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationSubscription. + */ + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + getNotificationSubscription(); + /** + * + * + *
+   * Required. The notification subscription to create.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder + getNotificationSubscriptionOrBuilder(); +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/DeleteNotificationSubscriptionRequest.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/DeleteNotificationSubscriptionRequest.java new file mode 100644 index 000000000000..dfe6819f070d --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/DeleteNotificationSubscriptionRequest.java @@ -0,0 +1,696 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +/** + * + * + *
+ * Request message for the DeleteNotificationSubscription method.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest} + */ +public final class DeleteNotificationSubscriptionRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest) + DeleteNotificationSubscriptionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteNotificationSubscriptionRequest.newBuilder() to construct. + private DeleteNotificationSubscriptionRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteNotificationSubscriptionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteNotificationSubscriptionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_DeleteNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_DeleteNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + .class, + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + .Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the notification subscription to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the notification subscription to be deleted.
+   * 
+ * + * + * 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.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest other = + (com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest) + 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.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the DeleteNotificationSubscription method.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest) + com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_DeleteNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_DeleteNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest.class, + com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_DeleteNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + build() { + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + buildPartial() { + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + result = + new com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + other) { + if (other + == com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the notification subscription to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the notification subscription to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the notification subscription to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the notification subscription to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the notification subscription to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest) + private static final com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest(); + } + + public static com.google.shopping.merchant.notifications.v1beta + .DeleteNotificationSubscriptionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteNotificationSubscriptionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/DeleteNotificationSubscriptionRequestOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/DeleteNotificationSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..90af437aa472 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/DeleteNotificationSubscriptionRequestOrBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +public interface DeleteNotificationSubscriptionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the notification subscription to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the notification subscription to be deleted.
+   * 
+ * + * + * 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-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/GetNotificationSubscriptionRequest.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/GetNotificationSubscriptionRequest.java new file mode 100644 index 000000000000..933088893bee --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/GetNotificationSubscriptionRequest.java @@ -0,0 +1,678 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +/** + * + * + *
+ * Request message for the GetNotificationSubscription method.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest} + */ +public final class GetNotificationSubscriptionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest) + GetNotificationSubscriptionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetNotificationSubscriptionRequest.newBuilder() to construct. + private GetNotificationSubscriptionRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetNotificationSubscriptionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetNotificationSubscriptionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_GetNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_GetNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + .class, + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + .Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The `name` of the notification subscription.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The `name` of the notification subscription.
+   * 
+ * + * + * 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.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest other = + (com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest) 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.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the GetNotificationSubscription method.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest) + com.google.shopping.merchant.notifications.v1beta + .GetNotificationSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_GetNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_GetNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + .class, + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_GetNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + build() { + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + buildPartial() { + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest result = + new com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + other) { + if (other + == com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The `name` of the notification subscription.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The `name` of the notification subscription.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The `name` of the notification subscription.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The `name` of the notification subscription.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The `name` of the notification subscription.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest) + private static final com.google.shopping.merchant.notifications.v1beta + .GetNotificationSubscriptionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest(); + } + + public static com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetNotificationSubscriptionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/GetNotificationSubscriptionRequestOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/GetNotificationSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..abea8bcb781a --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/GetNotificationSubscriptionRequestOrBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +public interface GetNotificationSubscriptionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The `name` of the notification subscription.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The `name` of the notification subscription.
+   * 
+ * + * + * 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-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsRequest.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsRequest.java new file mode 100644 index 000000000000..d33b04b1f69a --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsRequest.java @@ -0,0 +1,992 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +/** + * + * + *
+ * Request message for the ListNotificationSubscription method.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest} + */ +public final class ListNotificationSubscriptionsRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest) + ListNotificationSubscriptionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListNotificationSubscriptionsRequest.newBuilder() to construct. + private ListNotificationSubscriptionsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListNotificationSubscriptionsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListNotificationSubscriptionsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + .class, + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + .Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The merchant account who owns the notification subscriptions.
+   * Format: `accounts/{account}`
+   * 
+ * + * + * 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 merchant account who owns the notification subscriptions.
+   * Format: `accounts/{account}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * The maximum number of notification subscriptions to return in a page.
+   * The default value for `page_size` is 100. The
+   * maximum value is `200`. Values above `200` will be coerced to `200`.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Token (if provided) to retrieve the subsequent page. All other parameters
+   * must match the original call that provided the page token.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * Token (if provided) to retrieve the subsequent page. All other parameters
+   * must match the original call that provided the page token.
+   * 
+ * + * 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.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest other = + (com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest) + 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.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the ListNotificationSubscription method.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest) + com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + .class, + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + build() { + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + buildPartial() { + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + result = + new com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + other) { + if (other + == com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The merchant account who owns the notification subscriptions.
+     * Format: `accounts/{account}`
+     * 
+ * + * + * 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 merchant account who owns the notification subscriptions.
+     * Format: `accounts/{account}`
+     * 
+ * + * + * 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 merchant account who owns the notification subscriptions.
+     * Format: `accounts/{account}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The merchant account who owns the notification subscriptions.
+     * Format: `accounts/{account}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The merchant account who owns the notification subscriptions.
+     * Format: `accounts/{account}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of notification subscriptions to return in a page.
+     * The default value for `page_size` is 100. The
+     * maximum value is `200`. Values above `200` will be coerced to `200`.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of notification subscriptions to return in a page.
+     * The default value for `page_size` is 100. The
+     * maximum value is `200`. Values above `200` will be coerced to `200`.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of notification subscriptions to return in a page.
+     * The default value for `page_size` is 100. The
+     * maximum value is `200`. Values above `200` will be coerced to `200`.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Token (if provided) to retrieve the subsequent page. All other parameters
+     * must match the original call that provided the page token.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token (if provided) to retrieve the subsequent page. All other parameters
+     * must match the original call that provided the page token.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token (if provided) to retrieve the subsequent page. All other parameters
+     * must match the original call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Token (if provided) to retrieve the subsequent page. All other parameters
+     * must match the original call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Token (if provided) to retrieve the subsequent page. All other parameters
+     * must match the original call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest) + private static final com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest(); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNotificationSubscriptionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsRequestOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsRequestOrBuilder.java new file mode 100644 index 000000000000..9769fd951fb9 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +public interface ListNotificationSubscriptionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The merchant account who owns the notification subscriptions.
+   * Format: `accounts/{account}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The merchant account who owns the notification subscriptions.
+   * Format: `accounts/{account}`
+   * 
+ * + * + * 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 notification subscriptions to return in a page.
+   * The default value for `page_size` is 100. The
+   * maximum value is `200`. Values above `200` will be coerced to `200`.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Token (if provided) to retrieve the subsequent page. All other parameters
+   * must match the original call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Token (if provided) to retrieve the subsequent page. All other parameters
+   * must match the original call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsResponse.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsResponse.java new file mode 100644 index 000000000000..b7913872bd20 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsResponse.java @@ -0,0 +1,1278 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +/** + * + * + *
+ * Response message for the ListNotificationSubscription method.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse} + */ +public final class ListNotificationSubscriptionsResponse + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse) + ListNotificationSubscriptionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListNotificationSubscriptionsResponse.newBuilder() to construct. + private ListNotificationSubscriptionsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListNotificationSubscriptionsResponse() { + notificationSubscriptions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListNotificationSubscriptionsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + .class, + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + .Builder.class); + } + + public static final int NOTIFICATION_SUBSCRIPTIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + notificationSubscriptions_; + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + @java.lang.Override + public java.util.List + getNotificationSubscriptionsList() { + return notificationSubscriptions_; + } + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder> + getNotificationSubscriptionsOrBuilderList() { + return notificationSubscriptions_; + } + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + @java.lang.Override + public int getNotificationSubscriptionsCount() { + return notificationSubscriptions_.size(); + } + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + getNotificationSubscriptions(int index) { + return notificationSubscriptions_.get(index); + } + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder + getNotificationSubscriptionsOrBuilder(int index) { + return notificationSubscriptions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @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, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @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 < notificationSubscriptions_.size(); i++) { + output.writeMessage(1, notificationSubscriptions_.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 < notificationSubscriptions_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, notificationSubscriptions_.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.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse other = + (com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse) + obj; + + if (!getNotificationSubscriptionsList().equals(other.getNotificationSubscriptionsList())) + 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 (getNotificationSubscriptionsCount() > 0) { + hash = (37 * hash) + NOTIFICATION_SUBSCRIPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getNotificationSubscriptionsList().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.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the ListNotificationSubscription method.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse) + com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse.class, + com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (notificationSubscriptionsBuilder_ == null) { + notificationSubscriptions_ = java.util.Collections.emptyList(); + } else { + notificationSubscriptions_ = null; + notificationSubscriptionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsResponse_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + build() { + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + buildPartial() { + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + result = + new com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + result) { + if (notificationSubscriptionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + notificationSubscriptions_ = + java.util.Collections.unmodifiableList(notificationSubscriptions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.notificationSubscriptions_ = notificationSubscriptions_; + } else { + result.notificationSubscriptions_ = notificationSubscriptionsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + other) { + if (other + == com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + .getDefaultInstance()) return this; + if (notificationSubscriptionsBuilder_ == null) { + if (!other.notificationSubscriptions_.isEmpty()) { + if (notificationSubscriptions_.isEmpty()) { + notificationSubscriptions_ = other.notificationSubscriptions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNotificationSubscriptionsIsMutable(); + notificationSubscriptions_.addAll(other.notificationSubscriptions_); + } + onChanged(); + } + } else { + if (!other.notificationSubscriptions_.isEmpty()) { + if (notificationSubscriptionsBuilder_.isEmpty()) { + notificationSubscriptionsBuilder_.dispose(); + notificationSubscriptionsBuilder_ = null; + notificationSubscriptions_ = other.notificationSubscriptions_; + bitField0_ = (bitField0_ & ~0x00000001); + notificationSubscriptionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNotificationSubscriptionsFieldBuilder() + : null; + } else { + notificationSubscriptionsBuilder_.addAllMessages(other.notificationSubscriptions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription m = + input.readMessage( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .parser(), + extensionRegistry); + if (notificationSubscriptionsBuilder_ == null) { + ensureNotificationSubscriptionsIsMutable(); + notificationSubscriptions_.add(m); + } else { + notificationSubscriptionsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + notificationSubscriptions_ = java.util.Collections.emptyList(); + + private void ensureNotificationSubscriptionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + notificationSubscriptions_ = + new java.util.ArrayList< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription>( + notificationSubscriptions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder> + notificationSubscriptionsBuilder_; + + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public java.util.List< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + getNotificationSubscriptionsList() { + if (notificationSubscriptionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(notificationSubscriptions_); + } else { + return notificationSubscriptionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public int getNotificationSubscriptionsCount() { + if (notificationSubscriptionsBuilder_ == null) { + return notificationSubscriptions_.size(); + } else { + return notificationSubscriptionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + getNotificationSubscriptions(int index) { + if (notificationSubscriptionsBuilder_ == null) { + return notificationSubscriptions_.get(index); + } else { + return notificationSubscriptionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder setNotificationSubscriptions( + int index, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription value) { + if (notificationSubscriptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationSubscriptionsIsMutable(); + notificationSubscriptions_.set(index, value); + onChanged(); + } else { + notificationSubscriptionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder setNotificationSubscriptions( + int index, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder + builderForValue) { + if (notificationSubscriptionsBuilder_ == null) { + ensureNotificationSubscriptionsIsMutable(); + notificationSubscriptions_.set(index, builderForValue.build()); + onChanged(); + } else { + notificationSubscriptionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder addNotificationSubscriptions( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription value) { + if (notificationSubscriptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationSubscriptionsIsMutable(); + notificationSubscriptions_.add(value); + onChanged(); + } else { + notificationSubscriptionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder addNotificationSubscriptions( + int index, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription value) { + if (notificationSubscriptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationSubscriptionsIsMutable(); + notificationSubscriptions_.add(index, value); + onChanged(); + } else { + notificationSubscriptionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder addNotificationSubscriptions( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder + builderForValue) { + if (notificationSubscriptionsBuilder_ == null) { + ensureNotificationSubscriptionsIsMutable(); + notificationSubscriptions_.add(builderForValue.build()); + onChanged(); + } else { + notificationSubscriptionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder addNotificationSubscriptions( + int index, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder + builderForValue) { + if (notificationSubscriptionsBuilder_ == null) { + ensureNotificationSubscriptionsIsMutable(); + notificationSubscriptions_.add(index, builderForValue.build()); + onChanged(); + } else { + notificationSubscriptionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder addAllNotificationSubscriptions( + java.lang.Iterable< + ? extends + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription> + values) { + if (notificationSubscriptionsBuilder_ == null) { + ensureNotificationSubscriptionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, notificationSubscriptions_); + onChanged(); + } else { + notificationSubscriptionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder clearNotificationSubscriptions() { + if (notificationSubscriptionsBuilder_ == null) { + notificationSubscriptions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + notificationSubscriptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder removeNotificationSubscriptions(int index) { + if (notificationSubscriptionsBuilder_ == null) { + ensureNotificationSubscriptionsIsMutable(); + notificationSubscriptions_.remove(index); + onChanged(); + } else { + notificationSubscriptionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder + getNotificationSubscriptionsBuilder(int index) { + return getNotificationSubscriptionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder + getNotificationSubscriptionsOrBuilder(int index) { + if (notificationSubscriptionsBuilder_ == null) { + return notificationSubscriptions_.get(index); + } else { + return notificationSubscriptionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public java.util.List< + ? extends + com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder> + getNotificationSubscriptionsOrBuilderList() { + if (notificationSubscriptionsBuilder_ != null) { + return notificationSubscriptionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(notificationSubscriptions_); + } + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder + addNotificationSubscriptionsBuilder() { + return getNotificationSubscriptionsFieldBuilder() + .addBuilder( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance()); + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder + addNotificationSubscriptionsBuilder(int index) { + return getNotificationSubscriptionsFieldBuilder() + .addBuilder( + index, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance()); + } + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + public java.util.List< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder> + getNotificationSubscriptionsBuilderList() { + return getNotificationSubscriptionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder> + getNotificationSubscriptionsFieldBuilder() { + if (notificationSubscriptionsBuilder_ == null) { + notificationSubscriptionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1beta + .NotificationSubscriptionOrBuilder>( + notificationSubscriptions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + notificationSubscriptions_ = null; + } + return notificationSubscriptionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @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, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @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, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse) + private static final com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse(); + } + + public static com.google.shopping.merchant.notifications.v1beta + .ListNotificationSubscriptionsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNotificationSubscriptionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsResponseOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsResponseOrBuilder.java new file mode 100644 index 000000000000..1ee898b9e9f6 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ListNotificationSubscriptionsResponseOrBuilder.java @@ -0,0 +1,120 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +public interface ListNotificationSubscriptionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + java.util.List + getNotificationSubscriptionsList(); + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + getNotificationSubscriptions(int index); + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + int getNotificationSubscriptionsCount(); + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + java.util.List< + ? extends + com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder> + getNotificationSubscriptionsOrBuilderList(); + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * + */ + com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder + getNotificationSubscriptionsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationSubscription.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationSubscription.java new file mode 100644 index 000000000000..6dcbb8f96a0b --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationSubscription.java @@ -0,0 +1,1660 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +/** + * + * + *
+ * Represents a notification subscription owned by a Merchant account.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.notifications.v1beta.NotificationSubscription} + */ +public final class NotificationSubscription extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1beta.NotificationSubscription) + NotificationSubscriptionOrBuilder { + private static final long serialVersionUID = 0L; + // Use NotificationSubscription.newBuilder() to construct. + private NotificationSubscription(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NotificationSubscription() { + name_ = ""; + registeredEvent_ = 0; + callBackUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NotificationSubscription(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_NotificationSubscription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_NotificationSubscription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.class, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder + .class); + } + + /** + * + * + *
+   * Represents the event type that the merchant is interested in receiving
+   * notifications for.
+   * 
+ * + * Protobuf enum {@code + * google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType} + */ + public enum NotificationEventType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Notifications event type is unspecified.
+     * 
+ * + * NOTIFICATION_EVENT_TYPE_UNSPECIFIED = 0; + */ + NOTIFICATION_EVENT_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Notification of product status changes, for example when product becomes
+     * disapproved.
+     * 
+ * + * PRODUCT_STATUS_CHANGE = 1; + */ + PRODUCT_STATUS_CHANGE(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Notifications event type is unspecified.
+     * 
+ * + * NOTIFICATION_EVENT_TYPE_UNSPECIFIED = 0; + */ + public static final int NOTIFICATION_EVENT_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Notification of product status changes, for example when product becomes
+     * disapproved.
+     * 
+ * + * PRODUCT_STATUS_CHANGE = 1; + */ + public static final int PRODUCT_STATUS_CHANGE_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 NotificationEventType 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 NotificationEventType forNumber(int value) { + switch (value) { + case 0: + return NOTIFICATION_EVENT_TYPE_UNSPECIFIED; + case 1: + return PRODUCT_STATUS_CHANGE; + 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 NotificationEventType findValueByNumber(int number) { + return NotificationEventType.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.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final NotificationEventType[] VALUES = values(); + + public static NotificationEventType 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 NotificationEventType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType) + } + + private int interestedInCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object interestedIn_; + + public enum InterestedInCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ALL_MANAGED_ACCOUNTS(3), + TARGET_ACCOUNT(4), + INTERESTEDIN_NOT_SET(0); + private final int value; + + private InterestedInCase(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 InterestedInCase valueOf(int value) { + return forNumber(value); + } + + public static InterestedInCase forNumber(int value) { + switch (value) { + case 3: + return ALL_MANAGED_ACCOUNTS; + case 4: + return TARGET_ACCOUNT; + case 0: + return INTERESTEDIN_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public InterestedInCase getInterestedInCase() { + return InterestedInCase.forNumber(interestedInCase_); + } + + public static final int ALL_MANAGED_ACCOUNTS_FIELD_NUMBER = 3; + /** + * + * + *
+   * If this value is true, the requesting account is notified of the
+   * specified event for all managed accounts (can be subaccounts or other
+   * linked accounts) including newly added accounts on a daily basis.
+   * 
+ * + * bool all_managed_accounts = 3; + * + * @return Whether the allManagedAccounts field is set. + */ + @java.lang.Override + public boolean hasAllManagedAccounts() { + return interestedInCase_ == 3; + } + /** + * + * + *
+   * If this value is true, the requesting account is notified of the
+   * specified event for all managed accounts (can be subaccounts or other
+   * linked accounts) including newly added accounts on a daily basis.
+   * 
+ * + * bool all_managed_accounts = 3; + * + * @return The allManagedAccounts. + */ + @java.lang.Override + public boolean getAllManagedAccounts() { + if (interestedInCase_ == 3) { + return (java.lang.Boolean) interestedIn_; + } + return false; + } + + public static final int TARGET_ACCOUNT_FIELD_NUMBER = 4; + /** + * + * + *
+   * The `name` of the account you want to receive notifications for.
+   * Format: `accounts/{account}`
+   * 
+ * + * string target_account = 4; + * + * @return Whether the targetAccount field is set. + */ + public boolean hasTargetAccount() { + return interestedInCase_ == 4; + } + /** + * + * + *
+   * The `name` of the account you want to receive notifications for.
+   * Format: `accounts/{account}`
+   * 
+ * + * string target_account = 4; + * + * @return The targetAccount. + */ + public java.lang.String getTargetAccount() { + java.lang.Object ref = ""; + if (interestedInCase_ == 4) { + ref = interestedIn_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (interestedInCase_ == 4) { + interestedIn_ = s; + } + return s; + } + } + /** + * + * + *
+   * The `name` of the account you want to receive notifications for.
+   * Format: `accounts/{account}`
+   * 
+ * + * string target_account = 4; + * + * @return The bytes for targetAccount. + */ + public com.google.protobuf.ByteString getTargetAccountBytes() { + java.lang.Object ref = ""; + if (interestedInCase_ == 4) { + ref = interestedIn_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (interestedInCase_ == 4) { + interestedIn_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The `name` of the notification configuration. Generated by the
+   * Content API upon creation of a new `NotificationSubscription`. The
+   * `account` represents the merchant ID of the merchant that owns the
+   * configuration. Format:
+   * `accounts/{account}/notificationsubscriptions/{notification_subscription}`
+   * 
+ * + * 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 `name` of the notification configuration. Generated by the
+   * Content API upon creation of a new `NotificationSubscription`. The
+   * `account` represents the merchant ID of the merchant that owns the
+   * configuration. Format:
+   * `accounts/{account}/notificationsubscriptions/{notification_subscription}`
+   * 
+ * + * 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 REGISTERED_EVENT_FIELD_NUMBER = 2; + private int registeredEvent_ = 0; + /** + * + * + *
+   * The event that the merchant wants to be notified about.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType registered_event = 2; + * + * + * @return The enum numeric value on the wire for registeredEvent. + */ + @java.lang.Override + public int getRegisteredEventValue() { + return registeredEvent_; + } + /** + * + * + *
+   * The event that the merchant wants to be notified about.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType registered_event = 2; + * + * + * @return The registeredEvent. + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .NotificationEventType + getRegisteredEvent() { + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType + result = + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .NotificationEventType.forNumber(registeredEvent_); + return result == null + ? com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .NotificationEventType.UNRECOGNIZED + : result; + } + + public static final int CALL_BACK_URI_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object callBackUri_ = ""; + /** + * + * + *
+   * URL to be used to push the notification to the merchant.
+   * 
+ * + * string call_back_uri = 5; + * + * @return The callBackUri. + */ + @java.lang.Override + public java.lang.String getCallBackUri() { + java.lang.Object ref = callBackUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + callBackUri_ = s; + return s; + } + } + /** + * + * + *
+   * URL to be used to push the notification to the merchant.
+   * 
+ * + * string call_back_uri = 5; + * + * @return The bytes for callBackUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCallBackUriBytes() { + java.lang.Object ref = callBackUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + callBackUri_ = 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 (registeredEvent_ + != com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .NotificationEventType.NOTIFICATION_EVENT_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, registeredEvent_); + } + if (interestedInCase_ == 3) { + output.writeBool(3, (boolean) ((java.lang.Boolean) interestedIn_)); + } + if (interestedInCase_ == 4) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, interestedIn_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(callBackUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, callBackUri_); + } + 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 (registeredEvent_ + != com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .NotificationEventType.NOTIFICATION_EVENT_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, registeredEvent_); + } + if (interestedInCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 3, (boolean) ((java.lang.Boolean) interestedIn_)); + } + if (interestedInCase_ == 4) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, interestedIn_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(callBackUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, callBackUri_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.shopping.merchant.notifications.v1beta.NotificationSubscription)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription other = + (com.google.shopping.merchant.notifications.v1beta.NotificationSubscription) obj; + + if (!getName().equals(other.getName())) return false; + if (registeredEvent_ != other.registeredEvent_) return false; + if (!getCallBackUri().equals(other.getCallBackUri())) return false; + if (!getInterestedInCase().equals(other.getInterestedInCase())) return false; + switch (interestedInCase_) { + case 3: + if (getAllManagedAccounts() != other.getAllManagedAccounts()) return false; + break; + case 4: + if (!getTargetAccount().equals(other.getTargetAccount())) 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) + REGISTERED_EVENT_FIELD_NUMBER; + hash = (53 * hash) + registeredEvent_; + hash = (37 * hash) + CALL_BACK_URI_FIELD_NUMBER; + hash = (53 * hash) + getCallBackUri().hashCode(); + switch (interestedInCase_) { + case 3: + hash = (37 * hash) + ALL_MANAGED_ACCOUNTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllManagedAccounts()); + break; + case 4: + hash = (37 * hash) + TARGET_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getTargetAccount().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents a notification subscription owned by a Merchant account.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.notifications.v1beta.NotificationSubscription} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1beta.NotificationSubscription) + com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_NotificationSubscription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_NotificationSubscription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.class, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + registeredEvent_ = 0; + callBackUri_ = ""; + interestedInCase_ = 0; + interestedIn_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_NotificationSubscription_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription build() { + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + buildPartial() { + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription result = + new com.google.shopping.merchant.notifications.v1beta.NotificationSubscription(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.registeredEvent_ = registeredEvent_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.callBackUri_ = callBackUri_; + } + } + + private void buildPartialOneofs( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription result) { + result.interestedInCase_ = interestedInCase_; + result.interestedIn_ = this.interestedIn_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.shopping.merchant.notifications.v1beta.NotificationSubscription) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1beta.NotificationSubscription) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription other) { + if (other + == com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.registeredEvent_ != 0) { + setRegisteredEventValue(other.getRegisteredEventValue()); + } + if (!other.getCallBackUri().isEmpty()) { + callBackUri_ = other.callBackUri_; + bitField0_ |= 0x00000010; + onChanged(); + } + switch (other.getInterestedInCase()) { + case ALL_MANAGED_ACCOUNTS: + { + setAllManagedAccounts(other.getAllManagedAccounts()); + break; + } + case TARGET_ACCOUNT: + { + interestedInCase_ = 4; + interestedIn_ = other.interestedIn_; + onChanged(); + break; + } + case INTERESTEDIN_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 16: + { + registeredEvent_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 16 + case 24: + { + interestedIn_ = input.readBool(); + interestedInCase_ = 3; + break; + } // case 24 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + interestedInCase_ = 4; + interestedIn_ = s; + break; + } // case 34 + case 42: + { + callBackUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int interestedInCase_ = 0; + private java.lang.Object interestedIn_; + + public InterestedInCase getInterestedInCase() { + return InterestedInCase.forNumber(interestedInCase_); + } + + public Builder clearInterestedIn() { + interestedInCase_ = 0; + interestedIn_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * If this value is true, the requesting account is notified of the
+     * specified event for all managed accounts (can be subaccounts or other
+     * linked accounts) including newly added accounts on a daily basis.
+     * 
+ * + * bool all_managed_accounts = 3; + * + * @return Whether the allManagedAccounts field is set. + */ + public boolean hasAllManagedAccounts() { + return interestedInCase_ == 3; + } + /** + * + * + *
+     * If this value is true, the requesting account is notified of the
+     * specified event for all managed accounts (can be subaccounts or other
+     * linked accounts) including newly added accounts on a daily basis.
+     * 
+ * + * bool all_managed_accounts = 3; + * + * @return The allManagedAccounts. + */ + public boolean getAllManagedAccounts() { + if (interestedInCase_ == 3) { + return (java.lang.Boolean) interestedIn_; + } + return false; + } + /** + * + * + *
+     * If this value is true, the requesting account is notified of the
+     * specified event for all managed accounts (can be subaccounts or other
+     * linked accounts) including newly added accounts on a daily basis.
+     * 
+ * + * bool all_managed_accounts = 3; + * + * @param value The allManagedAccounts to set. + * @return This builder for chaining. + */ + public Builder setAllManagedAccounts(boolean value) { + + interestedInCase_ = 3; + interestedIn_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If this value is true, the requesting account is notified of the
+     * specified event for all managed accounts (can be subaccounts or other
+     * linked accounts) including newly added accounts on a daily basis.
+     * 
+ * + * bool all_managed_accounts = 3; + * + * @return This builder for chaining. + */ + public Builder clearAllManagedAccounts() { + if (interestedInCase_ == 3) { + interestedInCase_ = 0; + interestedIn_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The `name` of the account you want to receive notifications for.
+     * Format: `accounts/{account}`
+     * 
+ * + * string target_account = 4; + * + * @return Whether the targetAccount field is set. + */ + @java.lang.Override + public boolean hasTargetAccount() { + return interestedInCase_ == 4; + } + /** + * + * + *
+     * The `name` of the account you want to receive notifications for.
+     * Format: `accounts/{account}`
+     * 
+ * + * string target_account = 4; + * + * @return The targetAccount. + */ + @java.lang.Override + public java.lang.String getTargetAccount() { + java.lang.Object ref = ""; + if (interestedInCase_ == 4) { + ref = interestedIn_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (interestedInCase_ == 4) { + interestedIn_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The `name` of the account you want to receive notifications for.
+     * Format: `accounts/{account}`
+     * 
+ * + * string target_account = 4; + * + * @return The bytes for targetAccount. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetAccountBytes() { + java.lang.Object ref = ""; + if (interestedInCase_ == 4) { + ref = interestedIn_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (interestedInCase_ == 4) { + interestedIn_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The `name` of the account you want to receive notifications for.
+     * Format: `accounts/{account}`
+     * 
+ * + * string target_account = 4; + * + * @param value The targetAccount to set. + * @return This builder for chaining. + */ + public Builder setTargetAccount(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + interestedInCase_ = 4; + interestedIn_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The `name` of the account you want to receive notifications for.
+     * Format: `accounts/{account}`
+     * 
+ * + * string target_account = 4; + * + * @return This builder for chaining. + */ + public Builder clearTargetAccount() { + if (interestedInCase_ == 4) { + interestedInCase_ = 0; + interestedIn_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The `name` of the account you want to receive notifications for.
+     * Format: `accounts/{account}`
+     * 
+ * + * string target_account = 4; + * + * @param value The bytes for targetAccount to set. + * @return This builder for chaining. + */ + public Builder setTargetAccountBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + interestedInCase_ = 4; + interestedIn_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The `name` of the notification configuration. Generated by the
+     * Content API upon creation of a new `NotificationSubscription`. The
+     * `account` represents the merchant ID of the merchant that owns the
+     * configuration. Format:
+     * `accounts/{account}/notificationsubscriptions/{notification_subscription}`
+     * 
+ * + * 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 `name` of the notification configuration. Generated by the
+     * Content API upon creation of a new `NotificationSubscription`. The
+     * `account` represents the merchant ID of the merchant that owns the
+     * configuration. Format:
+     * `accounts/{account}/notificationsubscriptions/{notification_subscription}`
+     * 
+ * + * 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 `name` of the notification configuration. Generated by the
+     * Content API upon creation of a new `NotificationSubscription`. The
+     * `account` represents the merchant ID of the merchant that owns the
+     * configuration. Format:
+     * `accounts/{account}/notificationsubscriptions/{notification_subscription}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The `name` of the notification configuration. Generated by the
+     * Content API upon creation of a new `NotificationSubscription`. The
+     * `account` represents the merchant ID of the merchant that owns the
+     * configuration. Format:
+     * `accounts/{account}/notificationsubscriptions/{notification_subscription}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The `name` of the notification configuration. Generated by the
+     * Content API upon creation of a new `NotificationSubscription`. The
+     * `account` represents the merchant ID of the merchant that owns the
+     * configuration. Format:
+     * `accounts/{account}/notificationsubscriptions/{notification_subscription}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int registeredEvent_ = 0; + /** + * + * + *
+     * The event that the merchant wants to be notified about.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType registered_event = 2; + * + * + * @return The enum numeric value on the wire for registeredEvent. + */ + @java.lang.Override + public int getRegisteredEventValue() { + return registeredEvent_; + } + /** + * + * + *
+     * The event that the merchant wants to be notified about.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType registered_event = 2; + * + * + * @param value The enum numeric value on the wire for registeredEvent to set. + * @return This builder for chaining. + */ + public Builder setRegisteredEventValue(int value) { + registeredEvent_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The event that the merchant wants to be notified about.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType registered_event = 2; + * + * + * @return The registeredEvent. + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .NotificationEventType + getRegisteredEvent() { + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .NotificationEventType + result = + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .NotificationEventType.forNumber(registeredEvent_); + return result == null + ? com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .NotificationEventType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The event that the merchant wants to be notified about.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType registered_event = 2; + * + * + * @param value The registeredEvent to set. + * @return This builder for chaining. + */ + public Builder setRegisteredEvent( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .NotificationEventType + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + registeredEvent_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The event that the merchant wants to be notified about.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType registered_event = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearRegisteredEvent() { + bitField0_ = (bitField0_ & ~0x00000008); + registeredEvent_ = 0; + onChanged(); + return this; + } + + private java.lang.Object callBackUri_ = ""; + /** + * + * + *
+     * URL to be used to push the notification to the merchant.
+     * 
+ * + * string call_back_uri = 5; + * + * @return The callBackUri. + */ + public java.lang.String getCallBackUri() { + java.lang.Object ref = callBackUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + callBackUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * URL to be used to push the notification to the merchant.
+     * 
+ * + * string call_back_uri = 5; + * + * @return The bytes for callBackUri. + */ + public com.google.protobuf.ByteString getCallBackUriBytes() { + java.lang.Object ref = callBackUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + callBackUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * URL to be used to push the notification to the merchant.
+     * 
+ * + * string call_back_uri = 5; + * + * @param value The callBackUri to set. + * @return This builder for chaining. + */ + public Builder setCallBackUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + callBackUri_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * URL to be used to push the notification to the merchant.
+     * 
+ * + * string call_back_uri = 5; + * + * @return This builder for chaining. + */ + public Builder clearCallBackUri() { + callBackUri_ = getDefaultInstance().getCallBackUri(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * URL to be used to push the notification to the merchant.
+     * 
+ * + * string call_back_uri = 5; + * + * @param value The bytes for callBackUri to set. + * @return This builder for chaining. + */ + public Builder setCallBackUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + callBackUri_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.notifications.v1beta.NotificationSubscription) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1beta.NotificationSubscription) + private static final com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1beta.NotificationSubscription(); + } + + public static com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NotificationSubscription parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationSubscriptionName.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationSubscriptionName.java new file mode 100644 index 000000000000..83fba705b64f --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationSubscriptionName.java @@ -0,0 +1,202 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta; + +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 NotificationSubscriptionName implements ResourceName { + private static final PathTemplate ACCOUNT_NOTIFICATION_SUBSCRIPTION = + PathTemplate.createWithoutUrlEncoding( + "accounts/{account}/notificationsubscriptions/{notification_subscription}"); + private volatile Map fieldValuesMap; + private final String account; + private final String notificationSubscription; + + @Deprecated + protected NotificationSubscriptionName() { + account = null; + notificationSubscription = null; + } + + private NotificationSubscriptionName(Builder builder) { + account = Preconditions.checkNotNull(builder.getAccount()); + notificationSubscription = Preconditions.checkNotNull(builder.getNotificationSubscription()); + } + + public String getAccount() { + return account; + } + + public String getNotificationSubscription() { + return notificationSubscription; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static NotificationSubscriptionName of(String account, String notificationSubscription) { + return newBuilder() + .setAccount(account) + .setNotificationSubscription(notificationSubscription) + .build(); + } + + public static String format(String account, String notificationSubscription) { + return newBuilder() + .setAccount(account) + .setNotificationSubscription(notificationSubscription) + .build() + .toString(); + } + + public static NotificationSubscriptionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT_NOTIFICATION_SUBSCRIPTION.validatedMatch( + formattedString, + "NotificationSubscriptionName.parse: formattedString not in valid format"); + return of(matchMap.get("account"), matchMap.get("notification_subscription")); + } + + 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 (NotificationSubscriptionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ACCOUNT_NOTIFICATION_SUBSCRIPTION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (account != null) { + fieldMapBuilder.put("account", account); + } + if (notificationSubscription != null) { + fieldMapBuilder.put("notification_subscription", notificationSubscription); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ACCOUNT_NOTIFICATION_SUBSCRIPTION.instantiate( + "account", account, "notification_subscription", notificationSubscription); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + NotificationSubscriptionName that = ((NotificationSubscriptionName) o); + return Objects.equals(this.account, that.account) + && Objects.equals(this.notificationSubscription, that.notificationSubscription); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(account); + h *= 1000003; + h ^= Objects.hashCode(notificationSubscription); + return h; + } + + /** Builder for accounts/{account}/notificationsubscriptions/{notification_subscription}. */ + public static class Builder { + private String account; + private String notificationSubscription; + + protected Builder() {} + + public String getAccount() { + return account; + } + + public String getNotificationSubscription() { + return notificationSubscription; + } + + public Builder setAccount(String account) { + this.account = account; + return this; + } + + public Builder setNotificationSubscription(String notificationSubscription) { + this.notificationSubscription = notificationSubscription; + return this; + } + + private Builder(NotificationSubscriptionName notificationSubscriptionName) { + this.account = notificationSubscriptionName.account; + this.notificationSubscription = notificationSubscriptionName.notificationSubscription; + } + + public NotificationSubscriptionName build() { + return new NotificationSubscriptionName(this); + } + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationSubscriptionOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationSubscriptionOrBuilder.java new file mode 100644 index 000000000000..1639b9e01c8a --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationSubscriptionOrBuilder.java @@ -0,0 +1,186 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +public interface NotificationSubscriptionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1beta.NotificationSubscription) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If this value is true, the requesting account is notified of the
+   * specified event for all managed accounts (can be subaccounts or other
+   * linked accounts) including newly added accounts on a daily basis.
+   * 
+ * + * bool all_managed_accounts = 3; + * + * @return Whether the allManagedAccounts field is set. + */ + boolean hasAllManagedAccounts(); + /** + * + * + *
+   * If this value is true, the requesting account is notified of the
+   * specified event for all managed accounts (can be subaccounts or other
+   * linked accounts) including newly added accounts on a daily basis.
+   * 
+ * + * bool all_managed_accounts = 3; + * + * @return The allManagedAccounts. + */ + boolean getAllManagedAccounts(); + + /** + * + * + *
+   * The `name` of the account you want to receive notifications for.
+   * Format: `accounts/{account}`
+   * 
+ * + * string target_account = 4; + * + * @return Whether the targetAccount field is set. + */ + boolean hasTargetAccount(); + /** + * + * + *
+   * The `name` of the account you want to receive notifications for.
+   * Format: `accounts/{account}`
+   * 
+ * + * string target_account = 4; + * + * @return The targetAccount. + */ + java.lang.String getTargetAccount(); + /** + * + * + *
+   * The `name` of the account you want to receive notifications for.
+   * Format: `accounts/{account}`
+   * 
+ * + * string target_account = 4; + * + * @return The bytes for targetAccount. + */ + com.google.protobuf.ByteString getTargetAccountBytes(); + + /** + * + * + *
+   * Output only. The `name` of the notification configuration. Generated by the
+   * Content API upon creation of a new `NotificationSubscription`. The
+   * `account` represents the merchant ID of the merchant that owns the
+   * configuration. Format:
+   * `accounts/{account}/notificationsubscriptions/{notification_subscription}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The `name` of the notification configuration. Generated by the
+   * Content API upon creation of a new `NotificationSubscription`. The
+   * `account` represents the merchant ID of the merchant that owns the
+   * configuration. Format:
+   * `accounts/{account}/notificationsubscriptions/{notification_subscription}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The event that the merchant wants to be notified about.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType registered_event = 2; + * + * + * @return The enum numeric value on the wire for registeredEvent. + */ + int getRegisteredEventValue(); + /** + * + * + *
+   * The event that the merchant wants to be notified about.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType registered_event = 2; + * + * + * @return The registeredEvent. + */ + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType + getRegisteredEvent(); + + /** + * + * + *
+   * URL to be used to push the notification to the merchant.
+   * 
+ * + * string call_back_uri = 5; + * + * @return The callBackUri. + */ + java.lang.String getCallBackUri(); + /** + * + * + *
+   * URL to be used to push the notification to the merchant.
+   * 
+ * + * string call_back_uri = 5; + * + * @return The bytes for callBackUri. + */ + com.google.protobuf.ByteString getCallBackUriBytes(); + + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.InterestedInCase + getInterestedInCase(); +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiProto.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiProto.java new file mode 100644 index 000000000000..82c0ee00a6bb --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiProto.java @@ -0,0 +1,306 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +public final class NotificationsApiProto { + private NotificationsApiProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1beta_GetNotificationSubscriptionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1beta_GetNotificationSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1beta_CreateNotificationSubscriptionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1beta_CreateNotificationSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1beta_UpdateNotificationSubscriptionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1beta_UpdateNotificationSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1beta_DeleteNotificationSubscriptionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1beta_DeleteNotificationSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1beta_NotificationSubscription_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1beta_NotificationSubscription_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1beta_ProductChange_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1beta_ProductChange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1beta_ProductStatusChangeMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1beta_ProductStatusChangeMessage_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nDgoogle/shopping/merchant/notifications" + + "/v1beta/notificationsapi.proto\022-google.s" + + "hopping.merchant.notifications.v1beta\032\034g" + + "oogle/api/annotations.proto\032\027google/api/" + + "client.proto\032\037google/api/field_behavior." + + "proto\032\031google/api/resource.proto\032\033google" + + "/protobuf/empty.proto\032 google/protobuf/f" + + "ield_mask.proto\032 google/shopping/type/ty" + + "pes.proto\"o\n\"GetNotificationSubscription" + + "Request\022I\n\004name\030\001 \001(\tB;\340A\002\372A5\n3merchanta" + + "pi.googleapis.com/NotificationSubscripti" + + "on\"\345\001\n%CreateNotificationSubscriptionReq" + + "uest\022K\n\006parent\030\001 \001(\tB;\340A\002\372A5\0223merchantap" + + "i.googleapis.com/NotificationSubscriptio" + + "n\022o\n\031notification_subscription\030\002 \001(\0132G.g" + + "oogle.shopping.merchant.notifications.v1" + + "beta.NotificationSubscriptionB\003\340A\002\"\311\001\n%U" + + "pdateNotificationSubscriptionRequest\022o\n\031" + + "notification_subscription\030\001 \001(\0132G.google" + + ".shopping.merchant.notifications.v1beta." + + "NotificationSubscriptionB\003\340A\002\022/\n\013update_" + + "mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"r" + + "\n%DeleteNotificationSubscriptionRequest\022" + + "I\n\004name\030\001 \001(\tB;\340A\002\372A5\n3merchantapi.googl" + + "eapis.com/NotificationSubscription\"\232\001\n$L" + + "istNotificationSubscriptionsRequest\022K\n\006p" + + "arent\030\001 \001(\tB;\340A\002\372A5\0223merchantapi.googlea" + + "pis.com/NotificationSubscription\022\021\n\tpage" + + "_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\255\001\n%List" + + "NotificationSubscriptionsResponse\022k\n\032not" + + "ification_subscriptions\030\001 \003(\0132G.google.s" + + "hopping.merchant.notifications.v1beta.No" + + "tificationSubscription\022\027\n\017next_page_toke" + + "n\030\002 \001(\t\"\352\003\n\030NotificationSubscription\022\036\n\024" + + "all_managed_accounts\030\003 \001(\010H\000\022\030\n\016target_a" + + "ccount\030\004 \001(\tH\000\022\021\n\004name\030\001 \001(\tB\003\340A\003\022w\n\020reg" + + "istered_event\030\002 \001(\0162].google.shopping.me" + + "rchant.notifications.v1beta.Notification" + + "Subscription.NotificationEventType\022\025\n\rca" + + "ll_back_uri\030\005 \001(\t\"[\n\025NotificationEventTy" + + "pe\022\'\n#NOTIFICATION_EVENT_TYPE_UNSPECIFIE" + + "D\020\000\022\031\n\025PRODUCT_STATUS_CHANGE\020\001:\202\001\352A\177\n3me" + + "rchantapi.googleapis.com/NotificationSub" + + "scription\022Haccounts/{account}/notificati" + + "onsubscriptions/{notification_subscripti" + + "on}B\017\n\rinterested_in\"\370\001\n\rProductChange\022\026" + + "\n\told_value\030\001 \001(\tH\000\210\001\001\022\026\n\tnew_value\030\002 \001(" + + "\tH\001\210\001\001\022\030\n\013region_code\030\003 \001(\tH\002\210\001\001\022[\n\021repo" + + "rting_context\030\004 \001(\0162;.google.shopping.ty" + + "pe.ReportingContext.ReportingContextEnum" + + "H\003\210\001\001B\014\n\n_old_valueB\014\n\n_new_valueB\016\n\014_re" + + "gion_codeB\024\n\022_reporting_context\"\326\003\n\032Prod" + + "uctStatusChangeMessage\022\024\n\007account\030\001 \001(\tH" + + "\000\210\001\001\022\035\n\020managing_account\030\002 \001(\tH\001\210\001\001\022S\n\rr" + + "esource_type\030\003 \001(\01627.google.shopping.mer" + + "chant.notifications.v1beta.ResourceH\002\210\001\001" + + "\022P\n\tattribute\030\004 \001(\01628.google.shopping.me" + + "rchant.notifications.v1beta.AttributeH\003\210" + + "\001\001\022M\n\007changes\030\005 \003(\0132<.google.shopping.me" + + "rchant.notifications.v1beta.ProductChang" + + "e\022\030\n\013resource_id\030\006 \001(\tH\004\210\001\001\022\025\n\010resource\030" + + "\007 \001(\tH\005\210\001\001B\n\n\010_accountB\023\n\021_managing_acco" + + "untB\020\n\016_resource_typeB\014\n\n_attributeB\016\n\014_" + + "resource_idB\013\n\t_resource*1\n\010Resource\022\030\n\024" + + "RESOURCE_UNSPECIFIED\020\000\022\013\n\007PRODUCT\020\001*2\n\tA" + + "ttribute\022\031\n\025ATTRIBUTE_UNSPECIFIED\020\000\022\n\n\006S" + + "TATUS\020\0012\265\014\n\027NotificationsApiService\022\215\002\n\033" + + "GetNotificationSubscription\022Q.google.sho" + + "pping.merchant.notifications.v1beta.GetN" + + "otificationSubscriptionRequest\032G.google." + + "shopping.merchant.notifications.v1beta.N" + + "otificationSubscription\"R\332A\004name\202\323\344\223\002E\022C" + + "/notifications/v1beta/{name=accounts/*/n" + + "otificationsubscriptions/*}\022\313\002\n\036CreateNo" + + "tificationSubscription\022T.google.shopping" + + ".merchant.notifications.v1beta.CreateNot" + + "ificationSubscriptionRequest\032G.google.sh" + + "opping.merchant.notifications.v1beta.Not" + + "ificationSubscription\"\211\001\332A parent,notifi" + + "cation_subscription\202\323\344\223\002`\"C/notification" + + "s/v1beta/{parent=accounts/*}/notificatio" + + "nsubscriptions:\031notification_subscriptio" + + "n\022\352\002\n\036UpdateNotificationSubscription\022T.g" + + "oogle.shopping.merchant.notifications.v1" + + "beta.UpdateNotificationSubscriptionReque" + + "st\032G.google.shopping.merchant.notificati" + + "ons.v1beta.NotificationSubscription\"\250\001\332A" + + "%notification_subscription,update_mask\202\323" + + "\344\223\002z2]/notifications/v1beta/{notificatio" + + "n_subscription.name=accounts/*/notificat" + + "ionsubscriptions/*}:\031notification_subscr" + + "iption\022\342\001\n\036DeleteNotificationSubscriptio" + + "n\022T.google.shopping.merchant.notificatio" + + "ns.v1beta.DeleteNotificationSubscription" + + "Request\032\026.google.protobuf.Empty\"R\332A\004name" + + "\202\323\344\223\002E*C/notifications/v1beta/{name=acco" + + "unts/*/notificationsubscriptions/*}\022\240\002\n\035" + + "ListNotificationSubscriptions\022S.google.s" + + "hopping.merchant.notifications.v1beta.Li" + + "stNotificationSubscriptionsRequest\032T.goo" + + "gle.shopping.merchant.notifications.v1be" + + "ta.ListNotificationSubscriptionsResponse" + + "\"T\332A\006parent\202\323\344\223\002E\022C/notifications/v1beta" + + "/{parent=accounts/*}/notificationsubscri" + + "ptions\032G\312A\032merchantapi.googleapis.com\322A\'" + + "https://www.googleapis.com/auth/contentB" + + "\346\001\n1com.google.shopping.merchant.notific" + + "ations.v1betaB\025NotificationsApiProtoP\001Z]" + + "cloud.google.com/go/shopping/merchant/no" + + "tifications/apiv1beta/notificationspb;no" + + "tificationspb\352A8\n\"merchantapi.googleapis" + + ".com/Account\022\022accounts/{account}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.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.shopping.type.TypesProto.getDescriptor(), + }); + internal_static_google_shopping_merchant_notifications_v1beta_GetNotificationSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_merchant_notifications_v1beta_GetNotificationSubscriptionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1beta_GetNotificationSubscriptionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_merchant_notifications_v1beta_CreateNotificationSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_merchant_notifications_v1beta_CreateNotificationSubscriptionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1beta_CreateNotificationSubscriptionRequest_descriptor, + new java.lang.String[] { + "Parent", "NotificationSubscription", + }); + internal_static_google_shopping_merchant_notifications_v1beta_UpdateNotificationSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_merchant_notifications_v1beta_UpdateNotificationSubscriptionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1beta_UpdateNotificationSubscriptionRequest_descriptor, + new java.lang.String[] { + "NotificationSubscription", "UpdateMask", + }); + internal_static_google_shopping_merchant_notifications_v1beta_DeleteNotificationSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_merchant_notifications_v1beta_DeleteNotificationSubscriptionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1beta_DeleteNotificationSubscriptionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1beta_ListNotificationSubscriptionsResponse_descriptor, + new java.lang.String[] { + "NotificationSubscriptions", "NextPageToken", + }); + internal_static_google_shopping_merchant_notifications_v1beta_NotificationSubscription_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_shopping_merchant_notifications_v1beta_NotificationSubscription_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1beta_NotificationSubscription_descriptor, + new java.lang.String[] { + "AllManagedAccounts", + "TargetAccount", + "Name", + "RegisteredEvent", + "CallBackUri", + "InterestedIn", + }); + internal_static_google_shopping_merchant_notifications_v1beta_ProductChange_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_shopping_merchant_notifications_v1beta_ProductChange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1beta_ProductChange_descriptor, + new java.lang.String[] { + "OldValue", "NewValue", "RegionCode", "ReportingContext", + }); + internal_static_google_shopping_merchant_notifications_v1beta_ProductStatusChangeMessage_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_shopping_merchant_notifications_v1beta_ProductStatusChangeMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1beta_ProductStatusChangeMessage_descriptor, + new java.lang.String[] { + "Account", + "ManagingAccount", + "ResourceType", + "Attribute", + "Changes", + "ResourceId", + "Resource", + }); + 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.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.shopping.type.TypesProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductChange.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductChange.java new file mode 100644 index 000000000000..496265299a34 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductChange.java @@ -0,0 +1,1315 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +/** + * + * + *
+ * The change that happened to the product including old value, new value,
+ * country code as the region code and reporting context.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.notifications.v1beta.ProductChange} + */ +public final class ProductChange extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1beta.ProductChange) + ProductChangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductChange.newBuilder() to construct. + private ProductChange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductChange() { + oldValue_ = ""; + newValue_ = ""; + regionCode_ = ""; + reportingContext_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductChange(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ProductChange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ProductChange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.ProductChange.class, + com.google.shopping.merchant.notifications.v1beta.ProductChange.Builder.class); + } + + private int bitField0_; + public static final int OLD_VALUE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object oldValue_ = ""; + /** + * + * + *
+   * The old value of the changed resource or attribute.
+   * 
+ * + * optional string old_value = 1; + * + * @return Whether the oldValue field is set. + */ + @java.lang.Override + public boolean hasOldValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The old value of the changed resource or attribute.
+   * 
+ * + * optional string old_value = 1; + * + * @return The oldValue. + */ + @java.lang.Override + public java.lang.String getOldValue() { + java.lang.Object ref = oldValue_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + oldValue_ = s; + return s; + } + } + /** + * + * + *
+   * The old value of the changed resource or attribute.
+   * 
+ * + * optional string old_value = 1; + * + * @return The bytes for oldValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOldValueBytes() { + java.lang.Object ref = oldValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + oldValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEW_VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object newValue_ = ""; + /** + * + * + *
+   * The new value of the changed resource or attribute.
+   * 
+ * + * optional string new_value = 2; + * + * @return Whether the newValue field is set. + */ + @java.lang.Override + public boolean hasNewValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The new value of the changed resource or attribute.
+   * 
+ * + * optional string new_value = 2; + * + * @return The newValue. + */ + @java.lang.Override + public java.lang.String getNewValue() { + java.lang.Object ref = newValue_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + newValue_ = s; + return s; + } + } + /** + * + * + *
+   * The new value of the changed resource or attribute.
+   * 
+ * + * optional string new_value = 2; + * + * @return The bytes for newValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNewValueBytes() { + java.lang.Object ref = newValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + newValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REGION_CODE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object regionCode_ = ""; + /** + * + * + *
+   * Countries that have the change (if applicable)
+   * 
+ * + * optional string region_code = 3; + * + * @return Whether the regionCode field is set. + */ + @java.lang.Override + public boolean hasRegionCode() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Countries that have the change (if applicable)
+   * 
+ * + * optional string region_code = 3; + * + * @return The regionCode. + */ + @java.lang.Override + public java.lang.String getRegionCode() { + java.lang.Object ref = regionCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + regionCode_ = s; + return s; + } + } + /** + * + * + *
+   * Countries that have the change (if applicable)
+   * 
+ * + * optional string region_code = 3; + * + * @return The bytes for regionCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionCodeBytes() { + java.lang.Object ref = regionCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + regionCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPORTING_CONTEXT_FIELD_NUMBER = 4; + private int reportingContext_ = 0; + /** + * + * + *
+   * Reporting contexts that have the change (if applicable)
+   * 
+ * + * + * optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * + * + * @return Whether the reportingContext field is set. + */ + @java.lang.Override + public boolean hasReportingContext() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Reporting contexts that have the change (if applicable)
+   * 
+ * + * + * optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * + * + * @return The enum numeric value on the wire for reportingContext. + */ + @java.lang.Override + public int getReportingContextValue() { + return reportingContext_; + } + /** + * + * + *
+   * Reporting contexts that have the change (if applicable)
+   * 
+ * + * + * optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * + * + * @return The reportingContext. + */ + @java.lang.Override + public com.google.shopping.type.ReportingContext.ReportingContextEnum getReportingContext() { + com.google.shopping.type.ReportingContext.ReportingContextEnum result = + com.google.shopping.type.ReportingContext.ReportingContextEnum.forNumber(reportingContext_); + return result == null + ? com.google.shopping.type.ReportingContext.ReportingContextEnum.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, oldValue_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, newValue_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, regionCode_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeEnum(4, reportingContext_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, oldValue_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, newValue_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, regionCode_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, reportingContext_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.shopping.merchant.notifications.v1beta.ProductChange)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1beta.ProductChange other = + (com.google.shopping.merchant.notifications.v1beta.ProductChange) obj; + + if (hasOldValue() != other.hasOldValue()) return false; + if (hasOldValue()) { + if (!getOldValue().equals(other.getOldValue())) return false; + } + if (hasNewValue() != other.hasNewValue()) return false; + if (hasNewValue()) { + if (!getNewValue().equals(other.getNewValue())) return false; + } + if (hasRegionCode() != other.hasRegionCode()) return false; + if (hasRegionCode()) { + if (!getRegionCode().equals(other.getRegionCode())) return false; + } + if (hasReportingContext() != other.hasReportingContext()) return false; + if (hasReportingContext()) { + if (reportingContext_ != other.reportingContext_) return false; + } + if (!getUnknownFields().equals(other.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 (hasOldValue()) { + hash = (37 * hash) + OLD_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getOldValue().hashCode(); + } + if (hasNewValue()) { + hash = (37 * hash) + NEW_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getNewValue().hashCode(); + } + if (hasRegionCode()) { + hash = (37 * hash) + REGION_CODE_FIELD_NUMBER; + hash = (53 * hash) + getRegionCode().hashCode(); + } + if (hasReportingContext()) { + hash = (37 * hash) + REPORTING_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + reportingContext_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductChange parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductChange parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductChange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductChange parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductChange parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductChange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductChange parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductChange parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductChange parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductChange parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductChange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductChange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.notifications.v1beta.ProductChange prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The change that happened to the product including old value, new value,
+   * country code as the region code and reporting context.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.notifications.v1beta.ProductChange} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1beta.ProductChange) + com.google.shopping.merchant.notifications.v1beta.ProductChangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ProductChange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ProductChange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.ProductChange.class, + com.google.shopping.merchant.notifications.v1beta.ProductChange.Builder.class); + } + + // Construct using com.google.shopping.merchant.notifications.v1beta.ProductChange.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + oldValue_ = ""; + newValue_ = ""; + regionCode_ = ""; + reportingContext_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ProductChange_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ProductChange + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1beta.ProductChange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ProductChange build() { + com.google.shopping.merchant.notifications.v1beta.ProductChange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ProductChange buildPartial() { + com.google.shopping.merchant.notifications.v1beta.ProductChange result = + new com.google.shopping.merchant.notifications.v1beta.ProductChange(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1beta.ProductChange result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.oldValue_ = oldValue_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.newValue_ = newValue_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.regionCode_ = regionCode_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.reportingContext_ = reportingContext_; + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.merchant.notifications.v1beta.ProductChange) { + return mergeFrom((com.google.shopping.merchant.notifications.v1beta.ProductChange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1beta.ProductChange other) { + if (other + == com.google.shopping.merchant.notifications.v1beta.ProductChange.getDefaultInstance()) + return this; + if (other.hasOldValue()) { + oldValue_ = other.oldValue_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasNewValue()) { + newValue_ = other.newValue_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasRegionCode()) { + regionCode_ = other.regionCode_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasReportingContext()) { + setReportingContext(other.getReportingContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + oldValue_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + newValue_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + regionCode_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + reportingContext_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object oldValue_ = ""; + /** + * + * + *
+     * The old value of the changed resource or attribute.
+     * 
+ * + * optional string old_value = 1; + * + * @return Whether the oldValue field is set. + */ + public boolean hasOldValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The old value of the changed resource or attribute.
+     * 
+ * + * optional string old_value = 1; + * + * @return The oldValue. + */ + public java.lang.String getOldValue() { + java.lang.Object ref = oldValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + oldValue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The old value of the changed resource or attribute.
+     * 
+ * + * optional string old_value = 1; + * + * @return The bytes for oldValue. + */ + public com.google.protobuf.ByteString getOldValueBytes() { + java.lang.Object ref = oldValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + oldValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The old value of the changed resource or attribute.
+     * 
+ * + * optional string old_value = 1; + * + * @param value The oldValue to set. + * @return This builder for chaining. + */ + public Builder setOldValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + oldValue_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The old value of the changed resource or attribute.
+     * 
+ * + * optional string old_value = 1; + * + * @return This builder for chaining. + */ + public Builder clearOldValue() { + oldValue_ = getDefaultInstance().getOldValue(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The old value of the changed resource or attribute.
+     * 
+ * + * optional string old_value = 1; + * + * @param value The bytes for oldValue to set. + * @return This builder for chaining. + */ + public Builder setOldValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + oldValue_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object newValue_ = ""; + /** + * + * + *
+     * The new value of the changed resource or attribute.
+     * 
+ * + * optional string new_value = 2; + * + * @return Whether the newValue field is set. + */ + public boolean hasNewValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The new value of the changed resource or attribute.
+     * 
+ * + * optional string new_value = 2; + * + * @return The newValue. + */ + public java.lang.String getNewValue() { + java.lang.Object ref = newValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + newValue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The new value of the changed resource or attribute.
+     * 
+ * + * optional string new_value = 2; + * + * @return The bytes for newValue. + */ + public com.google.protobuf.ByteString getNewValueBytes() { + java.lang.Object ref = newValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + newValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The new value of the changed resource or attribute.
+     * 
+ * + * optional string new_value = 2; + * + * @param value The newValue to set. + * @return This builder for chaining. + */ + public Builder setNewValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + newValue_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The new value of the changed resource or attribute.
+     * 
+ * + * optional string new_value = 2; + * + * @return This builder for chaining. + */ + public Builder clearNewValue() { + newValue_ = getDefaultInstance().getNewValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The new value of the changed resource or attribute.
+     * 
+ * + * optional string new_value = 2; + * + * @param value The bytes for newValue to set. + * @return This builder for chaining. + */ + public Builder setNewValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + newValue_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object regionCode_ = ""; + /** + * + * + *
+     * Countries that have the change (if applicable)
+     * 
+ * + * optional string region_code = 3; + * + * @return Whether the regionCode field is set. + */ + public boolean hasRegionCode() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Countries that have the change (if applicable)
+     * 
+ * + * optional string region_code = 3; + * + * @return The regionCode. + */ + public java.lang.String getRegionCode() { + java.lang.Object ref = regionCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + regionCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Countries that have the change (if applicable)
+     * 
+ * + * optional string region_code = 3; + * + * @return The bytes for regionCode. + */ + public com.google.protobuf.ByteString getRegionCodeBytes() { + java.lang.Object ref = regionCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + regionCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Countries that have the change (if applicable)
+     * 
+ * + * optional string region_code = 3; + * + * @param value The regionCode to set. + * @return This builder for chaining. + */ + public Builder setRegionCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + regionCode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Countries that have the change (if applicable)
+     * 
+ * + * optional string region_code = 3; + * + * @return This builder for chaining. + */ + public Builder clearRegionCode() { + regionCode_ = getDefaultInstance().getRegionCode(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Countries that have the change (if applicable)
+     * 
+ * + * optional string region_code = 3; + * + * @param value The bytes for regionCode to set. + * @return This builder for chaining. + */ + public Builder setRegionCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + regionCode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int reportingContext_ = 0; + /** + * + * + *
+     * Reporting contexts that have the change (if applicable)
+     * 
+ * + * + * optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * + * + * @return Whether the reportingContext field is set. + */ + @java.lang.Override + public boolean hasReportingContext() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Reporting contexts that have the change (if applicable)
+     * 
+ * + * + * optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * + * + * @return The enum numeric value on the wire for reportingContext. + */ + @java.lang.Override + public int getReportingContextValue() { + return reportingContext_; + } + /** + * + * + *
+     * Reporting contexts that have the change (if applicable)
+     * 
+ * + * + * optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * + * + * @param value The enum numeric value on the wire for reportingContext to set. + * @return This builder for chaining. + */ + public Builder setReportingContextValue(int value) { + reportingContext_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Reporting contexts that have the change (if applicable)
+     * 
+ * + * + * optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * + * + * @return The reportingContext. + */ + @java.lang.Override + public com.google.shopping.type.ReportingContext.ReportingContextEnum getReportingContext() { + com.google.shopping.type.ReportingContext.ReportingContextEnum result = + com.google.shopping.type.ReportingContext.ReportingContextEnum.forNumber( + reportingContext_); + return result == null + ? com.google.shopping.type.ReportingContext.ReportingContextEnum.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Reporting contexts that have the change (if applicable)
+     * 
+ * + * + * optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * + * + * @param value The reportingContext to set. + * @return This builder for chaining. + */ + public Builder setReportingContext( + com.google.shopping.type.ReportingContext.ReportingContextEnum value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + reportingContext_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Reporting contexts that have the change (if applicable)
+     * 
+ * + * + * optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * + * + * @return This builder for chaining. + */ + public Builder clearReportingContext() { + bitField0_ = (bitField0_ & ~0x00000008); + reportingContext_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.notifications.v1beta.ProductChange) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1beta.ProductChange) + private static final com.google.shopping.merchant.notifications.v1beta.ProductChange + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.notifications.v1beta.ProductChange(); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductChange + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductChange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ProductChange + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductChangeOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductChangeOrBuilder.java new file mode 100644 index 000000000000..edb8cff346e0 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductChangeOrBuilder.java @@ -0,0 +1,180 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +public interface ProductChangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1beta.ProductChange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The old value of the changed resource or attribute.
+   * 
+ * + * optional string old_value = 1; + * + * @return Whether the oldValue field is set. + */ + boolean hasOldValue(); + /** + * + * + *
+   * The old value of the changed resource or attribute.
+   * 
+ * + * optional string old_value = 1; + * + * @return The oldValue. + */ + java.lang.String getOldValue(); + /** + * + * + *
+   * The old value of the changed resource or attribute.
+   * 
+ * + * optional string old_value = 1; + * + * @return The bytes for oldValue. + */ + com.google.protobuf.ByteString getOldValueBytes(); + + /** + * + * + *
+   * The new value of the changed resource or attribute.
+   * 
+ * + * optional string new_value = 2; + * + * @return Whether the newValue field is set. + */ + boolean hasNewValue(); + /** + * + * + *
+   * The new value of the changed resource or attribute.
+   * 
+ * + * optional string new_value = 2; + * + * @return The newValue. + */ + java.lang.String getNewValue(); + /** + * + * + *
+   * The new value of the changed resource or attribute.
+   * 
+ * + * optional string new_value = 2; + * + * @return The bytes for newValue. + */ + com.google.protobuf.ByteString getNewValueBytes(); + + /** + * + * + *
+   * Countries that have the change (if applicable)
+   * 
+ * + * optional string region_code = 3; + * + * @return Whether the regionCode field is set. + */ + boolean hasRegionCode(); + /** + * + * + *
+   * Countries that have the change (if applicable)
+   * 
+ * + * optional string region_code = 3; + * + * @return The regionCode. + */ + java.lang.String getRegionCode(); + /** + * + * + *
+   * Countries that have the change (if applicable)
+   * 
+ * + * optional string region_code = 3; + * + * @return The bytes for regionCode. + */ + com.google.protobuf.ByteString getRegionCodeBytes(); + + /** + * + * + *
+   * Reporting contexts that have the change (if applicable)
+   * 
+ * + * + * optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * + * + * @return Whether the reportingContext field is set. + */ + boolean hasReportingContext(); + /** + * + * + *
+   * Reporting contexts that have the change (if applicable)
+   * 
+ * + * + * optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * + * + * @return The enum numeric value on the wire for reportingContext. + */ + int getReportingContextValue(); + /** + * + * + *
+   * Reporting contexts that have the change (if applicable)
+   * 
+ * + * + * optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * + * + * @return The reportingContext. + */ + com.google.shopping.type.ReportingContext.ReportingContextEnum getReportingContext(); +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductStatusChangeMessage.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductStatusChangeMessage.java new file mode 100644 index 000000000000..9e34f4df4bd2 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductStatusChangeMessage.java @@ -0,0 +1,2305 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +/** + * + * + *
+ * The message that the merchant will receive to notify about product status
+ * change event
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage} + */ +public final class ProductStatusChangeMessage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage) + ProductStatusChangeMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductStatusChangeMessage.newBuilder() to construct. + private ProductStatusChangeMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductStatusChangeMessage() { + account_ = ""; + managingAccount_ = ""; + resourceType_ = 0; + attribute_ = 0; + changes_ = java.util.Collections.emptyList(); + resourceId_ = ""; + resource_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductStatusChangeMessage(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ProductStatusChangeMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ProductStatusChangeMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage.class, + com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage.Builder + .class); + } + + private int bitField0_; + public static final int ACCOUNT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object account_ = ""; + /** + * + * + *
+   * The target account that owns the entity that changed.
+   * Format : `accounts/{merchant_id}`
+   * 
+ * + * optional string account = 1; + * + * @return Whether the account field is set. + */ + @java.lang.Override + public boolean hasAccount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The target account that owns the entity that changed.
+   * Format : `accounts/{merchant_id}`
+   * 
+ * + * optional string account = 1; + * + * @return The account. + */ + @java.lang.Override + public java.lang.String getAccount() { + java.lang.Object ref = account_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + account_ = s; + return s; + } + } + /** + * + * + *
+   * The target account that owns the entity that changed.
+   * Format : `accounts/{merchant_id}`
+   * 
+ * + * optional string account = 1; + * + * @return The bytes for account. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAccountBytes() { + java.lang.Object ref = account_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + account_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MANAGING_ACCOUNT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object managingAccount_ = ""; + /** + * + * + *
+   * The account that manages the merchant's account. can be the same as
+   * merchant id if it is standalone account. Format :
+   * `accounts/{service_provider_id}`
+   * 
+ * + * optional string managing_account = 2; + * + * @return Whether the managingAccount field is set. + */ + @java.lang.Override + public boolean hasManagingAccount() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The account that manages the merchant's account. can be the same as
+   * merchant id if it is standalone account. Format :
+   * `accounts/{service_provider_id}`
+   * 
+ * + * optional string managing_account = 2; + * + * @return The managingAccount. + */ + @java.lang.Override + public java.lang.String getManagingAccount() { + java.lang.Object ref = managingAccount_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + managingAccount_ = s; + return s; + } + } + /** + * + * + *
+   * The account that manages the merchant's account. can be the same as
+   * merchant id if it is standalone account. Format :
+   * `accounts/{service_provider_id}`
+   * 
+ * + * optional string managing_account = 2; + * + * @return The bytes for managingAccount. + */ + @java.lang.Override + public com.google.protobuf.ByteString getManagingAccountBytes() { + java.lang.Object ref = managingAccount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + managingAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_TYPE_FIELD_NUMBER = 3; + private int resourceType_ = 0; + /** + * + * + *
+   * The resource that changed, in this case it will always be `Product`.
+   * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * + * + * @return Whether the resourceType field is set. + */ + @java.lang.Override + public boolean hasResourceType() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * The resource that changed, in this case it will always be `Product`.
+   * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * + * + * @return The enum numeric value on the wire for resourceType. + */ + @java.lang.Override + public int getResourceTypeValue() { + return resourceType_; + } + /** + * + * + *
+   * The resource that changed, in this case it will always be `Product`.
+   * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * + * + * @return The resourceType. + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.Resource getResourceType() { + com.google.shopping.merchant.notifications.v1beta.Resource result = + com.google.shopping.merchant.notifications.v1beta.Resource.forNumber(resourceType_); + return result == null + ? com.google.shopping.merchant.notifications.v1beta.Resource.UNRECOGNIZED + : result; + } + + public static final int ATTRIBUTE_FIELD_NUMBER = 4; + private int attribute_ = 0; + /** + * + * + *
+   * The attribute in the resource that changed, in this case it will be always
+   * `Status`.
+   * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * + * @return Whether the attribute field is set. + */ + @java.lang.Override + public boolean hasAttribute() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * The attribute in the resource that changed, in this case it will be always
+   * `Status`.
+   * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * + * @return The enum numeric value on the wire for attribute. + */ + @java.lang.Override + public int getAttributeValue() { + return attribute_; + } + /** + * + * + *
+   * The attribute in the resource that changed, in this case it will be always
+   * `Status`.
+   * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * + * @return The attribute. + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.Attribute getAttribute() { + com.google.shopping.merchant.notifications.v1beta.Attribute result = + com.google.shopping.merchant.notifications.v1beta.Attribute.forNumber(attribute_); + return result == null + ? com.google.shopping.merchant.notifications.v1beta.Attribute.UNRECOGNIZED + : result; + } + + public static final int CHANGES_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List changes_; + /** + * + * + *
+   * A message to describe the change that happened to the product
+   * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + */ + @java.lang.Override + public java.util.List + getChangesList() { + return changes_; + } + /** + * + * + *
+   * A message to describe the change that happened to the product
+   * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.shopping.merchant.notifications.v1beta.ProductChangeOrBuilder> + getChangesOrBuilderList() { + return changes_; + } + /** + * + * + *
+   * A message to describe the change that happened to the product
+   * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + */ + @java.lang.Override + public int getChangesCount() { + return changes_.size(); + } + /** + * + * + *
+   * A message to describe the change that happened to the product
+   * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ProductChange getChanges(int index) { + return changes_.get(index); + } + /** + * + * + *
+   * A message to describe the change that happened to the product
+   * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ProductChangeOrBuilder + getChangesOrBuilder(int index) { + return changes_.get(index); + } + + public static final int RESOURCE_ID_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object resourceId_ = ""; + /** + * + * + *
+   * The product id.
+   * 
+ * + * optional string resource_id = 6; + * + * @return Whether the resourceId field is set. + */ + @java.lang.Override + public boolean hasResourceId() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * The product id.
+   * 
+ * + * optional string resource_id = 6; + * + * @return The resourceId. + */ + @java.lang.Override + public java.lang.String getResourceId() { + java.lang.Object ref = resourceId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceId_ = s; + return s; + } + } + /** + * + * + *
+   * The product id.
+   * 
+ * + * optional string resource_id = 6; + * + * @return The bytes for resourceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceIdBytes() { + java.lang.Object ref = resourceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object resource_ = ""; + /** + * + * + *
+   * The product name.
+   * Format: `{product.name=accounts/{account}/products/{product}}`
+   * 
+ * + * optional string resource = 7; + * + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+   * The product name.
+   * Format: `{product.name=accounts/{account}/products/{product}}`
+   * 
+ * + * optional string resource = 7; + * + * @return The resource. + */ + @java.lang.Override + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } + } + /** + * + * + *
+   * The product name.
+   * Format: `{product.name=accounts/{account}/products/{product}}`
+   * 
+ * + * optional string resource = 7; + * + * @return The bytes for resource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, account_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, managingAccount_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeEnum(3, resourceType_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeEnum(4, attribute_); + } + for (int i = 0; i < changes_.size(); i++) { + output.writeMessage(5, changes_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, resourceId_); + } + if (((bitField0_ & 0x00000020) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, resource_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, account_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, managingAccount_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, resourceType_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, attribute_); + } + for (int i = 0; i < changes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, changes_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, resourceId_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, resource_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage other = + (com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage) obj; + + if (hasAccount() != other.hasAccount()) return false; + if (hasAccount()) { + if (!getAccount().equals(other.getAccount())) return false; + } + if (hasManagingAccount() != other.hasManagingAccount()) return false; + if (hasManagingAccount()) { + if (!getManagingAccount().equals(other.getManagingAccount())) return false; + } + if (hasResourceType() != other.hasResourceType()) return false; + if (hasResourceType()) { + if (resourceType_ != other.resourceType_) return false; + } + if (hasAttribute() != other.hasAttribute()) return false; + if (hasAttribute()) { + if (attribute_ != other.attribute_) return false; + } + if (!getChangesList().equals(other.getChangesList())) return false; + if (hasResourceId() != other.hasResourceId()) return false; + if (hasResourceId()) { + if (!getResourceId().equals(other.getResourceId())) return false; + } + if (hasResource() != other.hasResource()) return false; + if (hasResource()) { + if (!getResource().equals(other.getResource())) return false; + } + if (!getUnknownFields().equals(other.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 (hasAccount()) { + hash = (37 * hash) + ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getAccount().hashCode(); + } + if (hasManagingAccount()) { + hash = (37 * hash) + MANAGING_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getManagingAccount().hashCode(); + } + if (hasResourceType()) { + hash = (37 * hash) + RESOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + resourceType_; + } + if (hasAttribute()) { + hash = (37 * hash) + ATTRIBUTE_FIELD_NUMBER; + hash = (53 * hash) + attribute_; + } + if (getChangesCount() > 0) { + hash = (37 * hash) + CHANGES_FIELD_NUMBER; + hash = (53 * hash) + getChangesList().hashCode(); + } + if (hasResourceId()) { + hash = (37 * hash) + RESOURCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getResourceId().hashCode(); + } + if (hasResource()) { + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The message that the merchant will receive to notify about product status
+   * change event
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage) + com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ProductStatusChangeMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ProductStatusChangeMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage.class, + com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + account_ = ""; + managingAccount_ = ""; + resourceType_ = 0; + attribute_ = 0; + if (changesBuilder_ == null) { + changes_ = java.util.Collections.emptyList(); + } else { + changes_ = null; + changesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + resourceId_ = ""; + resource_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_ProductStatusChangeMessage_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage build() { + com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + buildPartial() { + com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage result = + new com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage result) { + if (changesBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + changes_ = java.util.Collections.unmodifiableList(changes_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.changes_ = changes_; + } else { + result.changes_ = changesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.account_ = account_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.managingAccount_ = managingAccount_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.resourceType_ = resourceType_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.attribute_ = attribute_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.resourceId_ = resourceId_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.resource_ = resource_; + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage other) { + if (other + == com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + .getDefaultInstance()) return this; + if (other.hasAccount()) { + account_ = other.account_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasManagingAccount()) { + managingAccount_ = other.managingAccount_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasResourceType()) { + setResourceType(other.getResourceType()); + } + if (other.hasAttribute()) { + setAttribute(other.getAttribute()); + } + if (changesBuilder_ == null) { + if (!other.changes_.isEmpty()) { + if (changes_.isEmpty()) { + changes_ = other.changes_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureChangesIsMutable(); + changes_.addAll(other.changes_); + } + onChanged(); + } + } else { + if (!other.changes_.isEmpty()) { + if (changesBuilder_.isEmpty()) { + changesBuilder_.dispose(); + changesBuilder_ = null; + changes_ = other.changes_; + bitField0_ = (bitField0_ & ~0x00000010); + changesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getChangesFieldBuilder() + : null; + } else { + changesBuilder_.addAllMessages(other.changes_); + } + } + } + if (other.hasResourceId()) { + resourceId_ = other.resourceId_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasResource()) { + resource_ = other.resource_; + bitField0_ |= 0x00000040; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + account_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + managingAccount_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + resourceType_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + attribute_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + com.google.shopping.merchant.notifications.v1beta.ProductChange m = + input.readMessage( + com.google.shopping.merchant.notifications.v1beta.ProductChange.parser(), + extensionRegistry); + if (changesBuilder_ == null) { + ensureChangesIsMutable(); + changes_.add(m); + } else { + changesBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: + { + resourceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + resource_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object account_ = ""; + /** + * + * + *
+     * The target account that owns the entity that changed.
+     * Format : `accounts/{merchant_id}`
+     * 
+ * + * optional string account = 1; + * + * @return Whether the account field is set. + */ + public boolean hasAccount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The target account that owns the entity that changed.
+     * Format : `accounts/{merchant_id}`
+     * 
+ * + * optional string account = 1; + * + * @return The account. + */ + public java.lang.String getAccount() { + java.lang.Object ref = account_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + account_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The target account that owns the entity that changed.
+     * Format : `accounts/{merchant_id}`
+     * 
+ * + * optional string account = 1; + * + * @return The bytes for account. + */ + public com.google.protobuf.ByteString getAccountBytes() { + java.lang.Object ref = account_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + account_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The target account that owns the entity that changed.
+     * Format : `accounts/{merchant_id}`
+     * 
+ * + * optional string account = 1; + * + * @param value The account to set. + * @return This builder for chaining. + */ + public Builder setAccount(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + account_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The target account that owns the entity that changed.
+     * Format : `accounts/{merchant_id}`
+     * 
+ * + * optional string account = 1; + * + * @return This builder for chaining. + */ + public Builder clearAccount() { + account_ = getDefaultInstance().getAccount(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The target account that owns the entity that changed.
+     * Format : `accounts/{merchant_id}`
+     * 
+ * + * optional string account = 1; + * + * @param value The bytes for account to set. + * @return This builder for chaining. + */ + public Builder setAccountBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + account_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object managingAccount_ = ""; + /** + * + * + *
+     * The account that manages the merchant's account. can be the same as
+     * merchant id if it is standalone account. Format :
+     * `accounts/{service_provider_id}`
+     * 
+ * + * optional string managing_account = 2; + * + * @return Whether the managingAccount field is set. + */ + public boolean hasManagingAccount() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The account that manages the merchant's account. can be the same as
+     * merchant id if it is standalone account. Format :
+     * `accounts/{service_provider_id}`
+     * 
+ * + * optional string managing_account = 2; + * + * @return The managingAccount. + */ + public java.lang.String getManagingAccount() { + java.lang.Object ref = managingAccount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + managingAccount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The account that manages the merchant's account. can be the same as
+     * merchant id if it is standalone account. Format :
+     * `accounts/{service_provider_id}`
+     * 
+ * + * optional string managing_account = 2; + * + * @return The bytes for managingAccount. + */ + public com.google.protobuf.ByteString getManagingAccountBytes() { + java.lang.Object ref = managingAccount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + managingAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The account that manages the merchant's account. can be the same as
+     * merchant id if it is standalone account. Format :
+     * `accounts/{service_provider_id}`
+     * 
+ * + * optional string managing_account = 2; + * + * @param value The managingAccount to set. + * @return This builder for chaining. + */ + public Builder setManagingAccount(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + managingAccount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The account that manages the merchant's account. can be the same as
+     * merchant id if it is standalone account. Format :
+     * `accounts/{service_provider_id}`
+     * 
+ * + * optional string managing_account = 2; + * + * @return This builder for chaining. + */ + public Builder clearManagingAccount() { + managingAccount_ = getDefaultInstance().getManagingAccount(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The account that manages the merchant's account. can be the same as
+     * merchant id if it is standalone account. Format :
+     * `accounts/{service_provider_id}`
+     * 
+ * + * optional string managing_account = 2; + * + * @param value The bytes for managingAccount to set. + * @return This builder for chaining. + */ + public Builder setManagingAccountBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + managingAccount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int resourceType_ = 0; + /** + * + * + *
+     * The resource that changed, in this case it will always be `Product`.
+     * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * + * + * @return Whether the resourceType field is set. + */ + @java.lang.Override + public boolean hasResourceType() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The resource that changed, in this case it will always be `Product`.
+     * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * + * + * @return The enum numeric value on the wire for resourceType. + */ + @java.lang.Override + public int getResourceTypeValue() { + return resourceType_; + } + /** + * + * + *
+     * The resource that changed, in this case it will always be `Product`.
+     * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * + * + * @param value The enum numeric value on the wire for resourceType to set. + * @return This builder for chaining. + */ + public Builder setResourceTypeValue(int value) { + resourceType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource that changed, in this case it will always be `Product`.
+     * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * + * + * @return The resourceType. + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.Resource getResourceType() { + com.google.shopping.merchant.notifications.v1beta.Resource result = + com.google.shopping.merchant.notifications.v1beta.Resource.forNumber(resourceType_); + return result == null + ? com.google.shopping.merchant.notifications.v1beta.Resource.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The resource that changed, in this case it will always be `Product`.
+     * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * + * + * @param value The resourceType to set. + * @return This builder for chaining. + */ + public Builder setResourceType( + com.google.shopping.merchant.notifications.v1beta.Resource value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + resourceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource that changed, in this case it will always be `Product`.
+     * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearResourceType() { + bitField0_ = (bitField0_ & ~0x00000004); + resourceType_ = 0; + onChanged(); + return this; + } + + private int attribute_ = 0; + /** + * + * + *
+     * The attribute in the resource that changed, in this case it will be always
+     * `Status`.
+     * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * + * @return Whether the attribute field is set. + */ + @java.lang.Override + public boolean hasAttribute() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The attribute in the resource that changed, in this case it will be always
+     * `Status`.
+     * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * + * @return The enum numeric value on the wire for attribute. + */ + @java.lang.Override + public int getAttributeValue() { + return attribute_; + } + /** + * + * + *
+     * The attribute in the resource that changed, in this case it will be always
+     * `Status`.
+     * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * + * @param value The enum numeric value on the wire for attribute to set. + * @return This builder for chaining. + */ + public Builder setAttributeValue(int value) { + attribute_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The attribute in the resource that changed, in this case it will be always
+     * `Status`.
+     * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * + * @return The attribute. + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.Attribute getAttribute() { + com.google.shopping.merchant.notifications.v1beta.Attribute result = + com.google.shopping.merchant.notifications.v1beta.Attribute.forNumber(attribute_); + return result == null + ? com.google.shopping.merchant.notifications.v1beta.Attribute.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The attribute in the resource that changed, in this case it will be always
+     * `Status`.
+     * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * + * @param value The attribute to set. + * @return This builder for chaining. + */ + public Builder setAttribute(com.google.shopping.merchant.notifications.v1beta.Attribute value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + attribute_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The attribute in the resource that changed, in this case it will be always
+     * `Status`.
+     * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * + * @return This builder for chaining. + */ + public Builder clearAttribute() { + bitField0_ = (bitField0_ & ~0x00000008); + attribute_ = 0; + onChanged(); + return this; + } + + private java.util.List + changes_ = java.util.Collections.emptyList(); + + private void ensureChangesIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + changes_ = + new java.util.ArrayList< + com.google.shopping.merchant.notifications.v1beta.ProductChange>(changes_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.notifications.v1beta.ProductChange, + com.google.shopping.merchant.notifications.v1beta.ProductChange.Builder, + com.google.shopping.merchant.notifications.v1beta.ProductChangeOrBuilder> + changesBuilder_; + + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public java.util.List + getChangesList() { + if (changesBuilder_ == null) { + return java.util.Collections.unmodifiableList(changes_); + } else { + return changesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public int getChangesCount() { + if (changesBuilder_ == null) { + return changes_.size(); + } else { + return changesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public com.google.shopping.merchant.notifications.v1beta.ProductChange getChanges(int index) { + if (changesBuilder_ == null) { + return changes_.get(index); + } else { + return changesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public Builder setChanges( + int index, com.google.shopping.merchant.notifications.v1beta.ProductChange value) { + if (changesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChangesIsMutable(); + changes_.set(index, value); + onChanged(); + } else { + changesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public Builder setChanges( + int index, + com.google.shopping.merchant.notifications.v1beta.ProductChange.Builder builderForValue) { + if (changesBuilder_ == null) { + ensureChangesIsMutable(); + changes_.set(index, builderForValue.build()); + onChanged(); + } else { + changesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public Builder addChanges( + com.google.shopping.merchant.notifications.v1beta.ProductChange value) { + if (changesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChangesIsMutable(); + changes_.add(value); + onChanged(); + } else { + changesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public Builder addChanges( + int index, com.google.shopping.merchant.notifications.v1beta.ProductChange value) { + if (changesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChangesIsMutable(); + changes_.add(index, value); + onChanged(); + } else { + changesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public Builder addChanges( + com.google.shopping.merchant.notifications.v1beta.ProductChange.Builder builderForValue) { + if (changesBuilder_ == null) { + ensureChangesIsMutable(); + changes_.add(builderForValue.build()); + onChanged(); + } else { + changesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public Builder addChanges( + int index, + com.google.shopping.merchant.notifications.v1beta.ProductChange.Builder builderForValue) { + if (changesBuilder_ == null) { + ensureChangesIsMutable(); + changes_.add(index, builderForValue.build()); + onChanged(); + } else { + changesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public Builder addAllChanges( + java.lang.Iterable< + ? extends com.google.shopping.merchant.notifications.v1beta.ProductChange> + values) { + if (changesBuilder_ == null) { + ensureChangesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, changes_); + onChanged(); + } else { + changesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public Builder clearChanges() { + if (changesBuilder_ == null) { + changes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + changesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public Builder removeChanges(int index) { + if (changesBuilder_ == null) { + ensureChangesIsMutable(); + changes_.remove(index); + onChanged(); + } else { + changesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public com.google.shopping.merchant.notifications.v1beta.ProductChange.Builder + getChangesBuilder(int index) { + return getChangesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public com.google.shopping.merchant.notifications.v1beta.ProductChangeOrBuilder + getChangesOrBuilder(int index) { + if (changesBuilder_ == null) { + return changes_.get(index); + } else { + return changesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public java.util.List< + ? extends com.google.shopping.merchant.notifications.v1beta.ProductChangeOrBuilder> + getChangesOrBuilderList() { + if (changesBuilder_ != null) { + return changesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(changes_); + } + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public com.google.shopping.merchant.notifications.v1beta.ProductChange.Builder + addChangesBuilder() { + return getChangesFieldBuilder() + .addBuilder( + com.google.shopping.merchant.notifications.v1beta.ProductChange.getDefaultInstance()); + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public com.google.shopping.merchant.notifications.v1beta.ProductChange.Builder + addChangesBuilder(int index) { + return getChangesFieldBuilder() + .addBuilder( + index, + com.google.shopping.merchant.notifications.v1beta.ProductChange.getDefaultInstance()); + } + /** + * + * + *
+     * A message to describe the change that happened to the product
+     * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * + */ + public java.util.List + getChangesBuilderList() { + return getChangesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.notifications.v1beta.ProductChange, + com.google.shopping.merchant.notifications.v1beta.ProductChange.Builder, + com.google.shopping.merchant.notifications.v1beta.ProductChangeOrBuilder> + getChangesFieldBuilder() { + if (changesBuilder_ == null) { + changesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.notifications.v1beta.ProductChange, + com.google.shopping.merchant.notifications.v1beta.ProductChange.Builder, + com.google.shopping.merchant.notifications.v1beta.ProductChangeOrBuilder>( + changes_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); + changes_ = null; + } + return changesBuilder_; + } + + private java.lang.Object resourceId_ = ""; + /** + * + * + *
+     * The product id.
+     * 
+ * + * optional string resource_id = 6; + * + * @return Whether the resourceId field is set. + */ + public boolean hasResourceId() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * The product id.
+     * 
+ * + * optional string resource_id = 6; + * + * @return The resourceId. + */ + public java.lang.String getResourceId() { + java.lang.Object ref = resourceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The product id.
+     * 
+ * + * optional string resource_id = 6; + * + * @return The bytes for resourceId. + */ + public com.google.protobuf.ByteString getResourceIdBytes() { + java.lang.Object ref = resourceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The product id.
+     * 
+ * + * optional string resource_id = 6; + * + * @param value The resourceId to set. + * @return This builder for chaining. + */ + public Builder setResourceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + resourceId_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The product id.
+     * 
+ * + * optional string resource_id = 6; + * + * @return This builder for chaining. + */ + public Builder clearResourceId() { + resourceId_ = getDefaultInstance().getResourceId(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * The product id.
+     * 
+ * + * optional string resource_id = 6; + * + * @param value The bytes for resourceId to set. + * @return This builder for chaining. + */ + public Builder setResourceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + resourceId_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object resource_ = ""; + /** + * + * + *
+     * The product name.
+     * Format: `{product.name=accounts/{account}/products/{product}}`
+     * 
+ * + * optional string resource = 7; + * + * @return Whether the resource field is set. + */ + public boolean hasResource() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * The product name.
+     * Format: `{product.name=accounts/{account}/products/{product}}`
+     * 
+ * + * optional string resource = 7; + * + * @return The resource. + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The product name.
+     * Format: `{product.name=accounts/{account}/products/{product}}`
+     * 
+ * + * optional string resource = 7; + * + * @return The bytes for resource. + */ + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The product name.
+     * Format: `{product.name=accounts/{account}/products/{product}}`
+     * 
+ * + * optional string resource = 7; + * + * @param value The resource to set. + * @return This builder for chaining. + */ + public Builder setResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The product name.
+     * Format: `{product.name=accounts/{account}/products/{product}}`
+     * 
+ * + * optional string resource = 7; + * + * @return This builder for chaining. + */ + public Builder clearResource() { + resource_ = getDefaultInstance().getResource(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * The product name.
+     * Format: `{product.name=accounts/{account}/products/{product}}`
+     * 
+ * + * optional string resource = 7; + * + * @param value The bytes for resource to set. + * @return This builder for chaining. + */ + public Builder setResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + resource_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage) + private static final com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage(); + } + + public static com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductStatusChangeMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductStatusChangeMessageOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductStatusChangeMessageOrBuilder.java new file mode 100644 index 000000000000..829b10873c85 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/ProductStatusChangeMessageOrBuilder.java @@ -0,0 +1,319 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +public interface ProductStatusChangeMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The target account that owns the entity that changed.
+   * Format : `accounts/{merchant_id}`
+   * 
+ * + * optional string account = 1; + * + * @return Whether the account field is set. + */ + boolean hasAccount(); + /** + * + * + *
+   * The target account that owns the entity that changed.
+   * Format : `accounts/{merchant_id}`
+   * 
+ * + * optional string account = 1; + * + * @return The account. + */ + java.lang.String getAccount(); + /** + * + * + *
+   * The target account that owns the entity that changed.
+   * Format : `accounts/{merchant_id}`
+   * 
+ * + * optional string account = 1; + * + * @return The bytes for account. + */ + com.google.protobuf.ByteString getAccountBytes(); + + /** + * + * + *
+   * The account that manages the merchant's account. can be the same as
+   * merchant id if it is standalone account. Format :
+   * `accounts/{service_provider_id}`
+   * 
+ * + * optional string managing_account = 2; + * + * @return Whether the managingAccount field is set. + */ + boolean hasManagingAccount(); + /** + * + * + *
+   * The account that manages the merchant's account. can be the same as
+   * merchant id if it is standalone account. Format :
+   * `accounts/{service_provider_id}`
+   * 
+ * + * optional string managing_account = 2; + * + * @return The managingAccount. + */ + java.lang.String getManagingAccount(); + /** + * + * + *
+   * The account that manages the merchant's account. can be the same as
+   * merchant id if it is standalone account. Format :
+   * `accounts/{service_provider_id}`
+   * 
+ * + * optional string managing_account = 2; + * + * @return The bytes for managingAccount. + */ + com.google.protobuf.ByteString getManagingAccountBytes(); + + /** + * + * + *
+   * The resource that changed, in this case it will always be `Product`.
+   * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * + * + * @return Whether the resourceType field is set. + */ + boolean hasResourceType(); + /** + * + * + *
+   * The resource that changed, in this case it will always be `Product`.
+   * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * + * + * @return The enum numeric value on the wire for resourceType. + */ + int getResourceTypeValue(); + /** + * + * + *
+   * The resource that changed, in this case it will always be `Product`.
+   * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * + * + * @return The resourceType. + */ + com.google.shopping.merchant.notifications.v1beta.Resource getResourceType(); + + /** + * + * + *
+   * The attribute in the resource that changed, in this case it will be always
+   * `Status`.
+   * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * + * @return Whether the attribute field is set. + */ + boolean hasAttribute(); + /** + * + * + *
+   * The attribute in the resource that changed, in this case it will be always
+   * `Status`.
+   * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * + * @return The enum numeric value on the wire for attribute. + */ + int getAttributeValue(); + /** + * + * + *
+   * The attribute in the resource that changed, in this case it will be always
+   * `Status`.
+   * 
+ * + * optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * + * @return The attribute. + */ + com.google.shopping.merchant.notifications.v1beta.Attribute getAttribute(); + + /** + * + * + *
+   * A message to describe the change that happened to the product
+   * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + */ + java.util.List getChangesList(); + /** + * + * + *
+   * A message to describe the change that happened to the product
+   * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + */ + com.google.shopping.merchant.notifications.v1beta.ProductChange getChanges(int index); + /** + * + * + *
+   * A message to describe the change that happened to the product
+   * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + */ + int getChangesCount(); + /** + * + * + *
+   * A message to describe the change that happened to the product
+   * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + */ + java.util.List + getChangesOrBuilderList(); + /** + * + * + *
+   * A message to describe the change that happened to the product
+   * 
+ * + * repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + */ + com.google.shopping.merchant.notifications.v1beta.ProductChangeOrBuilder getChangesOrBuilder( + int index); + + /** + * + * + *
+   * The product id.
+   * 
+ * + * optional string resource_id = 6; + * + * @return Whether the resourceId field is set. + */ + boolean hasResourceId(); + /** + * + * + *
+   * The product id.
+   * 
+ * + * optional string resource_id = 6; + * + * @return The resourceId. + */ + java.lang.String getResourceId(); + /** + * + * + *
+   * The product id.
+   * 
+ * + * optional string resource_id = 6; + * + * @return The bytes for resourceId. + */ + com.google.protobuf.ByteString getResourceIdBytes(); + + /** + * + * + *
+   * The product name.
+   * Format: `{product.name=accounts/{account}/products/{product}}`
+   * 
+ * + * optional string resource = 7; + * + * @return Whether the resource field is set. + */ + boolean hasResource(); + /** + * + * + *
+   * The product name.
+   * Format: `{product.name=accounts/{account}/products/{product}}`
+   * 
+ * + * optional string resource = 7; + * + * @return The resource. + */ + java.lang.String getResource(); + /** + * + * + *
+   * The product name.
+   * Format: `{product.name=accounts/{account}/products/{product}}`
+   * 
+ * + * optional string resource = 7; + * + * @return The bytes for resource. + */ + com.google.protobuf.ByteString getResourceBytes(); +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/Resource.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/Resource.java new file mode 100644 index 000000000000..6f0f9f3c9cc1 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/Resource.java @@ -0,0 +1,158 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +/** + * + * + *
+ * Enum to specify the resource that is being changed to notify the merchant
+ * about.
+ * 
+ * + * Protobuf enum {@code google.shopping.merchant.notifications.v1beta.Resource} + */ +public enum Resource implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified resource
+   * 
+ * + * RESOURCE_UNSPECIFIED = 0; + */ + RESOURCE_UNSPECIFIED(0), + /** + * + * + *
+   * Resource type : product
+   * 
+ * + * PRODUCT = 1; + */ + PRODUCT(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified resource
+   * 
+ * + * RESOURCE_UNSPECIFIED = 0; + */ + public static final int RESOURCE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Resource type : product
+   * 
+ * + * PRODUCT = 1; + */ + public static final int PRODUCT_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 Resource 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 Resource forNumber(int value) { + switch (value) { + case 0: + return RESOURCE_UNSPECIFIED; + case 1: + return PRODUCT; + 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 Resource findValueByNumber(int number) { + return Resource.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.shopping.merchant.notifications.v1beta.NotificationsApiProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Resource[] VALUES = values(); + + public static Resource 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 Resource(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.merchant.notifications.v1beta.Resource) +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/UpdateNotificationSubscriptionRequest.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/UpdateNotificationSubscriptionRequest.java new file mode 100644 index 000000000000..9bf5d2020390 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/UpdateNotificationSubscriptionRequest.java @@ -0,0 +1,1102 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +/** + * + * + *
+ * Request message for the UpdateNotificationSubscription method.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest} + */ +public final class UpdateNotificationSubscriptionRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest) + UpdateNotificationSubscriptionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateNotificationSubscriptionRequest.newBuilder() to construct. + private UpdateNotificationSubscriptionRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateNotificationSubscriptionRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateNotificationSubscriptionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_UpdateNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_UpdateNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + .class, + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + .Builder.class); + } + + private int bitField0_; + public static final int NOTIFICATION_SUBSCRIPTION_FIELD_NUMBER = 1; + private com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + notificationSubscription_; + /** + * + * + *
+   * Required. The new version of the notification subscription that should be
+   * updated.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the notificationSubscription field is set. + */ + @java.lang.Override + public boolean hasNotificationSubscription() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The new version of the notification subscription that should be
+   * updated.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationSubscription. + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + getNotificationSubscription() { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } + /** + * + * + *
+   * Required. The new version of the notification subscription that should be
+   * updated.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder + getNotificationSubscriptionOrBuilder() { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getNotificationSubscription()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, getNotificationSubscription()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest other = + (com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest) + obj; + + if (hasNotificationSubscription() != other.hasNotificationSubscription()) return false; + if (hasNotificationSubscription()) { + if (!getNotificationSubscription().equals(other.getNotificationSubscription())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasNotificationSubscription()) { + hash = (37 * hash) + NOTIFICATION_SUBSCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getNotificationSubscription().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the UpdateNotificationSubscription method.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest) + com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_UpdateNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_UpdateNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest.class, + com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getNotificationSubscriptionFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + notificationSubscription_ = null; + if (notificationSubscriptionBuilder_ != null) { + notificationSubscriptionBuilder_.dispose(); + notificationSubscriptionBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.notifications.v1beta.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1beta_UpdateNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + build() { + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + buildPartial() { + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + result = + new com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.notificationSubscription_ = + notificationSubscriptionBuilder_ == null + ? notificationSubscription_ + : notificationSubscriptionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + other) { + if (other + == com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + .getDefaultInstance()) return this; + if (other.hasNotificationSubscription()) { + mergeNotificationSubscription(other.getNotificationSubscription()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getNotificationSubscriptionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + notificationSubscription_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder> + notificationSubscriptionBuilder_; + /** + * + * + *
+     * Required. The new version of the notification subscription that should be
+     * updated.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the notificationSubscription field is set. + */ + public boolean hasNotificationSubscription() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The new version of the notification subscription that should be
+     * updated.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationSubscription. + */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + getNotificationSubscription() { + if (notificationSubscriptionBuilder_ == null) { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } else { + return notificationSubscriptionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The new version of the notification subscription that should be
+     * updated.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription value) { + if (notificationSubscriptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + notificationSubscription_ = value; + } else { + notificationSubscriptionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The new version of the notification subscription that should be
+     * updated.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder + builderForValue) { + if (notificationSubscriptionBuilder_ == null) { + notificationSubscription_ = builderForValue.build(); + } else { + notificationSubscriptionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The new version of the notification subscription that should be
+     * updated.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeNotificationSubscription( + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription value) { + if (notificationSubscriptionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && notificationSubscription_ != null + && notificationSubscription_ + != com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance()) { + getNotificationSubscriptionBuilder().mergeFrom(value); + } else { + notificationSubscription_ = value; + } + } else { + notificationSubscriptionBuilder_.mergeFrom(value); + } + if (notificationSubscription_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The new version of the notification subscription that should be
+     * updated.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearNotificationSubscription() { + bitField0_ = (bitField0_ & ~0x00000001); + notificationSubscription_ = null; + if (notificationSubscriptionBuilder_ != null) { + notificationSubscriptionBuilder_.dispose(); + notificationSubscriptionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The new version of the notification subscription that should be
+     * updated.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder + getNotificationSubscriptionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getNotificationSubscriptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The new version of the notification subscription that should be
+     * updated.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder + getNotificationSubscriptionOrBuilder() { + if (notificationSubscriptionBuilder_ != null) { + return notificationSubscriptionBuilder_.getMessageOrBuilder(); + } else { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } + } + /** + * + * + *
+     * Required. The new version of the notification subscription that should be
+     * updated.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder> + getNotificationSubscriptionFieldBuilder() { + if (notificationSubscriptionBuilder_ == null) { + notificationSubscriptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription, + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1beta + .NotificationSubscriptionOrBuilder>( + getNotificationSubscription(), getParentForChildren(), isClean()); + notificationSubscription_ = null; + } + return notificationSubscriptionBuilder_; + } + + 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_; + /** + * + * + *
+     * List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest) + private static final com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest(); + } + + public static com.google.shopping.merchant.notifications.v1beta + .UpdateNotificationSubscriptionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateNotificationSubscriptionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/UpdateNotificationSubscriptionRequestOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/UpdateNotificationSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..814625d8819c --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/java/com/google/shopping/merchant/notifications/v1beta/UpdateNotificationSubscriptionRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1beta/notificationsapi.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.notifications.v1beta; + +public interface UpdateNotificationSubscriptionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The new version of the notification subscription that should be
+   * updated.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the notificationSubscription field is set. + */ + boolean hasNotificationSubscription(); + /** + * + * + *
+   * Required. The new version of the notification subscription that should be
+   * updated.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationSubscription. + */ + com.google.shopping.merchant.notifications.v1beta.NotificationSubscription + getNotificationSubscription(); + /** + * + * + *
+   * Required. The new version of the notification subscription that should be
+   * updated.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionOrBuilder + getNotificationSubscriptionOrBuilder(); + + /** + * + * + *
+   * List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/proto/google/shopping/merchant/notifications/v1beta/notificationsapi.proto b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/proto/google/shopping/merchant/notifications/v1beta/notificationsapi.proto new file mode 100644 index 000000000000..03052c8e1fe2 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1beta/src/main/proto/google/shopping/merchant/notifications/v1beta/notificationsapi.proto @@ -0,0 +1,289 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.shopping.merchant.notifications.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/shopping/type/types.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/notifications/apiv1beta/notificationspb;notificationspb"; +option java_multiple_files = true; +option java_outer_classname = "NotificationsApiProto"; +option java_package = "com.google.shopping.merchant.notifications.v1beta"; +option (google.api.resource_definition) = { + type: "merchantapi.googleapis.com/Account" + pattern: "accounts/{account}" +}; + +// Service to manage notification subscriptions for merchants +service NotificationsApiService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Gets notification subscriptions for an account. + rpc GetNotificationSubscription(GetNotificationSubscriptionRequest) + returns (NotificationSubscription) { + option (google.api.http) = { + get: "/notifications/v1beta/{name=accounts/*/notificationsubscriptions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a notification subscription for a merchant. We will allow the + // following types of notification subscriptions to exist together (per + // merchant as a subscriber per event type): + // 1. Subscription for all managed accounts + subscription for self + // 2. Multiple "partial" subscriptions for managed accounts + subscription + // for self + // + // we will not allow (per merchant as a subscriber per event type): + // 1. multiple self subscriptions. + // 2. multiple "all managed accounts" subscriptions. + // 3. all and partial subscriptions at the same time. + // 4. multiple partial subscriptions for the same target account + rpc CreateNotificationSubscription(CreateNotificationSubscriptionRequest) + returns (NotificationSubscription) { + option (google.api.http) = { + post: "/notifications/v1beta/{parent=accounts/*}/notificationsubscriptions" + body: "notification_subscription" + }; + option (google.api.method_signature) = "parent,notification_subscription"; + } + + // Updates an existing notification subscription for a merchant. + rpc UpdateNotificationSubscription(UpdateNotificationSubscriptionRequest) + returns (NotificationSubscription) { + option (google.api.http) = { + patch: "/notifications/v1beta/{notification_subscription.name=accounts/*/notificationsubscriptions/*}" + body: "notification_subscription" + }; + option (google.api.method_signature) = + "notification_subscription,update_mask"; + } + + // Deletes a notification subscription for a merchant. + rpc DeleteNotificationSubscription(DeleteNotificationSubscriptionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/notifications/v1beta/{name=accounts/*/notificationsubscriptions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets all the notification subscriptions for a merchant. + rpc ListNotificationSubscriptions(ListNotificationSubscriptionsRequest) + returns (ListNotificationSubscriptionsResponse) { + option (google.api.http) = { + get: "/notifications/v1beta/{parent=accounts/*}/notificationsubscriptions" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Enum to specify the resource that is being changed to notify the merchant +// about. +enum Resource { + // Unspecified resource + RESOURCE_UNSPECIFIED = 0; + + // Resource type : product + PRODUCT = 1; +} + +// Enum to specify the attribute in the resource that is being changed to +// notify the merchant about. +enum Attribute { + // Unspecified attribute + ATTRIBUTE_UNSPECIFIED = 0; + + // Status of the changed entity + STATUS = 1; +} + +// Request message for the GetNotificationSubscription method. +message GetNotificationSubscriptionRequest { + // Required. The `name` of the notification subscription. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/NotificationSubscription" + } + ]; +} + +// Request message for the CreateNotificationSubscription method. +message CreateNotificationSubscriptionRequest { + // Required. The merchant account that owns the new notification subscription. + // Format: `accounts/{account}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "merchantapi.googleapis.com/NotificationSubscription" + } + ]; + + // Required. The notification subscription to create. + NotificationSubscription notification_subscription = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the UpdateNotificationSubscription method. +message UpdateNotificationSubscriptionRequest { + // Required. The new version of the notification subscription that should be + // updated. + NotificationSubscription notification_subscription = 1 + [(google.api.field_behavior) = REQUIRED]; + + // List of fields being updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for the DeleteNotificationSubscription method. +message DeleteNotificationSubscriptionRequest { + // Required. The name of the notification subscription to be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/NotificationSubscription" + } + ]; +} + +// Request message for the ListNotificationSubscription method. +message ListNotificationSubscriptionsRequest { + // Required. The merchant account who owns the notification subscriptions. + // Format: `accounts/{account}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "merchantapi.googleapis.com/NotificationSubscription" + } + ]; + + // The maximum number of notification subscriptions to return in a page. + // The default value for `page_size` is 100. The + // maximum value is `200`. Values above `200` will be coerced to `200`. + int32 page_size = 2; + + // Token (if provided) to retrieve the subsequent page. All other parameters + // must match the original call that provided the page token. + string page_token = 3; +} + +// Response message for the ListNotificationSubscription method. +message ListNotificationSubscriptionsResponse { + // The list of notification subscriptions requested by the merchant. + repeated NotificationSubscription notification_subscriptions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Represents a notification subscription owned by a Merchant account. +message NotificationSubscription { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/NotificationSubscription" + pattern: "accounts/{account}/notificationsubscriptions/{notification_subscription}" + }; + + // Represents the event type that the merchant is interested in receiving + // notifications for. + enum NotificationEventType { + // Notifications event type is unspecified. + NOTIFICATION_EVENT_TYPE_UNSPECIFIED = 0; + + // Notification of product status changes, for example when product becomes + // disapproved. + PRODUCT_STATUS_CHANGE = 1; + } + + oneof interested_in { + // If this value is true, the requesting account is notified of the + // specified event for all managed accounts (can be subaccounts or other + // linked accounts) including newly added accounts on a daily basis. + bool all_managed_accounts = 3; + + // The `name` of the account you want to receive notifications for. + // Format: `accounts/{account}` + string target_account = 4; + } + + // Output only. The `name` of the notification configuration. Generated by the + // Content API upon creation of a new `NotificationSubscription`. The + // `account` represents the merchant ID of the merchant that owns the + // configuration. Format: + // `accounts/{account}/notificationsubscriptions/{notification_subscription}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The event that the merchant wants to be notified about. + NotificationEventType registered_event = 2; + + // URL to be used to push the notification to the merchant. + string call_back_uri = 5; +} + +// The change that happened to the product including old value, new value, +// country code as the region code and reporting context. +message ProductChange { + // The old value of the changed resource or attribute. + optional string old_value = 1; + + // The new value of the changed resource or attribute. + optional string new_value = 2; + + // Countries that have the change (if applicable) + optional string region_code = 3; + + // Reporting contexts that have the change (if applicable) + optional google.shopping.type.ReportingContext.ReportingContextEnum + reporting_context = 4; +} + +// The message that the merchant will receive to notify about product status +// change event +message ProductStatusChangeMessage { + // The target account that owns the entity that changed. + // Format : `accounts/{merchant_id}` + optional string account = 1; + + // The account that manages the merchant's account. can be the same as + // merchant id if it is standalone account. Format : + // `accounts/{service_provider_id}` + optional string managing_account = 2; + + // The resource that changed, in this case it will always be `Product`. + optional Resource resource_type = 3; + + // The attribute in the resource that changed, in this case it will be always + // `Status`. + optional Attribute attribute = 4; + + // A message to describe the change that happened to the product + repeated ProductChange changes = 5; + + // The product id. + optional string resource_id = 6; + + // The product name. + // Format: `{product.name=accounts/{account}/products/{product}}` + optional string resource = 7; +} diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/create/SyncCreateSetCredentialsProvider.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..14719047a319 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceSettings; +import com.google.shopping.merchant.notifications.v1beta.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + NotificationsApiServiceSettings notificationsApiServiceSettings = + NotificationsApiServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create(notificationsApiServiceSettings); + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_Create_SetCredentialsProvider_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/create/SyncCreateSetCredentialsProvider1.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..94079c89188c --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_Create_SetCredentialsProvider1_sync] +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + NotificationsApiServiceSettings notificationsApiServiceSettings = + NotificationsApiServiceSettings.newHttpJsonBuilder().build(); + NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create(notificationsApiServiceSettings); + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_Create_SetCredentialsProvider1_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/create/SyncCreateSetEndpoint.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..d2325d7bada1 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_Create_SetEndpoint_sync] +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceSettings; +import com.google.shopping.merchant.notifications.v1beta.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + NotificationsApiServiceSettings notificationsApiServiceSettings = + NotificationsApiServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create(notificationsApiServiceSettings); + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_Create_SetEndpoint_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/AsyncCreateNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/AsyncCreateNotificationSubscription.java new file mode 100644 index 000000000000..d3712df43ffc --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/AsyncCreateNotificationSubscription.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_CreateNotificationSubscription_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.notifications.v1beta.AccountName; +import com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class AsyncCreateNotificationSubscription { + + public static void main(String[] args) throws Exception { + asyncCreateNotificationSubscription(); + } + + public static void asyncCreateNotificationSubscription() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + CreateNotificationSubscriptionRequest request = + CreateNotificationSubscriptionRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setNotificationSubscription(NotificationSubscription.newBuilder().build()) + .build(); + ApiFuture future = + notificationsApiServiceClient + .createNotificationSubscriptionCallable() + .futureCall(request); + // Do something. + NotificationSubscription response = future.get(); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_CreateNotificationSubscription_async] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscription.java new file mode 100644 index 000000000000..b8d4506ad625 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscription.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_CreateNotificationSubscription_sync] +import com.google.shopping.merchant.notifications.v1beta.AccountName; +import com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class SyncCreateNotificationSubscription { + + public static void main(String[] args) throws Exception { + syncCreateNotificationSubscription(); + } + + public static void syncCreateNotificationSubscription() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + CreateNotificationSubscriptionRequest request = + CreateNotificationSubscriptionRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setNotificationSubscription(NotificationSubscription.newBuilder().build()) + .build(); + NotificationSubscription response = + notificationsApiServiceClient.createNotificationSubscription(request); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_CreateNotificationSubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionAccountnameNotificationsubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionAccountnameNotificationsubscription.java new file mode 100644 index 000000000000..bc141b947671 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionAccountnameNotificationsubscription.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_CreateNotificationSubscription_AccountnameNotificationsubscription_sync] +import com.google.shopping.merchant.notifications.v1beta.AccountName; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class SyncCreateNotificationSubscriptionAccountnameNotificationsubscription { + + public static void main(String[] args) throws Exception { + syncCreateNotificationSubscriptionAccountnameNotificationsubscription(); + } + + public static void syncCreateNotificationSubscriptionAccountnameNotificationsubscription() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + AccountName parent = AccountName.of("[ACCOUNT]"); + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder().build(); + NotificationSubscription response = + notificationsApiServiceClient.createNotificationSubscription( + parent, notificationSubscription); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_CreateNotificationSubscription_AccountnameNotificationsubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionStringNotificationsubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionStringNotificationsubscription.java new file mode 100644 index 000000000000..1f26edb0af70 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionStringNotificationsubscription.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_CreateNotificationSubscription_StringNotificationsubscription_sync] +import com.google.shopping.merchant.notifications.v1beta.AccountName; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class SyncCreateNotificationSubscriptionStringNotificationsubscription { + + public static void main(String[] args) throws Exception { + syncCreateNotificationSubscriptionStringNotificationsubscription(); + } + + public static void syncCreateNotificationSubscriptionStringNotificationsubscription() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + String parent = AccountName.of("[ACCOUNT]").toString(); + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder().build(); + NotificationSubscription response = + notificationsApiServiceClient.createNotificationSubscription( + parent, notificationSubscription); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_CreateNotificationSubscription_StringNotificationsubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/AsyncDeleteNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/AsyncDeleteNotificationSubscription.java new file mode 100644 index 000000000000..1d1d2f01a82e --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/AsyncDeleteNotificationSubscription.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_DeleteNotificationSubscription_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class AsyncDeleteNotificationSubscription { + + public static void main(String[] args) throws Exception { + asyncDeleteNotificationSubscription(); + } + + public static void asyncDeleteNotificationSubscription() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + DeleteNotificationSubscriptionRequest request = + DeleteNotificationSubscriptionRequest.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .build(); + ApiFuture future = + notificationsApiServiceClient + .deleteNotificationSubscriptionCallable() + .futureCall(request); + // Do something. + future.get(); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_DeleteNotificationSubscription_async] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscription.java new file mode 100644 index 000000000000..da4c86c64c5c --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscription.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_DeleteNotificationSubscription_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class SyncDeleteNotificationSubscription { + + public static void main(String[] args) throws Exception { + syncDeleteNotificationSubscription(); + } + + public static void syncDeleteNotificationSubscription() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + DeleteNotificationSubscriptionRequest request = + DeleteNotificationSubscriptionRequest.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .build(); + notificationsApiServiceClient.deleteNotificationSubscription(request); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_DeleteNotificationSubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionNotificationsubscriptionname.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionNotificationsubscriptionname.java new file mode 100644 index 000000000000..4862a75becf1 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionNotificationsubscriptionname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_DeleteNotificationSubscription_Notificationsubscriptionname_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class SyncDeleteNotificationSubscriptionNotificationsubscriptionname { + + public static void main(String[] args) throws Exception { + syncDeleteNotificationSubscriptionNotificationsubscriptionname(); + } + + public static void syncDeleteNotificationSubscriptionNotificationsubscriptionname() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + NotificationSubscriptionName name = + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + notificationsApiServiceClient.deleteNotificationSubscription(name); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_DeleteNotificationSubscription_Notificationsubscriptionname_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionString.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionString.java new file mode 100644 index 000000000000..a3f3b21f1c6e --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_DeleteNotificationSubscription_String_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class SyncDeleteNotificationSubscriptionString { + + public static void main(String[] args) throws Exception { + syncDeleteNotificationSubscriptionString(); + } + + public static void syncDeleteNotificationSubscriptionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + String name = + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]").toString(); + notificationsApiServiceClient.deleteNotificationSubscription(name); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_DeleteNotificationSubscription_String_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/AsyncGetNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/AsyncGetNotificationSubscription.java new file mode 100644 index 000000000000..e7a0059b72d2 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/AsyncGetNotificationSubscription.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_GetNotificationSubscription_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class AsyncGetNotificationSubscription { + + public static void main(String[] args) throws Exception { + asyncGetNotificationSubscription(); + } + + public static void asyncGetNotificationSubscription() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + GetNotificationSubscriptionRequest request = + GetNotificationSubscriptionRequest.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .build(); + ApiFuture future = + notificationsApiServiceClient.getNotificationSubscriptionCallable().futureCall(request); + // Do something. + NotificationSubscription response = future.get(); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_GetNotificationSubscription_async] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscription.java new file mode 100644 index 000000000000..148e5ede3045 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscription.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_GetNotificationSubscription_sync] +import com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class SyncGetNotificationSubscription { + + public static void main(String[] args) throws Exception { + syncGetNotificationSubscription(); + } + + public static void syncGetNotificationSubscription() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + GetNotificationSubscriptionRequest request = + GetNotificationSubscriptionRequest.newBuilder() + .setName( + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .build(); + NotificationSubscription response = + notificationsApiServiceClient.getNotificationSubscription(request); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_GetNotificationSubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionNotificationsubscriptionname.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionNotificationsubscriptionname.java new file mode 100644 index 000000000000..f528dd272395 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionNotificationsubscriptionname.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_GetNotificationSubscription_Notificationsubscriptionname_sync] +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class SyncGetNotificationSubscriptionNotificationsubscriptionname { + + public static void main(String[] args) throws Exception { + syncGetNotificationSubscriptionNotificationsubscriptionname(); + } + + public static void syncGetNotificationSubscriptionNotificationsubscriptionname() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + NotificationSubscriptionName name = + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + NotificationSubscription response = + notificationsApiServiceClient.getNotificationSubscription(name); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_GetNotificationSubscription_Notificationsubscriptionname_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionString.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionString.java new file mode 100644 index 000000000000..6cdfa542c947 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_GetNotificationSubscription_String_sync] +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class SyncGetNotificationSubscriptionString { + + public static void main(String[] args) throws Exception { + syncGetNotificationSubscriptionString(); + } + + public static void syncGetNotificationSubscriptionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + String name = + NotificationSubscriptionName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]").toString(); + NotificationSubscription response = + notificationsApiServiceClient.getNotificationSubscription(name); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_GetNotificationSubscription_String_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptions.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptions.java new file mode 100644 index 000000000000..173b8fc5b42a --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptions.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_ListNotificationSubscriptions_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.notifications.v1beta.AccountName; +import com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class AsyncListNotificationSubscriptions { + + public static void main(String[] args) throws Exception { + asyncListNotificationSubscriptions(); + } + + public static void asyncListNotificationSubscriptions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + ListNotificationSubscriptionsRequest request = + ListNotificationSubscriptionsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + notificationsApiServiceClient + .listNotificationSubscriptionsPagedCallable() + .futureCall(request); + // Do something. + for (NotificationSubscription element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_ListNotificationSubscriptions_async] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptionsPaged.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptionsPaged.java new file mode 100644 index 000000000000..7f36255b8e8c --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptionsPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_ListNotificationSubscriptions_Paged_async] +import com.google.common.base.Strings; +import com.google.shopping.merchant.notifications.v1beta.AccountName; +import com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class AsyncListNotificationSubscriptionsPaged { + + public static void main(String[] args) throws Exception { + asyncListNotificationSubscriptionsPaged(); + } + + public static void asyncListNotificationSubscriptionsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + ListNotificationSubscriptionsRequest request = + ListNotificationSubscriptionsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListNotificationSubscriptionsResponse response = + notificationsApiServiceClient.listNotificationSubscriptionsCallable().call(request); + for (NotificationSubscription element : response.getNotificationSubscriptionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_ListNotificationSubscriptions_Paged_async] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptions.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptions.java new file mode 100644 index 000000000000..884e4d3fd685 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_ListNotificationSubscriptions_sync] +import com.google.shopping.merchant.notifications.v1beta.AccountName; +import com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class SyncListNotificationSubscriptions { + + public static void main(String[] args) throws Exception { + syncListNotificationSubscriptions(); + } + + public static void syncListNotificationSubscriptions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + ListNotificationSubscriptionsRequest request = + ListNotificationSubscriptionsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (NotificationSubscription element : + notificationsApiServiceClient.listNotificationSubscriptions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_ListNotificationSubscriptions_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsAccountname.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsAccountname.java new file mode 100644 index 000000000000..2e1f70864b64 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsAccountname.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_ListNotificationSubscriptions_Accountname_sync] +import com.google.shopping.merchant.notifications.v1beta.AccountName; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class SyncListNotificationSubscriptionsAccountname { + + public static void main(String[] args) throws Exception { + syncListNotificationSubscriptionsAccountname(); + } + + public static void syncListNotificationSubscriptionsAccountname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + AccountName parent = AccountName.of("[ACCOUNT]"); + for (NotificationSubscription element : + notificationsApiServiceClient.listNotificationSubscriptions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_ListNotificationSubscriptions_Accountname_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsString.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsString.java new file mode 100644 index 000000000000..3e7a13a84216 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_ListNotificationSubscriptions_String_sync] +import com.google.shopping.merchant.notifications.v1beta.AccountName; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class SyncListNotificationSubscriptionsString { + + public static void main(String[] args) throws Exception { + syncListNotificationSubscriptionsString(); + } + + public static void syncListNotificationSubscriptionsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + String parent = AccountName.of("[ACCOUNT]").toString(); + for (NotificationSubscription element : + notificationsApiServiceClient.listNotificationSubscriptions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_ListNotificationSubscriptions_String_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/updatenotificationsubscription/AsyncUpdateNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/updatenotificationsubscription/AsyncUpdateNotificationSubscription.java new file mode 100644 index 000000000000..addedfe1ce79 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/updatenotificationsubscription/AsyncUpdateNotificationSubscription.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_UpdateNotificationSubscription_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; +import com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest; + +public class AsyncUpdateNotificationSubscription { + + public static void main(String[] args) throws Exception { + asyncUpdateNotificationSubscription(); + } + + public static void asyncUpdateNotificationSubscription() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + UpdateNotificationSubscriptionRequest request = + UpdateNotificationSubscriptionRequest.newBuilder() + .setNotificationSubscription(NotificationSubscription.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + notificationsApiServiceClient + .updateNotificationSubscriptionCallable() + .futureCall(request); + // Do something. + NotificationSubscription response = future.get(); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_UpdateNotificationSubscription_async] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscription.java new file mode 100644 index 000000000000..2513fd068136 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscription.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_UpdateNotificationSubscription_sync] +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; +import com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest; + +public class SyncUpdateNotificationSubscription { + + public static void main(String[] args) throws Exception { + syncUpdateNotificationSubscription(); + } + + public static void syncUpdateNotificationSubscription() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + UpdateNotificationSubscriptionRequest request = + UpdateNotificationSubscriptionRequest.newBuilder() + .setNotificationSubscription(NotificationSubscription.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + NotificationSubscription response = + notificationsApiServiceClient.updateNotificationSubscription(request); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_UpdateNotificationSubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscriptionNotificationsubscriptionFieldmask.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscriptionNotificationsubscriptionFieldmask.java new file mode 100644 index 000000000000..316d470b79c7 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscriptionNotificationsubscriptionFieldmask.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiService_UpdateNotificationSubscription_NotificationsubscriptionFieldmask_sync] +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.notifications.v1beta.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient; + +public class SyncUpdateNotificationSubscriptionNotificationsubscriptionFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateNotificationSubscriptionNotificationsubscriptionFieldmask(); + } + + public static void syncUpdateNotificationSubscriptionNotificationsubscriptionFieldmask() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create()) { + NotificationSubscription notificationSubscription = + NotificationSubscription.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + NotificationSubscription response = + notificationsApiServiceClient.updateNotificationSubscription( + notificationSubscription, updateMask); + } + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_UpdateNotificationSubscription_NotificationsubscriptionFieldmask_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservicesettings/getnotificationsubscription/SyncGetNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservicesettings/getnotificationsubscription/SyncGetNotificationSubscription.java new file mode 100644 index 000000000000..ff2822294bd7 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/notificationsapiservicesettings/getnotificationsubscription/SyncGetNotificationSubscription.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiServiceSettings_GetNotificationSubscription_sync] +import com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceSettings; +import java.time.Duration; + +public class SyncGetNotificationSubscription { + + public static void main(String[] args) throws Exception { + syncGetNotificationSubscription(); + } + + public static void syncGetNotificationSubscription() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + NotificationsApiServiceSettings.Builder notificationsApiServiceSettingsBuilder = + NotificationsApiServiceSettings.newBuilder(); + notificationsApiServiceSettingsBuilder + .getNotificationSubscriptionSettings() + .setRetrySettings( + notificationsApiServiceSettingsBuilder + .getNotificationSubscriptionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + NotificationsApiServiceSettings notificationsApiServiceSettings = + notificationsApiServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1beta_generated_NotificationsApiServiceSettings_GetNotificationSubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/stub/notificationsapiservicestubsettings/getnotificationsubscription/SyncGetNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/stub/notificationsapiservicestubsettings/getnotificationsubscription/SyncGetNotificationSubscription.java new file mode 100644 index 000000000000..cf640f8a6d0f --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1beta/stub/notificationsapiservicestubsettings/getnotificationsubscription/SyncGetNotificationSubscription.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1beta.stub.samples; + +// [START merchantapi_v1beta_generated_NotificationsApiServiceStubSettings_GetNotificationSubscription_sync] +import com.google.shopping.merchant.notifications.v1beta.stub.NotificationsApiServiceStubSettings; +import java.time.Duration; + +public class SyncGetNotificationSubscription { + + public static void main(String[] args) throws Exception { + syncGetNotificationSubscription(); + } + + public static void syncGetNotificationSubscription() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + NotificationsApiServiceStubSettings.Builder notificationsApiServiceSettingsBuilder = + NotificationsApiServiceStubSettings.newBuilder(); + notificationsApiServiceSettingsBuilder + .getNotificationSubscriptionSettings() + .setRetrySettings( + notificationsApiServiceSettingsBuilder + .getNotificationSubscriptionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + NotificationsApiServiceStubSettings notificationsApiServiceSettings = + notificationsApiServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1beta_generated_NotificationsApiServiceStubSettings_GetNotificationSubscription_sync] diff --git a/pom.xml b/pom.xml index 44d1636aac10..91be9657780a 100644 --- a/pom.xml +++ b/pom.xml @@ -167,6 +167,7 @@ java-shell java-shopping-css java-shopping-merchant-inventories + java-shopping-merchant-notifications java-shopping-merchant-quota java-shopping-merchant-reports java-speech diff --git a/versions.txt b/versions.txt index f74a5a10bf81..2ef2a9e8cea1 100644 --- a/versions.txt +++ b/versions.txt @@ -753,3 +753,6 @@ grpc-google-cloud-parallelstore-v1beta:0.4.0:0.5.0-SNAPSHOT google-cloud-backupdr:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-backupdr-v1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-backupdr-v1:0.0.0:0.0.1-SNAPSHOT +google-shopping-merchant-notifications:0.0.0:0.0.1-SNAPSHOT +proto-google-shopping-merchant-notifications-v1beta:0.0.0:0.0.1-SNAPSHOT +grpc-google-shopping-merchant-notifications-v1beta:0.0.0:0.0.1-SNAPSHOT