From 62a2734a18a1dcffcd7cc604c762caddd3de793f Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Thu, 7 Aug 2025 10:01:58 -0400 Subject: [PATCH 1/2] fix: add v1 to shopping-merchant-notifications --- generation_config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/generation_config.yaml b/generation_config.yaml index e9949a50f7ff..2a11e7ea0e87 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -2311,6 +2311,7 @@ libraries: group_id: com.google.shopping cloud_api: false GAPICs: + - proto_path: google/shopping/merchant/notifications/v1 - proto_path: google/shopping/merchant/notifications/v1beta requires_billing: true - api_shortname: shopping-merchant-lfp From b7c4ef67e1bf2cea005c9515c32367048e45cb19 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Thu, 7 Aug 2025 20:15:38 +0000 Subject: [PATCH 2/2] chore: generate libraries at Thu Aug 7 20:13:55 UTC 2025 --- .../pom.xml | 10 + .../pom.xml | 9 + .../v1/NotificationsApiServiceClient.java | 1325 +++++++++++++ .../v1/NotificationsApiServiceSettings.java | 306 +++ .../notifications/v1/gapic_metadata.json | 36 + .../notifications/v1/package-info.java | 46 + ...otificationsApiServiceCallableFactory.java | 113 ++ .../stub/GrpcNotificationsApiServiceStub.java | 402 ++++ ...otificationsApiServiceCallableFactory.java | 101 + .../HttpJsonNotificationsApiServiceStub.java | 585 ++++++ .../v1/stub/NotificationsApiServiceStub.java | 90 + .../NotificationsApiServiceStubSettings.java | 618 ++++++ .../reflect-config.json | 1370 ++++++++++++++ .../v1/MockNotificationsApiService.java | 59 + .../v1/MockNotificationsApiServiceImpl.java | 198 ++ ...ficationsApiServiceClientHttpJsonTest.java | 631 ++++++ .../v1/NotificationsApiServiceClientTest.java | 573 ++++++ .../pom.xml | 45 + .../v1/NotificationsApiServiceGrpc.java | 1318 +++++++++++++ java-shopping-merchant-notifications/pom.xml | 12 + .../clirr-ignored-differences.xml | 80 + .../pom.xml | 37 + .../notifications/v1/AccountName.java | 168 ++ ...CreateNotificationSubscriptionRequest.java | 1031 ++++++++++ ...ificationSubscriptionRequestOrBuilder.java | 103 + ...DeleteNotificationSubscriptionRequest.java | 686 +++++++ ...ificationSubscriptionRequestOrBuilder.java | 56 + ...ationSubscriptionHealthMetricsRequest.java | 741 ++++++++ ...criptionHealthMetricsRequestOrBuilder.java | 62 + .../GetNotificationSubscriptionRequest.java | 682 +++++++ ...ificationSubscriptionRequestOrBuilder.java | 56 + .../ListNotificationSubscriptionsRequest.java | 993 ++++++++++ ...ficationSubscriptionsRequestOrBuilder.java | 101 + ...ListNotificationSubscriptionsResponse.java | 1283 +++++++++++++ ...icationSubscriptionsResponseOrBuilder.java | 124 ++ .../v1/NotificationSubscription.java | 1684 +++++++++++++++++ ...NotificationSubscriptionHealthMetrics.java | 1020 ++++++++++ ...ficationSubscriptionHealthMetricsName.java | 207 ++ ...ionSubscriptionHealthMetricsOrBuilder.java | 105 + .../v1/NotificationSubscriptionName.java | 202 ++ .../v1/NotificationSubscriptionOrBuilder.java | 192 ++ .../v1/NotificationsApiProto.java | 301 +++ ...UpdateNotificationSubscriptionRequest.java | 1108 +++++++++++ ...ificationSubscriptionRequestOrBuilder.java | 111 ++ .../notifications/v1/notificationsapi.proto | 291 +++ .../SyncCreateSetCredentialsProvider.java | 45 + .../create/SyncCreateSetEndpoint.java | 42 + .../SyncCreateUseHttpJsonTransport.java | 41 + .../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 + ...NotificationSubscriptionHealthMetrics.java | 56 + ...NotificationSubscriptionHealthMetrics.java | 51 + ...ficationsubscriptionhealthmetricsname.java | 47 + ...cationSubscriptionHealthMetricsString.java | 46 + .../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 | 57 + .../SyncGetNotificationSubscription.java | 57 + versions.txt | 2 + 75 files changed, 20716 insertions(+) create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceClient.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceSettings.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/gapic_metadata.json create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/package-info.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/GrpcNotificationsApiServiceCallableFactory.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/GrpcNotificationsApiServiceStub.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/HttpJsonNotificationsApiServiceCallableFactory.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/HttpJsonNotificationsApiServiceStub.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/NotificationsApiServiceStub.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/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.v1/reflect-config.json create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1/MockNotificationsApiService.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1/MockNotificationsApiServiceImpl.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceClientHttpJsonTest.java create mode 100644 java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceClientTest.java create mode 100644 java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1/pom.xml create mode 100644 java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceGrpc.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/clirr-ignored-differences.xml create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/pom.xml create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/AccountName.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/CreateNotificationSubscriptionRequest.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/CreateNotificationSubscriptionRequestOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/DeleteNotificationSubscriptionRequest.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/DeleteNotificationSubscriptionRequestOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionHealthMetricsRequest.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionHealthMetricsRequestOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionRequest.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionRequestOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsRequest.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsRequestOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsResponse.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsResponseOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionHealthMetrics.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionHealthMetricsName.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionHealthMetricsOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionName.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiProto.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/UpdateNotificationSubscriptionRequest.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/UpdateNotificationSubscriptionRequestOrBuilder.java create mode 100644 java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/proto/google/shopping/merchant/notifications/v1/notificationsapi.proto create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/create/SyncCreateSetEndpoint.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/create/SyncCreateUseHttpJsonTransport.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/AsyncCreateNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionAccountnameNotificationsubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionStringNotificationsubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/AsyncDeleteNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionNotificationsubscriptionname.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionString.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/AsyncGetNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionNotificationsubscriptionname.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionString.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/AsyncGetNotificationSubscriptionHealthMetrics.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/SyncGetNotificationSubscriptionHealthMetrics.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/SyncGetNotificationSubscriptionHealthMetricsNotificationsubscriptionhealthmetricsname.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/SyncGetNotificationSubscriptionHealthMetricsString.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptions.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptionsPaged.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptions.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsAccountname.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsString.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/updatenotificationsubscription/AsyncUpdateNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscriptionNotificationsubscriptionFieldmask.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservicesettings/getnotificationsubscription/SyncGetNotificationSubscription.java create mode 100644 java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/stub/notificationsapiservicestubsettings/getnotificationsubscription/SyncGetNotificationSubscription.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 index b5a5ce62c1a4..20d01b8599ea 100644 --- a/java-shopping-merchant-notifications/google-shopping-merchant-notifications-bom/pom.xml +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications-bom/pom.xml @@ -33,11 +33,21 @@ grpc-google-shopping-merchant-notifications-v1beta 0.30.0-SNAPSHOT + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-notifications-v1 + 0.30.0-SNAPSHOT + com.google.shopping.api.grpc proto-google-shopping-merchant-notifications-v1beta 0.30.0-SNAPSHOT + + com.google.shopping.api.grpc + proto-google-shopping-merchant-notifications-v1 + 0.30.0-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 index 6a3b8d5c8791..52b8fd46cfe5 100644 --- a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/pom.xml +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/pom.xml @@ -41,6 +41,10 @@ proto-google-common-protos + + com.google.shopping.api.grpc + proto-google-shopping-merchant-notifications-v1 + com.google.shopping.api.grpc proto-google-shopping-merchant-notifications-v1beta @@ -66,6 +70,11 @@ grpc-google-common-protos test + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-notifications-v1 + test + com.google.api.grpc proto-google-iam-v1 diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceClient.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceClient.java new file mode 100644 index 000000000000..0e61244d42cf --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceClient.java @@ -0,0 +1,1325 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.notifications.v1.stub.NotificationsApiServiceStub; +import com.google.shopping.merchant.notifications.v1.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 business. For standalone or subaccounts accounts, the business can create a subscription for self. For MCAs, the business can create a subscription for all managed accounts or for a specific subaccount. + *

We will allow the following types of notification subscriptions to exist together (per business 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 business as a subscriber per event type): + *

1. Multiple self subscriptions. + *

2. Multiple "all managed accounts" subscriptions. + *

3. "All managed accounts" subscription 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() + *

+ *

GetNotificationSubscriptionHealthMetrics

Retrieves notification subscription health metrics for a merchant. We recommend calling this periodically (hourly or daily) to monitor health of your callback endpoint.

+ *

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

+ *
    + *
  • getNotificationSubscriptionHealthMetrics(GetNotificationSubscriptionHealthMetricsRequest request) + *

+ *

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

+ *
    + *
  • getNotificationSubscriptionHealthMetrics(NotificationSubscriptionHealthMetricsName name) + *

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

+ *
    + *
  • getNotificationSubscriptionHealthMetricsCallable() + *

+ *
+ * + *

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. + */ +@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 business. For standalone or subaccounts accounts, the + * business can create a subscription for self. For MCAs, the business can create a subscription + * for all managed accounts or for a specific subaccount. + * + *

We will allow the following types of notification subscriptions to exist together (per + * business 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 business as a subscriber per event type): + * + *

1. Multiple self subscriptions. + * + *

2. Multiple "all managed accounts" subscriptions. + * + *

3. "All managed accounts" subscription 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 business. For standalone or subaccounts accounts, the + * business can create a subscription for self. For MCAs, the business can create a subscription + * for all managed accounts or for a specific subaccount. + * + *

We will allow the following types of notification subscriptions to exist together (per + * business 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 business as a subscriber per event type): + * + *

1. Multiple self subscriptions. + * + *

2. Multiple "all managed accounts" subscriptions. + * + *

3. "All managed accounts" subscription 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 business. For standalone or subaccounts accounts, the + * business can create a subscription for self. For MCAs, the business can create a subscription + * for all managed accounts or for a specific subaccount. + * + *

We will allow the following types of notification subscriptions to exist together (per + * business 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 business as a subscriber per event type): + * + *

1. Multiple self subscriptions. + * + *

2. Multiple "all managed accounts" subscriptions. + * + *

3. "All managed accounts" subscription 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 business. For standalone or subaccounts accounts, the + * business can create a subscription for self. For MCAs, the business can create a subscription + * for all managed accounts or for a specific subaccount. + * + *

We will allow the following types of notification subscriptions to exist together (per + * business 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 business as a subscriber per event type): + * + *

1. Multiple self subscriptions. + * + *

2. Multiple "all managed accounts" subscriptions. + * + *

