# Class NotificationsApiServiceClient (1.21.0)

1.21.0 (latest) 1.19.0 1.16.0 1.15.0 1.13.0 1.11.0 1.10.0 1.8.0 1.6.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0 0.29.0 0.27.0 0.26.0 0.23.0 0.22.0 0.21.0 0.19.0 0.18.0 0.17.0 0.16.0 0.15.0 0.14.0 0.13.0 0.12.0 0.11.0 0.10.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.0

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-shopping-merchant-notifications/google-shopping-merchant-notifications/src/main/java/com/google/shopping/merchant/notifications/v1beta/NotificationsApiServiceClient.java) | [Product Reference](https://developers.google.com/merchant/api) |

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:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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().

| Method | Description | Method Variants |
|---|---|---|
| GetNotificationSubscription | Gets notification subscriptions for an account. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getNotificationSubscription(GetNotificationSubscriptionRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getNotificationSubscription(NotificationSubscriptionName name) - getNotificationSubscription(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getNotificationSubscriptionCallable() |
| CreateNotificationSubscription | Creates a notification subscription for a merchant. We will allow the following types of notification subscriptions to exist together (per merchant as a subscriber per event type): 1. Subscription for all managed accounts + subscription for self 2. Multiple "partial" subscriptions for managed accounts + subscription for self we will not allow (per merchant as a subscriber per event type): 1. multiple self subscriptions. 2. multiple "all managed accounts" subscriptions. 3. all and partial subscriptions at the same time. 4. multiple partial subscriptions for the same target account | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createNotificationSubscription(CreateNotificationSubscriptionRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - createNotificationSubscription(AccountName parent, NotificationSubscription notificationSubscription) - createNotificationSubscription(String parent, NotificationSubscription notificationSubscription) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createNotificationSubscriptionCallable() |
| UpdateNotificationSubscription | Updates an existing notification subscription for a merchant. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateNotificationSubscription(UpdateNotificationSubscriptionRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - updateNotificationSubscription(NotificationSubscription notificationSubscription, FieldMask updateMask) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateNotificationSubscriptionCallable() |
| DeleteNotificationSubscription | Deletes a notification subscription for a merchant. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteNotificationSubscription(DeleteNotificationSubscriptionRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - deleteNotificationSubscription(NotificationSubscriptionName name) - deleteNotificationSubscription(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteNotificationSubscriptionCallable() |
| ListNotificationSubscriptions | Gets all the notification subscriptions for a merchant. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listNotificationSubscriptions(ListNotificationSubscriptionsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listNotificationSubscriptions(AccountName parent) - listNotificationSubscriptions(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listNotificationSubscriptionsPagedCallable() - listNotificationSubscriptionsCallable() |
[Methods]

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:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require 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:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require 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:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require 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.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> NotificationsApiServiceClient

## Static Methods

### create()

    public static final NotificationsApiServiceClient create()

Constructs an instance of NotificationsApiServiceClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(NotificationsApiServiceSettings settings)

    public static final NotificationsApiServiceClient create(NotificationsApiServiceSettings settings)

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(NotificationsApiServiceStub stub)

    public static final NotificationsApiServiceClient create(NotificationsApiServiceStub stub)

Constructs an instance of NotificationsApiServiceClient, using the given stub for making calls.
This is for advanced usage - prefer using create(NotificationsApiServiceSettings).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.stub.NotificationsApiServiceStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient` |   |

## Constructors

### NotificationsApiServiceClient(NotificationsApiServiceSettings settings)

    protected NotificationsApiServiceClient(NotificationsApiServiceSettings settings)

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceSettings` |

### NotificationsApiServiceClient(NotificationsApiServiceStub stub)

    protected NotificationsApiServiceClient(NotificationsApiServiceStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.stub.NotificationsApiServiceStub` |

## Methods

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### close()

    public final void close()

### createNotificationSubscription(AccountName parent, NotificationSubscription notificationSubscription)

    public final NotificationSubscription createNotificationSubscription(AccountName parent, NotificationSubscription notificationSubscription)

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

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.AccountName` Required. The merchant account that owns the new notification subscription. Format: `accounts/{account}` |
| `notificationSubscription` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription` Required. The notification subscription to create. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription` |   |

### createNotificationSubscription(CreateNotificationSubscriptionRequest request)

    public final NotificationSubscription createNotificationSubscription(CreateNotificationSubscriptionRequest request)

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

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription` |   |

### createNotificationSubscription(String parent, NotificationSubscription notificationSubscription)

    public final NotificationSubscription createNotificationSubscription(String parent, NotificationSubscription notificationSubscription)

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

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The merchant account that owns the new notification subscription. Format: `accounts/{account}` |
| `notificationSubscription` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription` Required. The notification subscription to create. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription` |   |

### createNotificationSubscriptionCallable()

    public final UnaryCallable<CreateNotificationSubscriptionRequest,NotificationSubscription> createNotificationSubscriptionCallable()

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

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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<NotificationSubscription> future =
           notificationsApiServiceClient
               .createNotificationSubscriptionCallable()
               .futureCall(request);
       // Do something.
       NotificationSubscription response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest,https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription>` |   |

### deleteNotificationSubscription(DeleteNotificationSubscriptionRequest request)

    public final void deleteNotificationSubscription(DeleteNotificationSubscriptionRequest request)

Deletes a notification subscription for a merchant.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest` The request object containing all of the parameters for the API call. |

### deleteNotificationSubscription(NotificationSubscriptionName name)

    public final void deleteNotificationSubscription(NotificationSubscriptionName name)

Deletes a notification subscription for a merchant.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionName` Required. The name of the notification subscription to be deleted. |

### deleteNotificationSubscription(String name)

    public final void deleteNotificationSubscription(String name)

Deletes a notification subscription for a merchant.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the notification subscription to be deleted. |

### deleteNotificationSubscriptionCallable()

    public final UnaryCallable<DeleteNotificationSubscriptionRequest,Empty> deleteNotificationSubscriptionCallable()

Deletes a notification subscription for a merchant.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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<Empty> future =
           notificationsApiServiceClient
               .deleteNotificationSubscriptionCallable()
               .futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### getNotificationSubscription(GetNotificationSubscriptionRequest request)

    public final NotificationSubscription getNotificationSubscription(GetNotificationSubscriptionRequest request)

Gets notification subscriptions for an account.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription` |   |

### getNotificationSubscription(NotificationSubscriptionName name)

    public final NotificationSubscription getNotificationSubscription(NotificationSubscriptionName name)

Gets notification subscriptions for an account.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscriptionName` Required. The `name` of the notification subscription. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription` |   |

### getNotificationSubscription(String name)

    public final NotificationSubscription getNotificationSubscription(String name)

Gets notification subscriptions for an account.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The `name` of the notification subscription. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription` |   |

### getNotificationSubscriptionCallable()

    public final UnaryCallable<GetNotificationSubscriptionRequest,NotificationSubscription> getNotificationSubscriptionCallable()

Gets notification subscriptions for an account.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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<NotificationSubscription> future =
           notificationsApiServiceClient.getNotificationSubscriptionCallable().futureCall(request);
       // Do something.
       NotificationSubscription response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest,https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription>` |   |

### getSettings()

    public final NotificationsApiServiceSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceSettings` |   |

### getStub()

    public NotificationsApiServiceStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.stub.NotificationsApiServiceStub` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### listNotificationSubscriptions(AccountName parent)

    public final NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse listNotificationSubscriptions(AccountName parent)

Gets all the notification subscriptions for a merchant.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.AccountName` Required. The merchant account who owns the notification subscriptions. Format: `accounts/{account}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse` |   |

### listNotificationSubscriptions(ListNotificationSubscriptionsRequest request)

    public final NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse listNotificationSubscriptions(ListNotificationSubscriptionsRequest request)

Gets all the notification subscriptions for a merchant.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse` |   |

### listNotificationSubscriptions(String parent)

    public final NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse listNotificationSubscriptions(String parent)

Gets all the notification subscriptions for a merchant.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The merchant account who owns the notification subscriptions. Format: `accounts/{account}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse` |   |

### listNotificationSubscriptionsCallable()

    public final UnaryCallable<ListNotificationSubscriptionsRequest,ListNotificationSubscriptionsResponse> listNotificationSubscriptionsCallable()

Gets all the notification subscriptions for a merchant.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest,https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse>` |   |

### listNotificationSubscriptionsPagedCallable()

    public final UnaryCallable<ListNotificationSubscriptionsRequest,NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse> listNotificationSubscriptionsPagedCallable()

Gets all the notification subscriptions for a merchant.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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<NotificationSubscription> future =
           notificationsApiServiceClient
               .listNotificationSubscriptionsPagedCallable()
               .futureCall(request);
       // Do something.
       for (NotificationSubscription element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest,https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationsApiServiceClient.ListNotificationSubscriptionsPagedResponse>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### updateNotificationSubscription(NotificationSubscription notificationSubscription, FieldMask updateMask)

    public final NotificationSubscription updateNotificationSubscription(NotificationSubscription notificationSubscription, FieldMask updateMask)

Updates an existing notification subscription for a merchant.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `notificationSubscription` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription` Required. The new version of the notification subscription that should be updated. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` List of fields being updated. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription` |   |

### updateNotificationSubscription(UpdateNotificationSubscriptionRequest request)

    public final NotificationSubscription updateNotificationSubscription(UpdateNotificationSubscriptionRequest request)

Updates an existing notification subscription for a merchant.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription` |   |

### updateNotificationSubscriptionCallable()

    public final UnaryCallable<UpdateNotificationSubscriptionRequest,NotificationSubscription> updateNotificationSubscriptionCallable()

Updates an existing notification subscription for a merchant.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying 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<NotificationSubscription> future =
           notificationsApiServiceClient
               .updateNotificationSubscriptionCallable()
               .futureCall(request);
       // Do something.
       NotificationSubscription response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest,https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/com.google.shopping.merchant.notifications.v1beta.NotificationSubscription>` |   |