3. "All managed accounts" subscription 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(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves notification subscription health metrics for a merchant. We recommend calling this + * periodically (hourly or daily) to monitor health of your callback endpoint. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   NotificationSubscriptionHealthMetricsName name =
+   *       NotificationSubscriptionHealthMetricsName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]");
+   *   NotificationSubscriptionHealthMetrics response =
+   *       notificationsApiServiceClient.getNotificationSubscriptionHealthMetrics(name);
+   * }
+   * }
+ * + * @param name Required. The `name` of the notification subscription for which metrics are + * retrieved. Format: + * `accounts/{account}/notificationsubscriptions/{notification_subscription}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NotificationSubscriptionHealthMetrics getNotificationSubscriptionHealthMetrics( + NotificationSubscriptionHealthMetricsName name) { + GetNotificationSubscriptionHealthMetricsRequest request = + GetNotificationSubscriptionHealthMetricsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getNotificationSubscriptionHealthMetrics(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves notification subscription health metrics for a merchant. We recommend calling this + * periodically (hourly or daily) to monitor health of your callback endpoint. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   String name =
+   *       NotificationSubscriptionHealthMetricsName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]")
+   *           .toString();
+   *   NotificationSubscriptionHealthMetrics response =
+   *       notificationsApiServiceClient.getNotificationSubscriptionHealthMetrics(name);
+   * }
+   * }
+ * + * @param name Required. The `name` of the notification subscription for which metrics are + * retrieved. Format: + * `accounts/{account}/notificationsubscriptions/{notification_subscription}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NotificationSubscriptionHealthMetrics getNotificationSubscriptionHealthMetrics( + String name) { + GetNotificationSubscriptionHealthMetricsRequest request = + GetNotificationSubscriptionHealthMetricsRequest.newBuilder().setName(name).build(); + return getNotificationSubscriptionHealthMetrics(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves notification subscription health metrics for a merchant. We recommend calling this + * periodically (hourly or daily) to monitor health of your callback endpoint. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   GetNotificationSubscriptionHealthMetricsRequest request =
+   *       GetNotificationSubscriptionHealthMetricsRequest.newBuilder()
+   *           .setName(
+   *               NotificationSubscriptionHealthMetricsName.of(
+   *                       "[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]")
+   *                   .toString())
+   *           .build();
+   *   NotificationSubscriptionHealthMetrics response =
+   *       notificationsApiServiceClient.getNotificationSubscriptionHealthMetrics(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NotificationSubscriptionHealthMetrics getNotificationSubscriptionHealthMetrics( + GetNotificationSubscriptionHealthMetricsRequest request) { + return getNotificationSubscriptionHealthMetricsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves notification subscription health metrics for a merchant. We recommend calling this + * periodically (hourly or daily) to monitor health of your callback endpoint. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NotificationsApiServiceClient notificationsApiServiceClient =
+   *     NotificationsApiServiceClient.create()) {
+   *   GetNotificationSubscriptionHealthMetricsRequest request =
+   *       GetNotificationSubscriptionHealthMetricsRequest.newBuilder()
+   *           .setName(
+   *               NotificationSubscriptionHealthMetricsName.of(
+   *                       "[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       notificationsApiServiceClient
+   *           .getNotificationSubscriptionHealthMetricsCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   NotificationSubscriptionHealthMetrics response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsCallable() { + return stub.getNotificationSubscriptionHealthMetricsCallable(); + } + + @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/v1/NotificationsApiServiceSettings.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceSettings.java new file mode 100644 index 000000000000..8ac094fb2f6a --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceSettings.java @@ -0,0 +1,306 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.v1; + +import static com.google.shopping.merchant.notifications.v1.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.v1.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getNotificationSubscription: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * NotificationsApiServiceSettings notificationsApiServiceSettings =
+ *     notificationsApiServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@Generated("by gapic-generator-java") +public class 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(); + } + + /** + * Returns the object with the settings used for calls to + * getNotificationSubscriptionHealthMetrics. + */ + public UnaryCallSettings< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsSettings() { + return ((NotificationsApiServiceStubSettings) getStubSettings()) + .getNotificationSubscriptionHealthMetricsSettings(); + } + + 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(); + } + + /** + * Returns the builder for the settings used for calls to + * getNotificationSubscriptionHealthMetrics. + */ + public UnaryCallSettings.Builder< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsSettings() { + return getStubSettingsBuilder().getNotificationSubscriptionHealthMetricsSettings(); + } + + @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/v1/gapic_metadata.json b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/gapic_metadata.json new file mode 100644 index 000000000000..9e743208920b --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/gapic_metadata.json @@ -0,0 +1,36 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.shopping.merchant.notifications.v1", + "libraryPackage": "com.google.shopping.merchant.notifications.v1", + "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"] + }, + "GetNotificationSubscriptionHealthMetrics": { + "methods": ["getNotificationSubscriptionHealthMetrics", "getNotificationSubscriptionHealthMetrics", "getNotificationSubscriptionHealthMetrics", "getNotificationSubscriptionHealthMetricsCallable"] + }, + "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/v1/package-info.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/package-info.java new file mode 100644 index 000000000000..c34168ac584c --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/package-info.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * 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.v1; + +import javax.annotation.Generated; diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/GrpcNotificationsApiServiceCallableFactory.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/GrpcNotificationsApiServiceCallableFactory.java new file mode 100644 index 000000000000..7a00ba6b049d --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/GrpcNotificationsApiServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the NotificationsApiService service API. + * + *

This class is for advanced usage. + */ +@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/v1/stub/GrpcNotificationsApiServiceStub.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/GrpcNotificationsApiServiceStub.java new file mode 100644 index 000000000000..bd9c0b48c442 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/GrpcNotificationsApiServiceStub.java @@ -0,0 +1,402 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.v1.stub; + +import static com.google.shopping.merchant.notifications.v1.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse; + +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.v1.CreateNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest; +import com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics; +import com.google.shopping.merchant.notifications.v1.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. + */ +@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.v1.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.v1.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.v1.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.v1.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.v1.NotificationsApiService/ListNotificationSubscriptions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListNotificationSubscriptionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListNotificationSubscriptionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.notifications.v1.NotificationsApiService/GetNotificationSubscriptionHealthMetrics") + .setRequestMarshaller( + ProtoUtils.marshaller( + GetNotificationSubscriptionHealthMetricsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(NotificationSubscriptionHealthMetrics.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 UnaryCallable< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsCallable; + + 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(); + GrpcCallSettings< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(getNotificationSubscriptionHealthMetricsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + 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.getNotificationSubscriptionHealthMetricsCallable = + callableFactory.createUnaryCallable( + getNotificationSubscriptionHealthMetricsTransportSettings, + settings.getNotificationSubscriptionHealthMetricsSettings(), + 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 UnaryCallable< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsCallable() { + return getNotificationSubscriptionHealthMetricsCallable; + } + + @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/v1/stub/HttpJsonNotificationsApiServiceCallableFactory.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/HttpJsonNotificationsApiServiceCallableFactory.java new file mode 100644 index 000000000000..83a2a013e37c --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/HttpJsonNotificationsApiServiceCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the NotificationsApiService service API. + * + *

This class is for advanced usage. + */ +@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/v1/stub/HttpJsonNotificationsApiServiceStub.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/HttpJsonNotificationsApiServiceStub.java new file mode 100644 index 000000000000..57e11d1c20c6 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/HttpJsonNotificationsApiServiceStub.java @@ -0,0 +1,585 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.v1.stub; + +import static com.google.shopping.merchant.notifications.v1.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse; + +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.v1.CreateNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest; +import com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics; +import com.google.shopping.merchant.notifications.v1.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. + */ +@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.v1.NotificationsApiService/GetNotificationSubscription") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/notifications/v1/{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.v1.NotificationsApiService/CreateNotificationSubscription") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/notifications/v1/{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.v1.NotificationsApiService/UpdateNotificationSubscription") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/notifications/v1/{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.v1.NotificationsApiService/DeleteNotificationSubscription") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/notifications/v1/{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.v1.NotificationsApiService/ListNotificationSubscriptions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/notifications/v1/{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 static final ApiMethodDescriptor< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.shopping.merchant.notifications.v1.NotificationsApiService/GetNotificationSubscriptionHealthMetrics") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/notifications/v1/{name=accounts/*/notificationsubscriptions/*}:getHealth", + 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( + NotificationSubscriptionHealthMetrics.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 UnaryCallable< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsCallable; + + 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(); + HttpJsonCallSettings< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(getNotificationSubscriptionHealthMetricsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + 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.getNotificationSubscriptionHealthMetricsCallable = + callableFactory.createUnaryCallable( + getNotificationSubscriptionHealthMetricsTransportSettings, + settings.getNotificationSubscriptionHealthMetricsSettings(), + 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); + methodDescriptors.add(getNotificationSubscriptionHealthMetricsMethodDescriptor); + 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 UnaryCallable< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsCallable() { + return getNotificationSubscriptionHealthMetricsCallable; + } + + @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/v1/stub/NotificationsApiServiceStub.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/NotificationsApiServiceStub.java new file mode 100644 index 000000000000..7f0abf708b0d --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/NotificationsApiServiceStub.java @@ -0,0 +1,90 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.stub; + +import static com.google.shopping.merchant.notifications.v1.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse; + +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.v1.CreateNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest; +import com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics; +import com.google.shopping.merchant.notifications.v1.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. + */ +@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()"); + } + + public UnaryCallable< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsCallable() { + throw new UnsupportedOperationException( + "Not implemented: getNotificationSubscriptionHealthMetricsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/NotificationsApiServiceStubSettings.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/NotificationsApiServiceStubSettings.java new file mode 100644 index 000000000000..b1b7ddc2c96c --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1/stub/NotificationsApiServiceStubSettings.java @@ -0,0 +1,618 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.v1.stub; + +import static com.google.shopping.merchant.notifications.v1.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.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.v1.CreateNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest; +import com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics; +import com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link 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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getNotificationSubscription: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * NotificationsApiServiceStubSettings notificationsApiServiceSettings =
+ *     notificationsApiServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@Generated("by gapic-generator-java") +public class 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 final UnaryCallSettings< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsSettings; + + 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(); + } + }; + + 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; + } + + /** + * Returns the object with the settings used for calls to + * getNotificationSubscriptionHealthMetrics. + */ + public UnaryCallSettings< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsSettings() { + return getNotificationSubscriptionHealthMetricsSettings; + } + + 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. */ + @ObsoleteApi("Use getEndpoint() instead") + 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(); + getNotificationSubscriptionHealthMetricsSettings = + settingsBuilder.getNotificationSubscriptionHealthMetricsSettings().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 final UnaryCallSettings.Builder< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsSettings; + 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() + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelayDuration(Duration.ofMillis(10000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getNotificationSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createNotificationSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateNotificationSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteNotificationSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listNotificationSubscriptionsSettings = + PagedCallSettings.newBuilder(LIST_NOTIFICATION_SUBSCRIPTIONS_PAGE_STR_FACT); + getNotificationSubscriptionHealthMetricsSettings = + UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getNotificationSubscriptionSettings, + createNotificationSubscriptionSettings, + updateNotificationSubscriptionSettings, + deleteNotificationSubscriptionSettings, + listNotificationSubscriptionsSettings, + getNotificationSubscriptionHealthMetricsSettings); + 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(); + getNotificationSubscriptionHealthMetricsSettings = + settings.getNotificationSubscriptionHealthMetricsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getNotificationSubscriptionSettings, + createNotificationSubscriptionSettings, + updateNotificationSubscriptionSettings, + deleteNotificationSubscriptionSettings, + listNotificationSubscriptionsSettings, + getNotificationSubscriptionHealthMetricsSettings); + } + + 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")); + + builder + .getNotificationSubscriptionHealthMetricsSettings() + .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; + } + + /** + * Returns the builder for the settings used for calls to + * getNotificationSubscriptionHealthMetrics. + */ + public UnaryCallSettings.Builder< + GetNotificationSubscriptionHealthMetricsRequest, NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetricsSettings() { + return getNotificationSubscriptionHealthMetricsSettings; + } + + @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.v1/reflect-config.json b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/resources/META-INF/native-image/com.google.shopping.merchant.notifications.v1/reflect-config.json new file mode 100644 index 000000000000..ae8de2826833 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/resources/META-INF/native-image/com.google.shopping.merchant.notifications.v1/reflect-config.json @@ -0,0 +1,1370 @@ +[ + { + "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.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.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.v1.CreateNotificationSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.NotificationSubscription", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.NotificationSubscription$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.NotificationSubscription$NotificationEventType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest$Builder", + "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/v1/MockNotificationsApiService.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1/MockNotificationsApiService.java new file mode 100644 index 000000000000..59b4215fd8bc --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1/MockNotificationsApiService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class 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/v1/MockNotificationsApiServiceImpl.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1/MockNotificationsApiServiceImpl.java new file mode 100644 index 000000000000..463dff75b3ca --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1/MockNotificationsApiServiceImpl.java @@ -0,0 +1,198 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.v1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1.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()))); + } + } + + @Override + public void getNotificationSubscriptionHealthMetrics( + GetNotificationSubscriptionHealthMetricsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof NotificationSubscriptionHealthMetrics) { + requests.add(request); + responseObserver.onNext(((NotificationSubscriptionHealthMetrics) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method" + + " GetNotificationSubscriptionHealthMetrics, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + NotificationSubscriptionHealthMetrics.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceClientHttpJsonTest.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..e9df95944de6 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceClientHttpJsonTest.java @@ -0,0 +1,631 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1; + +import static com.google.shopping.merchant.notifications.v1.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.v1.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. + } + } + + @Test + public void getNotificationSubscriptionHealthMetricsTest() throws Exception { + NotificationSubscriptionHealthMetrics expectedResponse = + NotificationSubscriptionHealthMetrics.newBuilder() + .setName( + NotificationSubscriptionHealthMetricsName.of( + "[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setAcknowledgedMessagesCount(1331941427) + .setUndeliveredMessagesCount(1001002256) + .setOldestUnacknowledgedMessageWaitingTime(-2012289131) + .build(); + mockService.addResponse(expectedResponse); + + NotificationSubscriptionHealthMetricsName name = + NotificationSubscriptionHealthMetricsName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + + NotificationSubscriptionHealthMetrics actualResponse = + client.getNotificationSubscriptionHealthMetrics(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 getNotificationSubscriptionHealthMetricsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + NotificationSubscriptionHealthMetricsName name = + NotificationSubscriptionHealthMetricsName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + client.getNotificationSubscriptionHealthMetrics(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getNotificationSubscriptionHealthMetricsTest2() throws Exception { + NotificationSubscriptionHealthMetrics expectedResponse = + NotificationSubscriptionHealthMetrics.newBuilder() + .setName( + NotificationSubscriptionHealthMetricsName.of( + "[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setAcknowledgedMessagesCount(1331941427) + .setUndeliveredMessagesCount(1001002256) + .setOldestUnacknowledgedMessageWaitingTime(-2012289131) + .build(); + mockService.addResponse(expectedResponse); + + String name = "accounts/account-7245/notificationsubscriptions/notificationsubscription-7245"; + + NotificationSubscriptionHealthMetrics actualResponse = + client.getNotificationSubscriptionHealthMetrics(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 getNotificationSubscriptionHealthMetricsExceptionTest2() 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.getNotificationSubscriptionHealthMetrics(name); + 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/v1/NotificationsApiServiceClientTest.java b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceClientTest.java new file mode 100644 index 000000000000..cb6e18f953f8 --- /dev/null +++ b/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/test/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceClientTest.java @@ -0,0 +1,573 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.v1; + +import static com.google.shopping.merchant.notifications.v1.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. + } + } + + @Test + public void getNotificationSubscriptionHealthMetricsTest() throws Exception { + NotificationSubscriptionHealthMetrics expectedResponse = + NotificationSubscriptionHealthMetrics.newBuilder() + .setName( + NotificationSubscriptionHealthMetricsName.of( + "[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setAcknowledgedMessagesCount(1331941427) + .setUndeliveredMessagesCount(1001002256) + .setOldestUnacknowledgedMessageWaitingTime(-2012289131) + .build(); + mockNotificationsApiService.addResponse(expectedResponse); + + NotificationSubscriptionHealthMetricsName name = + NotificationSubscriptionHealthMetricsName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + + NotificationSubscriptionHealthMetrics actualResponse = + client.getNotificationSubscriptionHealthMetrics(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNotificationsApiService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetNotificationSubscriptionHealthMetricsRequest actualRequest = + ((GetNotificationSubscriptionHealthMetricsRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getNotificationSubscriptionHealthMetricsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNotificationsApiService.addException(exception); + + try { + NotificationSubscriptionHealthMetricsName name = + NotificationSubscriptionHealthMetricsName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + client.getNotificationSubscriptionHealthMetrics(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getNotificationSubscriptionHealthMetricsTest2() throws Exception { + NotificationSubscriptionHealthMetrics expectedResponse = + NotificationSubscriptionHealthMetrics.newBuilder() + .setName( + NotificationSubscriptionHealthMetricsName.of( + "[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .setAcknowledgedMessagesCount(1331941427) + .setUndeliveredMessagesCount(1001002256) + .setOldestUnacknowledgedMessageWaitingTime(-2012289131) + .build(); + mockNotificationsApiService.addResponse(expectedResponse); + + String name = "name3373707"; + + NotificationSubscriptionHealthMetrics actualResponse = + client.getNotificationSubscriptionHealthMetrics(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNotificationsApiService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetNotificationSubscriptionHealthMetricsRequest actualRequest = + ((GetNotificationSubscriptionHealthMetricsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getNotificationSubscriptionHealthMetricsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNotificationsApiService.addException(exception); + + try { + String name = "name3373707"; + client.getNotificationSubscriptionHealthMetrics(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1/pom.xml b/java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1/pom.xml new file mode 100644 index 000000000000..055bd3951354 --- /dev/null +++ b/java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.shopping.api.grpc + grpc-google-shopping-merchant-notifications-v1 + 0.30.0-SNAPSHOT + grpc-google-shopping-merchant-notifications-v1 + GRPC library for google-shopping-merchant-notifications + + com.google.shopping + google-shopping-merchant-notifications-parent + 0.30.0-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-v1 + + + com.google.guava + guava + + + diff --git a/java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceGrpc.java b/java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceGrpc.java new file mode 100644 index 000000000000..657ea585c447 --- /dev/null +++ b/java-shopping-merchant-notifications/grpc-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiServiceGrpc.java @@ -0,0 +1,1318 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.v1; + +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/v1/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.v1.NotificationsApiService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1.NotificationSubscription> + getGetNotificationSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetNotificationSubscription", + requestType = + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest.class, + responseType = com.google.shopping.merchant.notifications.v1.NotificationSubscription.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1.NotificationSubscription> + getGetNotificationSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1.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.v1 + .GetNotificationSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1.NotificationSubscription + .getDefaultInstance())) + .setSchemaDescriptor( + new NotificationsApiServiceMethodDescriptorSupplier( + "GetNotificationSubscription")) + .build(); + } + } + } + return getGetNotificationSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1.NotificationSubscription> + getCreateNotificationSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateNotificationSubscription", + requestType = + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest.class, + responseType = com.google.shopping.merchant.notifications.v1.NotificationSubscription.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1.NotificationSubscription> + getCreateNotificationSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1.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.v1 + .CreateNotificationSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1.NotificationSubscription + .getDefaultInstance())) + .setSchemaDescriptor( + new NotificationsApiServiceMethodDescriptorSupplier( + "CreateNotificationSubscription")) + .build(); + } + } + } + return getCreateNotificationSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1.NotificationSubscription> + getUpdateNotificationSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateNotificationSubscription", + requestType = + com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest.class, + responseType = com.google.shopping.merchant.notifications.v1.NotificationSubscription.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1.NotificationSubscription> + getUpdateNotificationSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1.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.v1 + .UpdateNotificationSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1.NotificationSubscription + .getDefaultInstance())) + .setSchemaDescriptor( + new NotificationsApiServiceMethodDescriptorSupplier( + "UpdateNotificationSubscription")) + .build(); + } + } + } + return getUpdateNotificationSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest, + com.google.protobuf.Empty> + getDeleteNotificationSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteNotificationSubscription", + requestType = + com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest, + com.google.protobuf.Empty> + getDeleteNotificationSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.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.v1 + .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.v1.ListNotificationSubscriptionsRequest, + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse> + getListNotificationSubscriptionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListNotificationSubscriptions", + requestType = + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest.class, + responseType = + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest, + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse> + getListNotificationSubscriptionsMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest, + com.google.shopping.merchant.notifications.v1.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.v1 + .ListNotificationSubscriptionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1 + .ListNotificationSubscriptionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new NotificationsApiServiceMethodDescriptorSupplier( + "ListNotificationSubscriptions")) + .build(); + } + } + } + return getListNotificationSubscriptionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest, + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics> + getGetNotificationSubscriptionHealthMetricsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetNotificationSubscriptionHealthMetrics", + requestType = + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest.class, + responseType = + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest, + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics> + getGetNotificationSubscriptionHealthMetricsMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest, + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics> + getGetNotificationSubscriptionHealthMetricsMethod; + if ((getGetNotificationSubscriptionHealthMetricsMethod = + NotificationsApiServiceGrpc.getGetNotificationSubscriptionHealthMetricsMethod) + == null) { + synchronized (NotificationsApiServiceGrpc.class) { + if ((getGetNotificationSubscriptionHealthMetricsMethod = + NotificationsApiServiceGrpc.getGetNotificationSubscriptionHealthMetricsMethod) + == null) { + NotificationsApiServiceGrpc.getGetNotificationSubscriptionHealthMetricsMethod = + getGetNotificationSubscriptionHealthMetricsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "GetNotificationSubscriptionHealthMetrics")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.notifications.v1 + .NotificationSubscriptionHealthMetrics.getDefaultInstance())) + .setSchemaDescriptor( + new NotificationsApiServiceMethodDescriptorSupplier( + "GetNotificationSubscriptionHealthMetrics")) + .build(); + } + } + } + return getGetNotificationSubscriptionHealthMetricsMethod; + } + + /** 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 all types of calls on the service */ + public static NotificationsApiServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public NotificationsApiServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NotificationsApiServiceBlockingV2Stub(channel, callOptions); + } + }; + return NotificationsApiServiceBlockingV2Stub.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.v1.GetNotificationSubscriptionRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1.NotificationSubscription> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetNotificationSubscriptionMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a notification subscription for a business.
+     * For standalone or subaccounts accounts, the business can create a
+     * subscription for self. For MCAs, the business can create a
+     * subscription for all managed accounts or for a specific subaccount.
+     * We will allow the following types of notification subscriptions to exist
+     * together (per business 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 business as a subscriber per event type):
+     * 1. Multiple self subscriptions.
+     * 2. Multiple "all managed accounts" subscriptions.
+     * 3. "All managed accounts" subscription and partial subscriptions at the
+     * same time.
+     * 4. Multiple partial subscriptions for the same target account.
+     * 
+ */ + default void createNotificationSubscription( + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1.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.v1.UpdateNotificationSubscriptionRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1.NotificationSubscription> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateNotificationSubscriptionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a notification subscription for a merchant.
+     * 
+ */ + default void deleteNotificationSubscription( + com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListNotificationSubscriptionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves notification subscription health metrics for a merchant.
+     * We recommend calling this periodically (hourly or daily) to monitor health
+     * of your callback endpoint.
+     * 
+ */ + default void getNotificationSubscriptionHealthMetrics( + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetNotificationSubscriptionHealthMetricsMethod(), 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.v1.GetNotificationSubscriptionRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1.NotificationSubscription> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetNotificationSubscriptionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a notification subscription for a business.
+     * For standalone or subaccounts accounts, the business can create a
+     * subscription for self. For MCAs, the business can create a
+     * subscription for all managed accounts or for a specific subaccount.
+     * We will allow the following types of notification subscriptions to exist
+     * together (per business 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 business as a subscriber per event type):
+     * 1. Multiple self subscriptions.
+     * 2. Multiple "all managed accounts" subscriptions.
+     * 3. "All managed accounts" subscription and partial subscriptions at the
+     * same time.
+     * 4. Multiple partial subscriptions for the same target account.
+     * 
+ */ + public void createNotificationSubscription( + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1.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.v1.UpdateNotificationSubscriptionRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1.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.v1.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.v1.ListNotificationSubscriptionsRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListNotificationSubscriptionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves notification subscription health metrics for a merchant.
+     * We recommend calling this periodically (hourly or daily) to monitor health
+     * of your callback endpoint.
+     * 
+ */ + public void getNotificationSubscriptionHealthMetrics( + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel() + .newCall(getGetNotificationSubscriptionHealthMetricsMethod(), 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 NotificationsApiServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private NotificationsApiServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected NotificationsApiServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NotificationsApiServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Gets notification subscriptions for an account.
+     * 
+ */ + public com.google.shopping.merchant.notifications.v1.NotificationSubscription + getNotificationSubscription( + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetNotificationSubscriptionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a notification subscription for a business.
+     * For standalone or subaccounts accounts, the business can create a
+     * subscription for self. For MCAs, the business can create a
+     * subscription for all managed accounts or for a specific subaccount.
+     * We will allow the following types of notification subscriptions to exist
+     * together (per business 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 business as a subscriber per event type):
+     * 1. Multiple self subscriptions.
+     * 2. Multiple "all managed accounts" subscriptions.
+     * 3. "All managed accounts" subscription and partial subscriptions at the
+     * same time.
+     * 4. Multiple partial subscriptions for the same target account.
+     * 
+ */ + public com.google.shopping.merchant.notifications.v1.NotificationSubscription + createNotificationSubscription( + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription + updateNotificationSubscription( + com.google.shopping.merchant.notifications.v1.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.v1.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.v1.ListNotificationSubscriptionsResponse + listNotificationSubscriptions( + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListNotificationSubscriptionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves notification subscription health metrics for a merchant.
+     * We recommend calling this periodically (hourly or daily) to monitor health
+     * of your callback endpoint.
+     * 
+ */ + public com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + getNotificationSubscriptionHealthMetrics( + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), + getGetNotificationSubscriptionHealthMetricsMethod(), + getCallOptions(), + request); + } + } + + /** + * A stub to allow clients to do limited 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.v1.NotificationSubscription + getNotificationSubscription( + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetNotificationSubscriptionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a notification subscription for a business.
+     * For standalone or subaccounts accounts, the business can create a
+     * subscription for self. For MCAs, the business can create a
+     * subscription for all managed accounts or for a specific subaccount.
+     * We will allow the following types of notification subscriptions to exist
+     * together (per business 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 business as a subscriber per event type):
+     * 1. Multiple self subscriptions.
+     * 2. Multiple "all managed accounts" subscriptions.
+     * 3. "All managed accounts" subscription and partial subscriptions at the
+     * same time.
+     * 4. Multiple partial subscriptions for the same target account.
+     * 
+ */ + public com.google.shopping.merchant.notifications.v1.NotificationSubscription + createNotificationSubscription( + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription + updateNotificationSubscription( + com.google.shopping.merchant.notifications.v1.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.v1.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.v1.ListNotificationSubscriptionsResponse + listNotificationSubscriptions( + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListNotificationSubscriptionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves notification subscription health metrics for a merchant.
+     * We recommend calling this periodically (hourly or daily) to monitor health
+     * of your callback endpoint.
+     * 
+ */ + public com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + getNotificationSubscriptionHealthMetrics( + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), + getGetNotificationSubscriptionHealthMetricsMethod(), + 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.v1.NotificationSubscription> + getNotificationSubscription( + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetNotificationSubscriptionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a notification subscription for a business.
+     * For standalone or subaccounts accounts, the business can create a
+     * subscription for self. For MCAs, the business can create a
+     * subscription for all managed accounts or for a specific subaccount.
+     * We will allow the following types of notification subscriptions to exist
+     * together (per business 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 business as a subscriber per event type):
+     * 1. Multiple self subscriptions.
+     * 2. Multiple "all managed accounts" subscriptions.
+     * 3. "All managed accounts" subscription 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.v1.NotificationSubscription> + createNotificationSubscription( + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription> + updateNotificationSubscription( + com.google.shopping.merchant.notifications.v1.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.v1.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.v1.ListNotificationSubscriptionsResponse> + listNotificationSubscriptions( + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListNotificationSubscriptionsMethod(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Retrieves notification subscription health metrics for a merchant.
+     * We recommend calling this periodically (hourly or daily) to monitor health
+     * of your callback endpoint.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics> + getNotificationSubscriptionHealthMetrics( + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel() + .newCall(getGetNotificationSubscriptionHealthMetricsMethod(), 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 int METHODID_GET_NOTIFICATION_SUBSCRIPTION_HEALTH_METRICS = 5; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_NOTIFICATION_SUBSCRIPTION: + serviceImpl.getNotificationSubscription( + (com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1.NotificationSubscription>) + responseObserver); + break; + case METHODID_CREATE_NOTIFICATION_SUBSCRIPTION: + serviceImpl.createNotificationSubscription( + (com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1.NotificationSubscription>) + responseObserver); + break; + case METHODID_UPDATE_NOTIFICATION_SUBSCRIPTION: + serviceImpl.updateNotificationSubscription( + (com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1.NotificationSubscription>) + responseObserver); + break; + case METHODID_DELETE_NOTIFICATION_SUBSCRIPTION: + serviceImpl.deleteNotificationSubscription( + (com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest) + request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_NOTIFICATION_SUBSCRIPTIONS: + serviceImpl.listNotificationSubscriptions( + (com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1 + .ListNotificationSubscriptionsResponse>) + responseObserver); + break; + case METHODID_GET_NOTIFICATION_SUBSCRIPTION_HEALTH_METRICS: + serviceImpl.getNotificationSubscriptionHealthMetrics( + (com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.notifications.v1 + .NotificationSubscriptionHealthMetrics>) + 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.v1 + .GetNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1.NotificationSubscription>( + service, METHODID_GET_NOTIFICATION_SUBSCRIPTION))) + .addMethod( + getCreateNotificationSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.notifications.v1 + .CreateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1.NotificationSubscription>( + service, METHODID_CREATE_NOTIFICATION_SUBSCRIPTION))) + .addMethod( + getUpdateNotificationSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.notifications.v1 + .UpdateNotificationSubscriptionRequest, + com.google.shopping.merchant.notifications.v1.NotificationSubscription>( + service, METHODID_UPDATE_NOTIFICATION_SUBSCRIPTION))) + .addMethod( + getDeleteNotificationSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.notifications.v1 + .DeleteNotificationSubscriptionRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_NOTIFICATION_SUBSCRIPTION))) + .addMethod( + getListNotificationSubscriptionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.notifications.v1 + .ListNotificationSubscriptionsRequest, + com.google.shopping.merchant.notifications.v1 + .ListNotificationSubscriptionsResponse>( + service, METHODID_LIST_NOTIFICATION_SUBSCRIPTIONS))) + .addMethod( + getGetNotificationSubscriptionHealthMetricsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest, + com.google.shopping.merchant.notifications.v1 + .NotificationSubscriptionHealthMetrics>( + service, METHODID_GET_NOTIFICATION_SUBSCRIPTION_HEALTH_METRICS))) + .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.v1.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()) + .addMethod(getGetNotificationSubscriptionHealthMetricsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-shopping-merchant-notifications/pom.xml b/java-shopping-merchant-notifications/pom.xml index 44cc139fa500..7cd7455614f6 100644 --- a/java-shopping-merchant-notifications/pom.xml +++ b/java-shopping-merchant-notifications/pom.xml @@ -31,6 +31,16 @@ google-shopping-merchant-notifications 0.30.0-SNAPSHOT + + com.google.shopping.api.grpc + proto-google-shopping-merchant-notifications-v1 + 0.30.0-SNAPSHOT + + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-notifications-v1 + 0.30.0-SNAPSHOT + com.google.shopping.api.grpc grpc-google-shopping-merchant-notifications-v1beta @@ -48,7 +58,9 @@ google-shopping-merchant-notifications grpc-google-shopping-merchant-notifications-v1beta + grpc-google-shopping-merchant-notifications-v1 proto-google-shopping-merchant-notifications-v1beta + proto-google-shopping-merchant-notifications-v1 google-shopping-merchant-notifications-bom diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/clirr-ignored-differences.xml b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..8ddb02a4bb52 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/clirr-ignored-differences.xml @@ -0,0 +1,80 @@ + + + + + 7012 + com/google/shopping/merchant/notifications/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/shopping/merchant/notifications/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/shopping/merchant/notifications/v1/*OrBuilder + boolean has*(*) + + + + 7006 + com/google/shopping/merchant/notifications/v1/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/shopping/merchant/notifications/v1/** + * addRepeatedField(*) + ** + + + 7006 + com/google/shopping/merchant/notifications/v1/** + * clear() + ** + + + 7006 + com/google/shopping/merchant/notifications/v1/** + * clearField(*) + ** + + + 7006 + com/google/shopping/merchant/notifications/v1/** + * clearOneof(*) + ** + + + 7006 + com/google/shopping/merchant/notifications/v1/** + * clone() + ** + + + 7006 + com/google/shopping/merchant/notifications/v1/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/shopping/merchant/notifications/v1/** + * setField(*) + ** + + + 7006 + com/google/shopping/merchant/notifications/v1/** + * setRepeatedField(*) + ** + + + 7006 + com/google/shopping/merchant/notifications/v1/** + * setUnknownFields(*) + ** + + diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/pom.xml b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/pom.xml new file mode 100644 index 000000000000..ff955a43c368 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.shopping.api.grpc + proto-google-shopping-merchant-notifications-v1 + 0.30.0-SNAPSHOT + proto-google-shopping-merchant-notifications-v1 + Proto library for google-shopping-merchant-notifications + + com.google.shopping + google-shopping-merchant-notifications-parent + 0.30.0-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/AccountName.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/AccountName.java new file mode 100644 index 000000000000..f47ca0d24a99 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/AccountName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class 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-v1/src/main/java/com/google/shopping/merchant/notifications/v1/CreateNotificationSubscriptionRequest.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/CreateNotificationSubscriptionRequest.java new file mode 100644 index 000000000000..818099f2d8e9 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/CreateNotificationSubscriptionRequest.java @@ -0,0 +1,1031 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +/** + * + * + *
+ * Request message for the CreateNotificationSubscription method.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest} + */ +public final class CreateNotificationSubscriptionRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_CreateNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_CreateNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest + .class, + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription + notificationSubscription_; + + /** + * + * + *
+   * Required. The notification subscription to create.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationSubscription. + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.NotificationSubscription + getNotificationSubscription() { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } + + /** + * + * + *
+   * Required. The notification subscription to create.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder + getNotificationSubscriptionOrBuilder() { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1.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.v1.CreateNotificationSubscriptionRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest other = + (com.google.shopping.merchant.notifications.v1.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.v1.CreateNotificationSubscriptionRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.CreateNotificationSubscriptionRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.CreateNotificationSubscriptionRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.CreateNotificationSubscriptionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest) + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_CreateNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_CreateNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest + .class, + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_CreateNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest + build() { + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest + buildPartial() { + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest result = + new com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1.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.v1.CreateNotificationSubscriptionRequest) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest other) { + if (other + == com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription + notificationSubscription_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.notifications.v1.NotificationSubscription, + com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder> + notificationSubscriptionBuilder_; + + /** + * + * + *
+     * Required. The notification subscription to create.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationSubscription. + */ + public com.google.shopping.merchant.notifications.v1.NotificationSubscription + getNotificationSubscription() { + if (notificationSubscriptionBuilder_ == null) { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } else { + return notificationSubscriptionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The notification subscription to create.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNotificationSubscription( + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNotificationSubscription( + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeNotificationSubscription( + com.google.shopping.merchant.notifications.v1.NotificationSubscription value) { + if (notificationSubscriptionBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && notificationSubscription_ != null + && notificationSubscription_ + != com.google.shopping.merchant.notifications.v1.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.v1.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.v1.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder + getNotificationSubscriptionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getNotificationSubscriptionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The notification subscription to create.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder + getNotificationSubscriptionOrBuilder() { + if (notificationSubscriptionBuilder_ != null) { + return notificationSubscriptionBuilder_.getMessageOrBuilder(); + } else { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } + } + + /** + * + * + *
+     * Required. The notification subscription to create.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.notifications.v1.NotificationSubscription, + com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder> + getNotificationSubscriptionFieldBuilder() { + if (notificationSubscriptionBuilder_ == null) { + notificationSubscriptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.notifications.v1.NotificationSubscription, + com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1.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.v1.CreateNotificationSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest) + private static final com.google.shopping.merchant.notifications.v1 + .CreateNotificationSubscriptionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest(); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.CreateNotificationSubscriptionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/CreateNotificationSubscriptionRequestOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/CreateNotificationSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..3fbcd5485722 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/CreateNotificationSubscriptionRequestOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +public interface CreateNotificationSubscriptionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1.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.v1.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.v1.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationSubscription. + */ + com.google.shopping.merchant.notifications.v1.NotificationSubscription + getNotificationSubscription(); + + /** + * + * + *
+   * Required. The notification subscription to create.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder + getNotificationSubscriptionOrBuilder(); +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/DeleteNotificationSubscriptionRequest.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/DeleteNotificationSubscriptionRequest.java new file mode 100644 index 000000000000..b28c3b09b8b9 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/DeleteNotificationSubscriptionRequest.java @@ -0,0 +1,686 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +/** + * + * + *
+ * Request message for the DeleteNotificationSubscription method.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest} + */ +public final class DeleteNotificationSubscriptionRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_DeleteNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_DeleteNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest + .class, + com.google.shopping.merchant.notifications.v1.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.v1.DeleteNotificationSubscriptionRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest other = + (com.google.shopping.merchant.notifications.v1.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.v1.DeleteNotificationSubscriptionRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.DeleteNotificationSubscriptionRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.DeleteNotificationSubscriptionRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.DeleteNotificationSubscriptionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest) + com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_DeleteNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_DeleteNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest + .class, + com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_DeleteNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest + build() { + com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest + buildPartial() { + com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest result = + new com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1.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.v1.DeleteNotificationSubscriptionRequest) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest other) { + if (other + == com.google.shopping.merchant.notifications.v1.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.v1.DeleteNotificationSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest) + private static final com.google.shopping.merchant.notifications.v1 + .DeleteNotificationSubscriptionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest(); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.DeleteNotificationSubscriptionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/DeleteNotificationSubscriptionRequestOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/DeleteNotificationSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..da1e202c10f6 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/DeleteNotificationSubscriptionRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +public interface DeleteNotificationSubscriptionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1.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-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionHealthMetricsRequest.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionHealthMetricsRequest.java new file mode 100644 index 000000000000..67fe32dff67c --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionHealthMetricsRequest.java @@ -0,0 +1,741 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +/** + * + * + *
+ * Request for notification subscription health metrics.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest} + */ +public final class GetNotificationSubscriptionHealthMetricsRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest) + GetNotificationSubscriptionHealthMetricsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetNotificationSubscriptionHealthMetricsRequest.newBuilder() to construct. + private GetNotificationSubscriptionHealthMetricsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetNotificationSubscriptionHealthMetricsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetNotificationSubscriptionHealthMetricsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionHealthMetricsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionHealthMetricsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest.class, + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest.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 for which metrics are
+   * retrieved.
+   * Format:
+   * `accounts/{account}/notificationsubscriptions/{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 for which metrics are
+   * retrieved.
+   * Format:
+   * `accounts/{account}/notificationsubscriptions/{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.v1 + .GetNotificationSubscriptionHealthMetricsRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest + other = + (com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest) + 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.v1 + .GetNotificationSubscriptionHealthMetricsRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + 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.v1 + .GetNotificationSubscriptionHealthMetricsRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + parseFrom( + 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.v1 + .GetNotificationSubscriptionHealthMetricsRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + 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.v1 + .GetNotificationSubscriptionHealthMetricsRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + parseFrom( + java.io.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.v1 + .GetNotificationSubscriptionHealthMetricsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + parseDelimitedFrom( + java.io.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.v1 + .GetNotificationSubscriptionHealthMetricsRequest + 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.v1 + .GetNotificationSubscriptionHealthMetricsRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.v1.GetNotificationSubscriptionHealthMetricsRequest + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request for notification subscription health metrics.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest) + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionHealthMetricsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionHealthMetricsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest.class, + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionHealthMetricsRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + build() { + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + buildPartial() { + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest + result = + new com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + 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.v1 + .GetNotificationSubscriptionHealthMetricsRequest) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + other) { + if (other + == com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest.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 for which metrics are
+     * retrieved.
+     * Format:
+     * `accounts/{account}/notificationsubscriptions/{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 for which metrics are
+     * retrieved.
+     * Format:
+     * `accounts/{account}/notificationsubscriptions/{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 for which metrics are
+     * retrieved.
+     * Format:
+     * `accounts/{account}/notificationsubscriptions/{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 for which metrics are
+     * retrieved.
+     * Format:
+     * `accounts/{account}/notificationsubscriptions/{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 for which metrics are
+     * retrieved.
+     * Format:
+     * `accounts/{account}/notificationsubscriptions/{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.v1.GetNotificationSubscriptionHealthMetricsRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest) + private static final com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest(); + } + + public static com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionHealthMetricsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser< + GetNotificationSubscriptionHealthMetricsRequest>() { + @java.lang.Override + public GetNotificationSubscriptionHealthMetricsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.v1 + .GetNotificationSubscriptionHealthMetricsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionHealthMetricsRequestOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionHealthMetricsRequestOrBuilder.java new file mode 100644 index 000000000000..2ca3020c440b --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionHealthMetricsRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +public interface GetNotificationSubscriptionHealthMetricsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The `name` of the notification subscription for which metrics are
+   * retrieved.
+   * Format:
+   * `accounts/{account}/notificationsubscriptions/{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 for which metrics are
+   * retrieved.
+   * Format:
+   * `accounts/{account}/notificationsubscriptions/{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-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionRequest.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionRequest.java new file mode 100644 index 000000000000..120fb1b87317 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionRequest.java @@ -0,0 +1,682 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +/** + * + * + *
+ * Request message for the GetNotificationSubscription method.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest} + */ +public final class GetNotificationSubscriptionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest.class, + com.google.shopping.merchant.notifications.v1.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.v1.GetNotificationSubscriptionRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest other = + (com.google.shopping.merchant.notifications.v1.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.v1.GetNotificationSubscriptionRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.GetNotificationSubscriptionRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.GetNotificationSubscriptionRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.GetNotificationSubscriptionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest) + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest + .class, + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest + build() { + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest + buildPartial() { + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest result = + new com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1.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.v1.GetNotificationSubscriptionRequest) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest other) { + if (other + == com.google.shopping.merchant.notifications.v1.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.v1.GetNotificationSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest) + private static final com.google.shopping.merchant.notifications.v1 + .GetNotificationSubscriptionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest(); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.GetNotificationSubscriptionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionRequestOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..dcc036896497 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/GetNotificationSubscriptionRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +public interface GetNotificationSubscriptionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1.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-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsRequest.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsRequest.java new file mode 100644 index 000000000000..42a9ab80a450 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsRequest.java @@ -0,0 +1,993 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +/** + * + * + *
+ * Request message for the ListNotificationSubscription method.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest} + */ +public final class ListNotificationSubscriptionsRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest + .class, + com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest other = + (com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.ListNotificationSubscriptionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest) + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest + .class, + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest + build() { + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest + buildPartial() { + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest result = + new com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsRequest) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest other) { + if (other + == com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest) + private static final com.google.shopping.merchant.notifications.v1 + .ListNotificationSubscriptionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest(); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsRequestOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsRequestOrBuilder.java new file mode 100644 index 000000000000..ecff485ae5c4 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsRequestOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +public interface ListNotificationSubscriptionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1.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-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsResponse.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsResponse.java new file mode 100644 index 000000000000..2eff8fa56cc7 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsResponse.java @@ -0,0 +1,1283 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +/** + * + * + *
+ * Response message for the ListNotificationSubscription method.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse} + */ +public final class ListNotificationSubscriptionsResponse + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse + .class, + com.google.shopping.merchant.notifications.v1.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.v1.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.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder> + getNotificationSubscriptionsOrBuilderList() { + return notificationSubscriptions_; + } + + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.NotificationSubscription + getNotificationSubscriptions(int index) { + return notificationSubscriptions_.get(index); + } + + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsResponse)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse other = + (com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.ListNotificationSubscriptionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse) + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse + .class, + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsResponse_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse + build() { + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse + buildPartial() { + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse result = + new com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse( + this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.notifications.v1.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.v1.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.v1.ListNotificationSubscriptionsResponse) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse other) { + if (other + == com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription m = + input.readMessage( + com.google.shopping.merchant.notifications.v1.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 + notificationSubscriptions_ = java.util.Collections.emptyList(); + + private void ensureNotificationSubscriptionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + notificationSubscriptions_ = + new java.util.ArrayList< + com.google.shopping.merchant.notifications.v1.NotificationSubscription>( + notificationSubscriptions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.notifications.v1.NotificationSubscription, + com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder> + notificationSubscriptionsBuilder_; + + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public java.util.List + 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.v1.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.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder setNotificationSubscriptions( + int index, com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder setNotificationSubscriptions( + int index, + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder addNotificationSubscriptions( + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder addNotificationSubscriptions( + int index, com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder addNotificationSubscriptions( + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder addNotificationSubscriptions( + int index, + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public Builder addAllNotificationSubscriptions( + java.lang.Iterable< + ? extends com.google.shopping.merchant.notifications.v1.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.v1.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.v1.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.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder + getNotificationSubscriptionsBuilder(int index) { + return getNotificationSubscriptionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public java.util.List< + ? extends + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder + addNotificationSubscriptionsBuilder() { + return getNotificationSubscriptionsFieldBuilder() + .addBuilder( + com.google.shopping.merchant.notifications.v1.NotificationSubscription + .getDefaultInstance()); + } + + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder + addNotificationSubscriptionsBuilder(int index) { + return getNotificationSubscriptionsFieldBuilder() + .addBuilder( + index, + com.google.shopping.merchant.notifications.v1.NotificationSubscription + .getDefaultInstance()); + } + + /** + * + * + *
+     * The list of notification subscriptions requested by the merchant.
+     * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + public java.util.List< + com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder> + getNotificationSubscriptionsBuilderList() { + return getNotificationSubscriptionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.notifications.v1.NotificationSubscription, + com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder> + getNotificationSubscriptionsFieldBuilder() { + if (notificationSubscriptionsBuilder_ == null) { + notificationSubscriptionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.notifications.v1.NotificationSubscription, + com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse) + private static final com.google.shopping.merchant.notifications.v1 + .ListNotificationSubscriptionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse(); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.ListNotificationSubscriptionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsResponseOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsResponseOrBuilder.java new file mode 100644 index 000000000000..e7b3bf58fedf --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/ListNotificationSubscriptionsResponseOrBuilder.java @@ -0,0 +1,124 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +public interface ListNotificationSubscriptionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + java.util.List + getNotificationSubscriptionsList(); + + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + com.google.shopping.merchant.notifications.v1.NotificationSubscription + getNotificationSubscriptions(int index); + + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + int getNotificationSubscriptionsCount(); + + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + java.util.List< + ? extends com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder> + getNotificationSubscriptionsOrBuilderList(); + + /** + * + * + *
+   * The list of notification subscriptions requested by the merchant.
+   * 
+ * + * + * repeated .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscriptions = 1; + * + */ + com.google.shopping.merchant.notifications.v1.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-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscription.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscription.java new file mode 100644 index 000000000000..e04bb2f13db8 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscription.java @@ -0,0 +1,1684 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +/** + * + * + *
+ * Represents a notification subscription owned by a Merchant account.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.notifications.v1.NotificationSubscription} + */ +public final class NotificationSubscription extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_NotificationSubscription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_NotificationSubscription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.NotificationSubscription.class, + com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder.class); + } + + /** + * + * + *
+   * Represents the event type that the merchant is interested in receiving
+   * notifications for.
+   * 
+ * + * Protobuf enum {@code + * google.shopping.merchant.notifications.v1.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.v1.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.v1.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.v1.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.v1.NotificationSubscription.NotificationEventType registered_event = 2; + * + * + * @return The registeredEvent. + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.NotificationSubscription + .NotificationEventType + getRegisteredEvent() { + com.google.shopping.merchant.notifications.v1.NotificationSubscription.NotificationEventType + result = + com.google.shopping.merchant.notifications.v1.NotificationSubscription + .NotificationEventType.forNumber(registeredEvent_); + return result == null + ? com.google.shopping.merchant.notifications.v1.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.v1.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.v1.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.v1.NotificationSubscription)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1.NotificationSubscription other = + (com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.NotificationSubscription} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1.NotificationSubscription) + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_NotificationSubscription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_NotificationSubscription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.NotificationSubscription.class, + com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_NotificationSubscription_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.NotificationSubscription + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1.NotificationSubscription + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.NotificationSubscription build() { + com.google.shopping.merchant.notifications.v1.NotificationSubscription result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.NotificationSubscription buildPartial() { + com.google.shopping.merchant.notifications.v1.NotificationSubscription result = + new com.google.shopping.merchant.notifications.v1.NotificationSubscription(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1.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.v1.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.v1.NotificationSubscription) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1.NotificationSubscription) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1.NotificationSubscription other) { + if (other + == com.google.shopping.merchant.notifications.v1.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.v1.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.v1.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.v1.NotificationSubscription.NotificationEventType registered_event = 2; + * + * + * @return The registeredEvent. + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.NotificationSubscription + .NotificationEventType + getRegisteredEvent() { + com.google.shopping.merchant.notifications.v1.NotificationSubscription.NotificationEventType + result = + com.google.shopping.merchant.notifications.v1.NotificationSubscription + .NotificationEventType.forNumber(registeredEvent_); + return result == null + ? com.google.shopping.merchant.notifications.v1.NotificationSubscription + .NotificationEventType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The event that the merchant wants to be notified about.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1.NotificationSubscription.NotificationEventType registered_event = 2; + * + * + * @param value The registeredEvent to set. + * @return This builder for chaining. + */ + public Builder setRegisteredEvent( + com.google.shopping.merchant.notifications.v1.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.v1.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.v1.NotificationSubscription) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1.NotificationSubscription) + private static final com.google.shopping.merchant.notifications.v1.NotificationSubscription + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.notifications.v1.NotificationSubscription(); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionHealthMetrics.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionHealthMetrics.java new file mode 100644 index 000000000000..dfa836701b2f --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionHealthMetrics.java @@ -0,0 +1,1020 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +/** + * + * + *
+ * Represents a notification subscription health metrics.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics} + */ +public final class NotificationSubscriptionHealthMetrics + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics) + NotificationSubscriptionHealthMetricsOrBuilder { + private static final long serialVersionUID = 0L; + + // Use NotificationSubscriptionHealthMetrics.newBuilder() to construct. + private NotificationSubscriptionHealthMetrics( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NotificationSubscriptionHealthMetrics() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NotificationSubscriptionHealthMetrics(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_NotificationSubscriptionHealthMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_NotificationSubscriptionHealthMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + .class, + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + .Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Output only. Identifier. 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.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. Identifier. 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.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACKNOWLEDGED_MESSAGES_COUNT_FIELD_NUMBER = 2; + private long acknowledgedMessagesCount_ = 0L; + + /** + * + * + *
+   * The number of retained acknowledged messages for the last 24 hours
+   * 
+ * + * int64 acknowledged_messages_count = 2; + * + * @return The acknowledgedMessagesCount. + */ + @java.lang.Override + public long getAcknowledgedMessagesCount() { + return acknowledgedMessagesCount_; + } + + public static final int UNDELIVERED_MESSAGES_COUNT_FIELD_NUMBER = 3; + private long undeliveredMessagesCount_ = 0L; + + /** + * + * + *
+   * The number of unacknowledged messages for the last 7 days, we will attempt
+   * to re-deliver the unacknowledged message later and once successfully
+   * delivered it will not be counted within unacknowledged messages (the number
+   * of unacknowledged messages should gradually decrease to zero once the issue
+   * is fixed).
+   * 
+ * + * int64 undelivered_messages_count = 3; + * + * @return The undeliveredMessagesCount. + */ + @java.lang.Override + public long getUndeliveredMessagesCount() { + return undeliveredMessagesCount_; + } + + public static final int OLDEST_UNACKNOWLEDGED_MESSAGE_WAITING_TIME_FIELD_NUMBER = 4; + private long oldestUnacknowledgedMessageWaitingTime_ = 0L; + + /** + * + * + *
+   * The time since the oldest unacknowledged message was sent in seconds
+   * 
+ * + * int64 oldest_unacknowledged_message_waiting_time = 4; + * + * @return The oldestUnacknowledgedMessageWaitingTime. + */ + @java.lang.Override + public long getOldestUnacknowledgedMessageWaitingTime() { + return oldestUnacknowledgedMessageWaitingTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return 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 (acknowledgedMessagesCount_ != 0L) { + output.writeInt64(2, acknowledgedMessagesCount_); + } + if (undeliveredMessagesCount_ != 0L) { + output.writeInt64(3, undeliveredMessagesCount_); + } + if (oldestUnacknowledgedMessageWaitingTime_ != 0L) { + output.writeInt64(4, oldestUnacknowledgedMessageWaitingTime_); + } + 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 (acknowledgedMessagesCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, acknowledgedMessagesCount_); + } + if (undeliveredMessagesCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, undeliveredMessagesCount_); + } + if (oldestUnacknowledgedMessageWaitingTime_ != 0L) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 4, oldestUnacknowledgedMessageWaitingTime_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = 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.v1.NotificationSubscriptionHealthMetrics)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics other = + (com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics) obj; + + if (!getName().equals(other.getName())) return false; + if (getAcknowledgedMessagesCount() != other.getAcknowledgedMessagesCount()) return false; + if (getUndeliveredMessagesCount() != other.getUndeliveredMessagesCount()) return false; + if (getOldestUnacknowledgedMessageWaitingTime() + != other.getOldestUnacknowledgedMessageWaitingTime()) return false; + if (!getUnknownFields().equals(other.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) + ACKNOWLEDGED_MESSAGES_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAcknowledgedMessagesCount()); + hash = (37 * hash) + UNDELIVERED_MESSAGES_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getUndeliveredMessagesCount()); + hash = (37 * hash) + OLDEST_UNACKNOWLEDGED_MESSAGE_WAITING_TIME_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(getOldestUnacknowledgedMessageWaitingTime()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + 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.v1.NotificationSubscriptionHealthMetrics + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + parseFrom( + 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.v1.NotificationSubscriptionHealthMetrics + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + 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.v1.NotificationSubscriptionHealthMetrics + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + parseFrom( + java.io.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.v1.NotificationSubscriptionHealthMetrics + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + parseDelimitedFrom( + java.io.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.v1.NotificationSubscriptionHealthMetrics + 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.v1.NotificationSubscriptionHealthMetrics + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, 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.v1.NotificationSubscriptionHealthMetrics + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 health metrics.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics) + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_NotificationSubscriptionHealthMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_NotificationSubscriptionHealthMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + .class, + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + acknowledgedMessagesCount_ = 0L; + undeliveredMessagesCount_ = 0L; + oldestUnacknowledgedMessageWaitingTime_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_NotificationSubscriptionHealthMetrics_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + build() { + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + buildPartial() { + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics result = + new com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.acknowledgedMessagesCount_ = acknowledgedMessagesCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.undeliveredMessagesCount_ = undeliveredMessagesCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.oldestUnacknowledgedMessageWaitingTime_ = oldestUnacknowledgedMessageWaitingTime_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.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.v1.NotificationSubscriptionHealthMetrics) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics other) { + if (other + == com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getAcknowledgedMessagesCount() != 0L) { + setAcknowledgedMessagesCount(other.getAcknowledgedMessagesCount()); + } + if (other.getUndeliveredMessagesCount() != 0L) { + setUndeliveredMessagesCount(other.getUndeliveredMessagesCount()); + } + if (other.getOldestUnacknowledgedMessageWaitingTime() != 0L) { + setOldestUnacknowledgedMessageWaitingTime( + other.getOldestUnacknowledgedMessageWaitingTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + acknowledgedMessagesCount_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + undeliveredMessagesCount_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + oldestUnacknowledgedMessageWaitingTime_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. Identifier. 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.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. Identifier. 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.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. Identifier. 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.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Identifier. 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.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Identifier. 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.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long acknowledgedMessagesCount_; + + /** + * + * + *
+     * The number of retained acknowledged messages for the last 24 hours
+     * 
+ * + * int64 acknowledged_messages_count = 2; + * + * @return The acknowledgedMessagesCount. + */ + @java.lang.Override + public long getAcknowledgedMessagesCount() { + return acknowledgedMessagesCount_; + } + + /** + * + * + *
+     * The number of retained acknowledged messages for the last 24 hours
+     * 
+ * + * int64 acknowledged_messages_count = 2; + * + * @param value The acknowledgedMessagesCount to set. + * @return This builder for chaining. + */ + public Builder setAcknowledgedMessagesCount(long value) { + + acknowledgedMessagesCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of retained acknowledged messages for the last 24 hours
+     * 
+ * + * int64 acknowledged_messages_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearAcknowledgedMessagesCount() { + bitField0_ = (bitField0_ & ~0x00000002); + acknowledgedMessagesCount_ = 0L; + onChanged(); + return this; + } + + private long undeliveredMessagesCount_; + + /** + * + * + *
+     * The number of unacknowledged messages for the last 7 days, we will attempt
+     * to re-deliver the unacknowledged message later and once successfully
+     * delivered it will not be counted within unacknowledged messages (the number
+     * of unacknowledged messages should gradually decrease to zero once the issue
+     * is fixed).
+     * 
+ * + * int64 undelivered_messages_count = 3; + * + * @return The undeliveredMessagesCount. + */ + @java.lang.Override + public long getUndeliveredMessagesCount() { + return undeliveredMessagesCount_; + } + + /** + * + * + *
+     * The number of unacknowledged messages for the last 7 days, we will attempt
+     * to re-deliver the unacknowledged message later and once successfully
+     * delivered it will not be counted within unacknowledged messages (the number
+     * of unacknowledged messages should gradually decrease to zero once the issue
+     * is fixed).
+     * 
+ * + * int64 undelivered_messages_count = 3; + * + * @param value The undeliveredMessagesCount to set. + * @return This builder for chaining. + */ + public Builder setUndeliveredMessagesCount(long value) { + + undeliveredMessagesCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of unacknowledged messages for the last 7 days, we will attempt
+     * to re-deliver the unacknowledged message later and once successfully
+     * delivered it will not be counted within unacknowledged messages (the number
+     * of unacknowledged messages should gradually decrease to zero once the issue
+     * is fixed).
+     * 
+ * + * int64 undelivered_messages_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearUndeliveredMessagesCount() { + bitField0_ = (bitField0_ & ~0x00000004); + undeliveredMessagesCount_ = 0L; + onChanged(); + return this; + } + + private long oldestUnacknowledgedMessageWaitingTime_; + + /** + * + * + *
+     * The time since the oldest unacknowledged message was sent in seconds
+     * 
+ * + * int64 oldest_unacknowledged_message_waiting_time = 4; + * + * @return The oldestUnacknowledgedMessageWaitingTime. + */ + @java.lang.Override + public long getOldestUnacknowledgedMessageWaitingTime() { + return oldestUnacknowledgedMessageWaitingTime_; + } + + /** + * + * + *
+     * The time since the oldest unacknowledged message was sent in seconds
+     * 
+ * + * int64 oldest_unacknowledged_message_waiting_time = 4; + * + * @param value The oldestUnacknowledgedMessageWaitingTime to set. + * @return This builder for chaining. + */ + public Builder setOldestUnacknowledgedMessageWaitingTime(long value) { + + oldestUnacknowledgedMessageWaitingTime_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time since the oldest unacknowledged message was sent in seconds
+     * 
+ * + * int64 oldest_unacknowledged_message_waiting_time = 4; + * + * @return This builder for chaining. + */ + public Builder clearOldestUnacknowledgedMessageWaitingTime() { + bitField0_ = (bitField0_ & ~0x00000008); + oldestUnacknowledgedMessageWaitingTime_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics) + private static final com.google.shopping.merchant.notifications.v1 + .NotificationSubscriptionHealthMetrics + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics(); + } + + public static com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NotificationSubscriptionHealthMetrics parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static 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.v1.NotificationSubscriptionHealthMetrics + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionHealthMetricsName.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionHealthMetricsName.java new file mode 100644 index 000000000000..c319734ece38 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionHealthMetricsName.java @@ -0,0 +1,207 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class NotificationSubscriptionHealthMetricsName 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 NotificationSubscriptionHealthMetricsName() { + account = null; + notificationSubscription = null; + } + + private NotificationSubscriptionHealthMetricsName(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 NotificationSubscriptionHealthMetricsName 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 NotificationSubscriptionHealthMetricsName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT_NOTIFICATION_SUBSCRIPTION.validatedMatch( + formattedString, + "NotificationSubscriptionHealthMetricsName.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 (NotificationSubscriptionHealthMetricsName 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()) { + NotificationSubscriptionHealthMetricsName that = + ((NotificationSubscriptionHealthMetricsName) 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( + NotificationSubscriptionHealthMetricsName notificationSubscriptionHealthMetricsName) { + this.account = notificationSubscriptionHealthMetricsName.account; + this.notificationSubscription = + notificationSubscriptionHealthMetricsName.notificationSubscription; + } + + public NotificationSubscriptionHealthMetricsName build() { + return new NotificationSubscriptionHealthMetricsName(this); + } + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionHealthMetricsOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionHealthMetricsOrBuilder.java new file mode 100644 index 000000000000..4b796b73e691 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionHealthMetricsOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +public interface NotificationSubscriptionHealthMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Identifier. 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.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Output only. Identifier. 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.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The number of retained acknowledged messages for the last 24 hours
+   * 
+ * + * int64 acknowledged_messages_count = 2; + * + * @return The acknowledgedMessagesCount. + */ + long getAcknowledgedMessagesCount(); + + /** + * + * + *
+   * The number of unacknowledged messages for the last 7 days, we will attempt
+   * to re-deliver the unacknowledged message later and once successfully
+   * delivered it will not be counted within unacknowledged messages (the number
+   * of unacknowledged messages should gradually decrease to zero once the issue
+   * is fixed).
+   * 
+ * + * int64 undelivered_messages_count = 3; + * + * @return The undeliveredMessagesCount. + */ + long getUndeliveredMessagesCount(); + + /** + * + * + *
+   * The time since the oldest unacknowledged message was sent in seconds
+   * 
+ * + * int64 oldest_unacknowledged_message_waiting_time = 4; + * + * @return The oldestUnacknowledgedMessageWaitingTime. + */ + long getOldestUnacknowledgedMessageWaitingTime(); +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionName.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionName.java new file mode 100644 index 000000000000..b9e2c463dbb0 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionName.java @@ -0,0 +1,202 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class 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-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionOrBuilder.java new file mode 100644 index 000000000000..ff4c0b6dfcfa --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationSubscriptionOrBuilder.java @@ -0,0 +1,192 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +public interface NotificationSubscriptionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1.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.v1.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.v1.NotificationSubscription.NotificationEventType registered_event = 2; + * + * + * @return The registeredEvent. + */ + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription.InterestedInCase + getInterestedInCase(); +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiProto.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiProto.java new file mode 100644 index 000000000000..dd772bf4077b --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/NotificationsApiProto.java @@ -0,0 +1,301 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +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_v1_GetNotificationSubscriptionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1_CreateNotificationSubscriptionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1_CreateNotificationSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1_UpdateNotificationSubscriptionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1_UpdateNotificationSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1_DeleteNotificationSubscriptionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1_DeleteNotificationSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1_NotificationSubscription_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1_NotificationSubscription_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionHealthMetricsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionHealthMetricsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_notifications_v1_NotificationSubscriptionHealthMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_notifications_v1_NotificationSubscriptionHealthMetrics_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n@google/shopping/merchant/notifications" + + "/v1/notificationsapi.proto\022)google.shopp" + + "ing.merchant.notifications.v1\032\034google/ap" + + "i/annotations.proto\032\027google/api/client.p" + + "roto\032\037google/api/field_behavior.proto\032\031g" + + "oogle/api/resource.proto\032\033google/protobu" + + "f/empty.proto\032 google/protobuf/field_mas" + + "k.proto\"o\n\"GetNotificationSubscriptionRe" + + "quest\022I\n\004name\030\001 \001(\tB;\340A\002\372A5\n3merchantapi" + + ".googleapis.com/NotificationSubscription" + + "\"\341\001\n%CreateNotificationSubscriptionReque" + + "st\022K\n\006parent\030\001 \001(\tB;\340A\002\372A5\0223merchantapi." + + "googleapis.com/NotificationSubscription\022" + + "k\n\031notification_subscription\030\002 \001(\0132C.goo" + + "gle.shopping.merchant.notifications.v1.N" + + "otificationSubscriptionB\003\340A\002\"\305\001\n%UpdateN" + + "otificationSubscriptionRequest\022k\n\031notifi" + + "cation_subscription\030\001 \001(\0132C.google.shopp" + + "ing.merchant.notifications.v1.Notificati" + + "onSubscriptionB\003\340A\002\022/\n\013update_mask\030\002 \001(\013" + + "2\032.google.protobuf.FieldMask\"r\n%DeleteNo" + + "tificationSubscriptionRequest\022I\n\004name\030\001 " + + "\001(\tB;\340A\002\372A5\n3merchantapi.googleapis.com/" + + "NotificationSubscription\"\232\001\n$ListNotific" + + "ationSubscriptionsRequest\022K\n\006parent\030\001 \001(" + + "\tB;\340A\002\372A5\0223merchantapi.googleapis.com/No" + + "tificationSubscription\022\021\n\tpage_size\030\002 \001(" + + "\005\022\022\n\npage_token\030\003 \001(\t\"\251\001\n%ListNotificati" + + "onSubscriptionsResponse\022g\n\032notification_" + + "subscriptions\030\001 \003(\0132C.google.shopping.me" + + "rchant.notifications.v1.NotificationSubs" + + "cription\022\027\n\017next_page_token\030\002 \001(\t\"\346\003\n\030No" + + "tificationSubscription\022\036\n\024all_managed_ac" + + "counts\030\003 \001(\010H\000\022\030\n\016target_account\030\004 \001(\tH\000" + + "\022\021\n\004name\030\001 \001(\tB\003\340A\003\022s\n\020registered_event\030" + + "\002 \001(\0162Y.google.shopping.merchant.notific" + + "ations.v1.NotificationSubscription.Notif" + + "icationEventType\022\025\n\rcall_back_uri\030\005 \001(\t\"" + + "[\n\025NotificationEventType\022\'\n#NOTIFICATION" + + "_EVENT_TYPE_UNSPECIFIED\020\000\022\031\n\025PRODUCT_STA" + + "TUS_CHANGE\020\001:\202\001\352A\177\n3merchantapi.googleap" + + "is.com/NotificationSubscription\022Haccount" + + "s/{account}/notificationsubscriptions/{n" + + "otification_subscription}B\017\n\rinterested_" + + "in\"\211\001\n/GetNotificationSubscriptionHealth" + + "MetricsRequest\022V\n\004name\030\001 \001(\tBH\340A\002\372AB\n@me" + + "rchantapi.googleapis.com/NotificationSub" + + "scriptionHealthMetrics\"\315\002\n%NotificationS" + + "ubscriptionHealthMetrics\022\024\n\004name\030\001 \001(\tB\006" + + "\340A\003\340A\010\022#\n\033acknowledged_messages_count\030\002 " + + "\001(\003\022\"\n\032undelivered_messages_count\030\003 \001(\003\022" + + "2\n*oldest_unacknowledged_message_waiting" + + "_time\030\004 \001(\003:\220\001\352A\214\001\n@merchantapi.googleap" + + "is.com/NotificationSubscriptionHealthMet" + + "rics\022Haccounts/{account}/notificationsub" + + "scriptions/{notification_subscription}2\262" + + "\016\n\027NotificationsApiService\022\201\002\n\033GetNotifi" + + "cationSubscription\022M.google.shopping.mer" + + "chant.notifications.v1.GetNotificationSu" + + "bscriptionRequest\032C.google.shopping.merc" + + "hant.notifications.v1.NotificationSubscr" + + "iption\"N\332A\004name\202\323\344\223\002A\022?/notifications/v1" + + "/{name=accounts/*/notificationsubscripti" + + "ons/*}\022\277\002\n\036CreateNotificationSubscriptio" + + "n\022P.google.shopping.merchant.notificatio" + + "ns.v1.CreateNotificationSubscriptionRequ" + + "est\032C.google.shopping.merchant.notificat" + + "ions.v1.NotificationSubscription\"\205\001\332A pa" + + "rent,notification_subscription\202\323\344\223\002\\\"?/n" + + "otifications/v1/{parent=accounts/*}/noti" + + "ficationsubscriptions:\031notification_subs" + + "cription\022\336\002\n\036UpdateNotificationSubscript" + + "ion\022P.google.shopping.merchant.notificat" + + "ions.v1.UpdateNotificationSubscriptionRe" + + "quest\032C.google.shopping.merchant.notific" + + "ations.v1.NotificationSubscription\"\244\001\332A%" + + "notification_subscription,update_mask\202\323\344" + + "\223\002v2Y/notifications/v1/{notification_sub" + + "scription.name=accounts/*/notificationsu" + + "bscriptions/*}:\031notification_subscriptio" + + "n\022\332\001\n\036DeleteNotificationSubscription\022P.g" + + "oogle.shopping.merchant.notifications.v1" + + ".DeleteNotificationSubscriptionRequest\032\026" + + ".google.protobuf.Empty\"N\332A\004name\202\323\344\223\002A*?/" + + "notifications/v1/{name=accounts/*/notifi" + + "cationsubscriptions/*}\022\224\002\n\035ListNotificat" + + "ionSubscriptions\022O.google.shopping.merch" + + "ant.notifications.v1.ListNotificationSub" + + "scriptionsRequest\032P.google.shopping.merc" + + "hant.notifications.v1.ListNotificationSu" + + "bscriptionsResponse\"P\332A\006parent\202\323\344\223\002A\022?/n" + + "otifications/v1/{parent=accounts/*}/noti" + + "ficationsubscriptions\022\262\002\n(GetNotificatio" + + "nSubscriptionHealthMetrics\022Z.google.shop" + + "ping.merchant.notifications.v1.GetNotifi" + + "cationSubscriptionHealthMetricsRequest\032P" + + ".google.shopping.merchant.notifications." + + "v1.NotificationSubscriptionHealthMetrics" + + "\"X\332A\004name\202\323\344\223\002K\022I/notifications/v1/{name" + + "=accounts/*/notificationsubscriptions/*}" + + ":getHealth\032G\312A\032merchantapi.googleapis.co" + + "m\322A\'https://www.googleapis.com/auth/cont" + + "entB\346\002\n-com.google.shopping.merchant.not" + + "ifications.v1B\025NotificationsApiProtoP\001ZY" + + "cloud.google.com/go/shopping/merchant/no" + + "tifications/apiv1/notificationspb;notifi" + + "cationspb\252\002)Google.Shopping.Merchant.Not" + + "ifications.V1\312\002)Google\\Shopping\\Merchant" + + "\\Notifications\\V1\352\002-Google::Shopping::Me" + + "rchant::Notifications::V1\352A8\n\"merchantap" + + "i.googleapis.com/Account\022\022accounts/{acco" + + "unt}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(), + }); + internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_merchant_notifications_v1_CreateNotificationSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_merchant_notifications_v1_CreateNotificationSubscriptionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1_CreateNotificationSubscriptionRequest_descriptor, + new java.lang.String[] { + "Parent", "NotificationSubscription", + }); + internal_static_google_shopping_merchant_notifications_v1_UpdateNotificationSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_merchant_notifications_v1_UpdateNotificationSubscriptionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1_UpdateNotificationSubscriptionRequest_descriptor, + new java.lang.String[] { + "NotificationSubscription", "UpdateMask", + }); + internal_static_google_shopping_merchant_notifications_v1_DeleteNotificationSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_merchant_notifications_v1_DeleteNotificationSubscriptionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1_DeleteNotificationSubscriptionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1_ListNotificationSubscriptionsResponse_descriptor, + new java.lang.String[] { + "NotificationSubscriptions", "NextPageToken", + }); + internal_static_google_shopping_merchant_notifications_v1_NotificationSubscription_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_shopping_merchant_notifications_v1_NotificationSubscription_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1_NotificationSubscription_descriptor, + new java.lang.String[] { + "AllManagedAccounts", + "TargetAccount", + "Name", + "RegisteredEvent", + "CallBackUri", + "InterestedIn", + }); + internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionHealthMetricsRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionHealthMetricsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1_GetNotificationSubscriptionHealthMetricsRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_merchant_notifications_v1_NotificationSubscriptionHealthMetrics_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_shopping_merchant_notifications_v1_NotificationSubscriptionHealthMetrics_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_notifications_v1_NotificationSubscriptionHealthMetrics_descriptor, + new java.lang.String[] { + "Name", + "AcknowledgedMessagesCount", + "UndeliveredMessagesCount", + "OldestUnacknowledgedMessageWaitingTime", + }); + 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(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/UpdateNotificationSubscriptionRequest.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/UpdateNotificationSubscriptionRequest.java new file mode 100644 index 000000000000..f5e8dfa42f84 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/UpdateNotificationSubscriptionRequest.java @@ -0,0 +1,1108 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +/** + * + * + *
+ * Request message for the UpdateNotificationSubscription method.
+ * 
+ * + * Protobuf type {@code + * google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest} + */ +public final class UpdateNotificationSubscriptionRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_UpdateNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_UpdateNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest + .class, + com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest + .Builder.class); + } + + private int bitField0_; + public static final int NOTIFICATION_SUBSCRIPTION_FIELD_NUMBER = 1; + private com.google.shopping.merchant.notifications.v1.NotificationSubscription + notificationSubscription_; + + /** + * + * + *
+   * Required. The new version of the notification subscription that should be
+   * updated.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationSubscription. + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.NotificationSubscription + getNotificationSubscription() { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } + + /** + * + * + *
+   * Required. The new version of the notification subscription that should be
+   * updated.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder + getNotificationSubscriptionOrBuilder() { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1.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.v1.UpdateNotificationSubscriptionRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest other = + (com.google.shopping.merchant.notifications.v1.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.v1.UpdateNotificationSubscriptionRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.UpdateNotificationSubscriptionRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.UpdateNotificationSubscriptionRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.UpdateNotificationSubscriptionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest) + com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_UpdateNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.notifications.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_UpdateNotificationSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest + .class, + com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.notifications.v1.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.v1.NotificationsApiProto + .internal_static_google_shopping_merchant_notifications_v1_UpdateNotificationSubscriptionRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest + build() { + com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest + buildPartial() { + com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest result = + new com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.notifications.v1.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.v1.UpdateNotificationSubscriptionRequest) { + return mergeFrom( + (com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest other) { + if (other + == com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription + notificationSubscription_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.notifications.v1.NotificationSubscription, + com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder> + notificationSubscriptionBuilder_; + + /** + * + * + *
+     * Required. The new version of the notification subscription that should be
+     * updated.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationSubscription. + */ + public com.google.shopping.merchant.notifications.v1.NotificationSubscription + getNotificationSubscription() { + if (notificationSubscriptionBuilder_ == null) { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } else { + return notificationSubscriptionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The new version of the notification subscription that should be
+     * updated.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNotificationSubscription( + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNotificationSubscription( + com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeNotificationSubscription( + com.google.shopping.merchant.notifications.v1.NotificationSubscription value) { + if (notificationSubscriptionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && notificationSubscription_ != null + && notificationSubscription_ + != com.google.shopping.merchant.notifications.v1.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.v1.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.v1.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder + getNotificationSubscriptionOrBuilder() { + if (notificationSubscriptionBuilder_ != null) { + return notificationSubscriptionBuilder_.getMessageOrBuilder(); + } else { + return notificationSubscription_ == null + ? com.google.shopping.merchant.notifications.v1.NotificationSubscription + .getDefaultInstance() + : notificationSubscription_; + } + } + + /** + * + * + *
+     * Required. The new version of the notification subscription that should be
+     * updated.
+     * 
+ * + * + * .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.notifications.v1.NotificationSubscription, + com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1.NotificationSubscriptionOrBuilder> + getNotificationSubscriptionFieldBuilder() { + if (notificationSubscriptionBuilder_ == null) { + notificationSubscriptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.notifications.v1.NotificationSubscription, + com.google.shopping.merchant.notifications.v1.NotificationSubscription.Builder, + com.google.shopping.merchant.notifications.v1.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.v1.UpdateNotificationSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest) + private static final com.google.shopping.merchant.notifications.v1 + .UpdateNotificationSubscriptionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest(); + } + + public static com.google.shopping.merchant.notifications.v1.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.v1.UpdateNotificationSubscriptionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/UpdateNotificationSubscriptionRequestOrBuilder.java b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/UpdateNotificationSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..22beb592dc95 --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/java/com/google/shopping/merchant/notifications/v1/UpdateNotificationSubscriptionRequestOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/notifications/v1/notificationsapi.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.notifications.v1; + +public interface UpdateNotificationSubscriptionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.notifications.v1.UpdateNotificationSubscriptionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The new version of the notification subscription that should be
+   * updated.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1.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.v1.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationSubscription. + */ + com.google.shopping.merchant.notifications.v1.NotificationSubscription + getNotificationSubscription(); + + /** + * + * + *
+   * Required. The new version of the notification subscription that should be
+   * updated.
+   * 
+ * + * + * .google.shopping.merchant.notifications.v1.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.notifications.v1.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-v1/src/main/proto/google/shopping/merchant/notifications/v1/notificationsapi.proto b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/proto/google/shopping/merchant/notifications/v1/notificationsapi.proto new file mode 100644 index 000000000000..20e8d6a3a61a --- /dev/null +++ b/java-shopping-merchant-notifications/proto-google-shopping-merchant-notifications-v1/src/main/proto/google/shopping/merchant/notifications/v1/notificationsapi.proto @@ -0,0 +1,291 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.v1; + +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"; + +option csharp_namespace = "Google.Shopping.Merchant.Notifications.V1"; +option go_package = "cloud.google.com/go/shopping/merchant/notifications/apiv1/notificationspb;notificationspb"; +option java_multiple_files = true; +option java_outer_classname = "NotificationsApiProto"; +option java_package = "com.google.shopping.merchant.notifications.v1"; +option php_namespace = "Google\\Shopping\\Merchant\\Notifications\\V1"; +option ruby_package = "Google::Shopping::Merchant::Notifications::V1"; +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/v1/{name=accounts/*/notificationsubscriptions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a notification subscription for a business. + // For standalone or subaccounts accounts, the business can create a + // subscription for self. For MCAs, the business can create a + // subscription for all managed accounts or for a specific subaccount. + // + // We will allow the following types of notification subscriptions to exist + // together (per business 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 business as a subscriber per event type): + // + // 1. Multiple self subscriptions. + // + // 2. Multiple "all managed accounts" subscriptions. + // + // 3. "All managed accounts" subscription 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/v1/{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/v1/{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/v1/{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/v1/{parent=accounts/*}/notificationsubscriptions" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves notification subscription health metrics for a merchant. + // We recommend calling this periodically (hourly or daily) to monitor health + // of your callback endpoint. + rpc GetNotificationSubscriptionHealthMetrics( + GetNotificationSubscriptionHealthMetricsRequest) + returns (NotificationSubscriptionHealthMetrics) { + option (google.api.http) = { + get: "/notifications/v1/{name=accounts/*/notificationsubscriptions/*}:getHealth" + }; + option (google.api.method_signature) = "name"; + } +} + +// 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; +} + +// Request for notification subscription health metrics. +message GetNotificationSubscriptionHealthMetricsRequest { + // Required. The `name` of the notification subscription for which metrics are + // retrieved. + // Format: + // `accounts/{account}/notificationsubscriptions/{notification_subscription}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/NotificationSubscriptionHealthMetrics" + } + ]; +} + +// Represents a notification subscription health metrics. +message NotificationSubscriptionHealthMetrics { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/NotificationSubscriptionHealthMetrics" + pattern: "accounts/{account}/notificationsubscriptions/{notification_subscription}" + }; + + // Output only. Identifier. 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. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // The number of retained acknowledged messages for the last 24 hours + int64 acknowledged_messages_count = 2; + + // The number of unacknowledged messages for the last 7 days, we will attempt + // to re-deliver the unacknowledged message later and once successfully + // delivered it will not be counted within unacknowledged messages (the number + // of unacknowledged messages should gradually decrease to zero once the issue + // is fixed). + int64 undelivered_messages_count = 3; + + // The time since the oldest unacknowledged message was sent in seconds + int64 oldest_unacknowledged_message_waiting_time = 4; +} diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/create/SyncCreateSetCredentialsProvider.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..73b6bee162c0 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.shopping.merchant.notifications.v1.NotificationsApiServiceClient; +import com.google.shopping.merchant.notifications.v1.NotificationsApiServiceSettings; +import com.google.shopping.merchant.notifications.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + NotificationsApiServiceSettings notificationsApiServiceSettings = + NotificationsApiServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create(notificationsApiServiceSettings); + } +} +// [END merchantapi_v1_generated_NotificationsApiService_Create_SetCredentialsProvider_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/create/SyncCreateSetEndpoint.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..8a12ba37ad00 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_Create_SetEndpoint_sync] +import com.google.shopping.merchant.notifications.v1.NotificationsApiServiceClient; +import com.google.shopping.merchant.notifications.v1.NotificationsApiServiceSettings; +import com.google.shopping.merchant.notifications.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + NotificationsApiServiceSettings notificationsApiServiceSettings = + NotificationsApiServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create(notificationsApiServiceSettings); + } +} +// [END merchantapi_v1_generated_NotificationsApiService_Create_SetEndpoint_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/create/SyncCreateUseHttpJsonTransport.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..09f0d41aff4c --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_Create_UseHttpJsonTransport_sync] +import com.google.shopping.merchant.notifications.v1.NotificationsApiServiceClient; +import com.google.shopping.merchant.notifications.v1.NotificationsApiServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + NotificationsApiServiceSettings notificationsApiServiceSettings = + NotificationsApiServiceSettings.newHttpJsonBuilder().build(); + NotificationsApiServiceClient notificationsApiServiceClient = + NotificationsApiServiceClient.create(notificationsApiServiceSettings); + } +} +// [END merchantapi_v1_generated_NotificationsApiService_Create_UseHttpJsonTransport_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/AsyncCreateNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/AsyncCreateNotificationSubscription.java new file mode 100644 index 000000000000..3da0e2c8d8f8 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/AsyncCreateNotificationSubscription.java @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_CreateNotificationSubscription_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.notifications.v1.AccountName; +import com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_CreateNotificationSubscription_async] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscription.java new file mode 100644 index 000000000000..d3242816dc5e --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscription.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_CreateNotificationSubscription_sync] +import com.google.shopping.merchant.notifications.v1.AccountName; +import com.google.shopping.merchant.notifications.v1.CreateNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_CreateNotificationSubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionAccountnameNotificationsubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionAccountnameNotificationsubscription.java new file mode 100644 index 000000000000..78e92a30554b --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionAccountnameNotificationsubscription.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_CreateNotificationSubscription_AccountnameNotificationsubscription_sync] +import com.google.shopping.merchant.notifications.v1.AccountName; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_CreateNotificationSubscription_AccountnameNotificationsubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionStringNotificationsubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionStringNotificationsubscription.java new file mode 100644 index 000000000000..8afcc87764a1 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/createnotificationsubscription/SyncCreateNotificationSubscriptionStringNotificationsubscription.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_CreateNotificationSubscription_StringNotificationsubscription_sync] +import com.google.shopping.merchant.notifications.v1.AccountName; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_CreateNotificationSubscription_StringNotificationsubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/AsyncDeleteNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/AsyncDeleteNotificationSubscription.java new file mode 100644 index 000000000000..5b799922762a --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/AsyncDeleteNotificationSubscription.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_DeleteNotificationSubscription_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_DeleteNotificationSubscription_async] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscription.java new file mode 100644 index 000000000000..7950938e3108 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscription.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_DeleteNotificationSubscription_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1.DeleteNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_DeleteNotificationSubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionNotificationsubscriptionname.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionNotificationsubscriptionname.java new file mode 100644 index 000000000000..c5642d78d2b3 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionNotificationsubscriptionname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_DeleteNotificationSubscription_Notificationsubscriptionname_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_DeleteNotificationSubscription_Notificationsubscriptionname_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionString.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionString.java new file mode 100644 index 000000000000..dd94cdca4863 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/deletenotificationsubscription/SyncDeleteNotificationSubscriptionString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_DeleteNotificationSubscription_String_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_DeleteNotificationSubscription_String_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/AsyncGetNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/AsyncGetNotificationSubscription.java new file mode 100644 index 000000000000..8016200e48c6 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/AsyncGetNotificationSubscription.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_GetNotificationSubscription_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_GetNotificationSubscription_async] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscription.java new file mode 100644 index 000000000000..02513df3eea4 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscription.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_GetNotificationSubscription_sync] +import com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionRequest; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_GetNotificationSubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionNotificationsubscriptionname.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionNotificationsubscriptionname.java new file mode 100644 index 000000000000..9d0fc0c416ff --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionNotificationsubscriptionname.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_GetNotificationSubscription_Notificationsubscriptionname_sync] +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_GetNotificationSubscription_Notificationsubscriptionname_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionString.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionString.java new file mode 100644 index 000000000000..ec623234db8c --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscription/SyncGetNotificationSubscriptionString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_GetNotificationSubscription_String_sync] +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionName; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_GetNotificationSubscription_String_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/AsyncGetNotificationSubscriptionHealthMetrics.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/AsyncGetNotificationSubscriptionHealthMetrics.java new file mode 100644 index 000000000000..c0c8be89b60f --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/AsyncGetNotificationSubscriptionHealthMetrics.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_GetNotificationSubscriptionHealthMetrics_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetricsName; +import com.google.shopping.merchant.notifications.v1.NotificationsApiServiceClient; + +public class AsyncGetNotificationSubscriptionHealthMetrics { + + public static void main(String[] args) throws Exception { + asyncGetNotificationSubscriptionHealthMetrics(); + } + + public static void asyncGetNotificationSubscriptionHealthMetrics() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying 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()) { + GetNotificationSubscriptionHealthMetricsRequest request = + GetNotificationSubscriptionHealthMetricsRequest.newBuilder() + .setName( + NotificationSubscriptionHealthMetricsName.of( + "[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .build(); + ApiFuture future = + notificationsApiServiceClient + .getNotificationSubscriptionHealthMetricsCallable() + .futureCall(request); + // Do something. + NotificationSubscriptionHealthMetrics response = future.get(); + } + } +} +// [END merchantapi_v1_generated_NotificationsApiService_GetNotificationSubscriptionHealthMetrics_async] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/SyncGetNotificationSubscriptionHealthMetrics.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/SyncGetNotificationSubscriptionHealthMetrics.java new file mode 100644 index 000000000000..50d2d7d04950 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/SyncGetNotificationSubscriptionHealthMetrics.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_GetNotificationSubscriptionHealthMetrics_sync] +import com.google.shopping.merchant.notifications.v1.GetNotificationSubscriptionHealthMetricsRequest; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetricsName; +import com.google.shopping.merchant.notifications.v1.NotificationsApiServiceClient; + +public class SyncGetNotificationSubscriptionHealthMetrics { + + public static void main(String[] args) throws Exception { + syncGetNotificationSubscriptionHealthMetrics(); + } + + public static void syncGetNotificationSubscriptionHealthMetrics() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying 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()) { + GetNotificationSubscriptionHealthMetricsRequest request = + GetNotificationSubscriptionHealthMetricsRequest.newBuilder() + .setName( + NotificationSubscriptionHealthMetricsName.of( + "[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString()) + .build(); + NotificationSubscriptionHealthMetrics response = + notificationsApiServiceClient.getNotificationSubscriptionHealthMetrics(request); + } + } +} +// [END merchantapi_v1_generated_NotificationsApiService_GetNotificationSubscriptionHealthMetrics_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/SyncGetNotificationSubscriptionHealthMetricsNotificationsubscriptionhealthmetricsname.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/SyncGetNotificationSubscriptionHealthMetricsNotificationsubscriptionhealthmetricsname.java new file mode 100644 index 000000000000..e9a9d82822f5 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/SyncGetNotificationSubscriptionHealthMetricsNotificationsubscriptionhealthmetricsname.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_GetNotificationSubscriptionHealthMetrics_Notificationsubscriptionhealthmetricsname_sync] +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetricsName; +import com.google.shopping.merchant.notifications.v1.NotificationsApiServiceClient; + +public class SyncGetNotificationSubscriptionHealthMetricsNotificationsubscriptionhealthmetricsname { + + public static void main(String[] args) throws Exception { + syncGetNotificationSubscriptionHealthMetricsNotificationsubscriptionhealthmetricsname(); + } + + public static void + syncGetNotificationSubscriptionHealthMetricsNotificationsubscriptionhealthmetricsname() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying 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()) { + NotificationSubscriptionHealthMetricsName name = + NotificationSubscriptionHealthMetricsName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]"); + NotificationSubscriptionHealthMetrics response = + notificationsApiServiceClient.getNotificationSubscriptionHealthMetrics(name); + } + } +} +// [END merchantapi_v1_generated_NotificationsApiService_GetNotificationSubscriptionHealthMetrics_Notificationsubscriptionhealthmetricsname_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/SyncGetNotificationSubscriptionHealthMetricsString.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/SyncGetNotificationSubscriptionHealthMetricsString.java new file mode 100644 index 000000000000..7100ca39a704 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/getnotificationsubscriptionhealthmetrics/SyncGetNotificationSubscriptionHealthMetricsString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_GetNotificationSubscriptionHealthMetrics_String_sync] +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetrics; +import com.google.shopping.merchant.notifications.v1.NotificationSubscriptionHealthMetricsName; +import com.google.shopping.merchant.notifications.v1.NotificationsApiServiceClient; + +public class SyncGetNotificationSubscriptionHealthMetricsString { + + public static void main(String[] args) throws Exception { + syncGetNotificationSubscriptionHealthMetricsString(); + } + + public static void syncGetNotificationSubscriptionHealthMetricsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying 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 = + NotificationSubscriptionHealthMetricsName.of("[ACCOUNT]", "[NOTIFICATION_SUBSCRIPTION]") + .toString(); + NotificationSubscriptionHealthMetrics response = + notificationsApiServiceClient.getNotificationSubscriptionHealthMetrics(name); + } + } +} +// [END merchantapi_v1_generated_NotificationsApiService_GetNotificationSubscriptionHealthMetrics_String_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptions.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptions.java new file mode 100644 index 000000000000..f724da215a3f --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptions.java @@ -0,0 +1,57 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_ListNotificationSubscriptions_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.notifications.v1.AccountName; +import com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_ListNotificationSubscriptions_async] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptionsPaged.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptionsPaged.java new file mode 100644 index 000000000000..52c67333fcae --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/AsyncListNotificationSubscriptionsPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_ListNotificationSubscriptions_Paged_async] +import com.google.common.base.Strings; +import com.google.shopping.merchant.notifications.v1.AccountName; +import com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsResponse; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_ListNotificationSubscriptions_Paged_async] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptions.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptions.java new file mode 100644 index 000000000000..0858ea72fb4c --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_ListNotificationSubscriptions_sync] +import com.google.shopping.merchant.notifications.v1.AccountName; +import com.google.shopping.merchant.notifications.v1.ListNotificationSubscriptionsRequest; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_ListNotificationSubscriptions_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsAccountname.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsAccountname.java new file mode 100644 index 000000000000..0bf8b872fc9c --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsAccountname.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_ListNotificationSubscriptions_Accountname_sync] +import com.google.shopping.merchant.notifications.v1.AccountName; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_ListNotificationSubscriptions_Accountname_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsString.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsString.java new file mode 100644 index 000000000000..f0f194c632fd --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/listnotificationsubscriptions/SyncListNotificationSubscriptionsString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_ListNotificationSubscriptions_String_sync] +import com.google.shopping.merchant.notifications.v1.AccountName; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_ListNotificationSubscriptions_String_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/updatenotificationsubscription/AsyncUpdateNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/updatenotificationsubscription/AsyncUpdateNotificationSubscription.java new file mode 100644 index 000000000000..f1c78c4eae03 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/updatenotificationsubscription/AsyncUpdateNotificationSubscription.java @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_UpdateNotificationSubscription_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.NotificationsApiServiceClient; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_UpdateNotificationSubscription_async] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscription.java new file mode 100644 index 000000000000..b8a6736e4eeb --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscription.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_UpdateNotificationSubscription_sync] +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.NotificationsApiServiceClient; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_UpdateNotificationSubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscriptionNotificationsubscriptionFieldmask.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscriptionNotificationsubscriptionFieldmask.java new file mode 100644 index 000000000000..0a1d5c54a33c --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservice/updatenotificationsubscription/SyncUpdateNotificationSubscriptionNotificationsubscriptionFieldmask.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.notifications.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiService_UpdateNotificationSubscription_NotificationsubscriptionFieldmask_sync] +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.notifications.v1.NotificationSubscription; +import com.google.shopping.merchant.notifications.v1.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_v1_generated_NotificationsApiService_UpdateNotificationSubscription_NotificationsubscriptionFieldmask_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservicesettings/getnotificationsubscription/SyncGetNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservicesettings/getnotificationsubscription/SyncGetNotificationSubscription.java new file mode 100644 index 000000000000..bcc6ce9c7957 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/notificationsapiservicesettings/getnotificationsubscription/SyncGetNotificationSubscription.java @@ -0,0 +1,57 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.v1.samples; + +// [START merchantapi_v1_generated_NotificationsApiServiceSettings_GetNotificationSubscription_sync] +import com.google.shopping.merchant.notifications.v1.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() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + NotificationsApiServiceSettings notificationsApiServiceSettings = + notificationsApiServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1_generated_NotificationsApiServiceSettings_GetNotificationSubscription_sync] diff --git a/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/stub/notificationsapiservicestubsettings/getnotificationsubscription/SyncGetNotificationSubscription.java b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/stub/notificationsapiservicestubsettings/getnotificationsubscription/SyncGetNotificationSubscription.java new file mode 100644 index 000000000000..0cea4b4eb5f6 --- /dev/null +++ b/java-shopping-merchant-notifications/samples/snippets/generated/com/google/shopping/merchant/notifications/v1/stub/notificationsapiservicestubsettings/getnotificationsubscription/SyncGetNotificationSubscription.java @@ -0,0 +1,57 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.v1.stub.samples; + +// [START merchantapi_v1_generated_NotificationsApiServiceStubSettings_GetNotificationSubscription_sync] +import com.google.shopping.merchant.notifications.v1.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() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + NotificationsApiServiceStubSettings notificationsApiServiceSettings = + notificationsApiServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1_generated_NotificationsApiServiceStubSettings_GetNotificationSubscription_sync] diff --git a/versions.txt b/versions.txt index 7a03a2839a57..39207ae973fe 100644 --- a/versions.txt +++ b/versions.txt @@ -903,3 +903,5 @@ grpc-google-shopping-merchant-reports-v1:0.46.0:0.47.0-SNAPSHOT google-cloud-saasservicemgmt:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-saasservicemgmt-v1beta1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-saasservicemgmt-v1beta1:0.0.0:0.0.1-SNAPSHOT +proto-google-shopping-merchant-notifications-v1:0.29.0:0.30.0-SNAPSHOT +grpc-google-shopping-merchant-notifications-v1:0.29.0:0.30.0-SNAPSHOT