# Class SnoozeServiceClient (3.94.0)

3.94.0 (latest) 3.92.0 3.89.0 3.88.0 3.86.0 3.84.0 3.83.0 3.81.0 3.79.0 3.77.0 3.76.0 3.75.0 3.74.0 3.73.0 3.71.0 3.69.0 3.68.0 3.65.0 3.64.0 3.63.0 3.61.0 3.60.0 3.59.0 3.58.0 3.57.0 3.56.0 3.55.0 3.54.0 3.53.0 3.52.0 3.50.0 3.49.0 3.48.0 3.47.0 3.46.0 3.45.0 3.44.0 3.43.0 3.42.0 3.41.0 3.40.0 3.38.0 3.37.0 3.36.0 3.35.0 3.34.0 3.33.0 3.32.0 3.31.0 3.30.0 3.29.0 3.28.0 3.25.0 3.24.0 3.23.0 3.22.0 3.21.0 3.20.0 3.19.0 3.18.0 3.17.0 3.16.0 3.15.0 3.14.0 3.13.0 3.12.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.6 3.3.6 3.2.10

|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-monitoring/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/SnoozeServiceClient.java) | [Product Reference](https://cloud.google.com/monitoring/docs) |

Service Description: The SnoozeService API is used to temporarily prevent an alert policy from
generating alerts. A Snooze is a description of the criteria under which one or more alert
policies should not fire alerts for the specified duration.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       ProjectName parent = ProjectName.of("[PROJECT]");
       Snooze snooze = Snooze.newBuilder().build();
       Snooze response = snoozeServiceClient.createSnooze(parent, snooze);
     }
     
Note: close() needs to be called on the SnoozeServiceClient 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 |
|---|---|---|
| CreateSnooze | Creates a `Snooze` that will prevent alerts, which match the provided criteria, from being opened. The `Snooze` applies for a specific time interval. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createSnooze(CreateSnoozeRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - createSnooze(ProjectName parent, Snooze snooze) - createSnooze(String parent, Snooze snooze) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createSnoozeCallable() |
| ListSnoozes | Lists the `Snooze`s associated with a project. Can optionally pass in `filter`, which specifies predicates to match `Snooze`s. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listSnoozes(ListSnoozesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listSnoozes(ProjectName parent) - listSnoozes(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. - listSnoozesPagedCallable() - listSnoozesCallable() |
| GetSnooze | Retrieves a `Snooze` by `name`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getSnooze(GetSnoozeRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getSnooze(SnoozeName name) - getSnooze(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. - getSnoozeCallable() |
| UpdateSnooze | Updates a `Snooze`, identified by its `name`, with the parameters in the given `Snooze` object. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateSnooze(UpdateSnoozeRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - updateSnooze(Snooze snooze, 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. - updateSnoozeCallable() |
[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 SnoozeServiceSettings 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
     SnoozeServiceSettings snoozeServiceSettings =
         SnoozeServiceSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create(snoozeServiceSettings);
     
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
     SnoozeServiceSettings snoozeServiceSettings =
         SnoozeServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
     SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create(snoozeServiceSettings);
     
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) \> SnoozeServiceClient

## Static Methods

### create()

    public static final SnoozeServiceClient create()

Constructs an instance of SnoozeServiceClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.SnoozeServiceClient` |   |

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

### create(SnoozeServiceSettings settings)

    public static final SnoozeServiceClient create(SnoozeServiceSettings settings)

Constructs an instance of SnoozeServiceClient, 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-cloud-monitoring/latest/com.google.cloud.monitoring.v3.SnoozeServiceSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.SnoozeServiceClient` |   |

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

### create(SnoozeServiceStub stub)

    public static final SnoozeServiceClient create(SnoozeServiceStub stub)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.stub.SnoozeServiceStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.SnoozeServiceClient` |   |

## Constructors

### SnoozeServiceClient(SnoozeServiceSettings settings)

    protected SnoozeServiceClient(SnoozeServiceSettings settings)

Constructs an instance of SnoozeServiceClient, 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-cloud-monitoring/latest/com.google.cloud.monitoring.v3.SnoozeServiceSettings` |

### SnoozeServiceClient(SnoozeServiceStub stub)

    protected SnoozeServiceClient(SnoozeServiceStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.stub.SnoozeServiceStub` |

## 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()

### createSnooze(CreateSnoozeRequest request)

    public final Snooze createSnooze(CreateSnoozeRequest request)

Creates a `Snooze` that will prevent alerts, which match the provided criteria, from being
opened. The `Snooze` applies for a specific time interval.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       CreateSnoozeRequest request =
           CreateSnoozeRequest.newBuilder()
               .setParent(ProjectName.of("[PROJECT]").toString())
               .setSnooze(Snooze.newBuilder().build())
               .build();
       Snooze response = snoozeServiceClient.createSnooze(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.CreateSnoozeRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze` |   |

### createSnooze(ProjectName parent, Snooze snooze)

    public final Snooze createSnooze(ProjectName parent, Snooze snooze)

Creates a `Snooze` that will prevent alerts, which match the provided criteria, from being
opened. The `Snooze` applies for a specific time interval.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       ProjectName parent = ProjectName.of("[PROJECT]");
       Snooze snooze = Snooze.newBuilder().build();
       Snooze response = snoozeServiceClient.createSnooze(parent, snooze);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ProjectName` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in which a `Snooze` should be created. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |
| `snooze` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze` Required. The `Snooze` to create. Omit the `name` field, as it will be filled in by the API. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze` |   |

### createSnooze(String parent, Snooze snooze)

    public final Snooze createSnooze(String parent, Snooze snooze)

Creates a `Snooze` that will prevent alerts, which match the provided criteria, from being
opened. The `Snooze` applies for a specific time interval.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       String parent = ProjectName.of("[PROJECT]").toString();
       Snooze snooze = Snooze.newBuilder().build();
       Snooze response = snoozeServiceClient.createSnooze(parent, snooze);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in which a `Snooze` should be created. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |
| `snooze` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze` Required. The `Snooze` to create. Omit the `name` field, as it will be filled in by the API. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze` |   |

### createSnoozeCallable()

    public final UnaryCallable<CreateSnoozeRequest,Snooze> createSnoozeCallable()

Creates a `Snooze` that will prevent alerts, which match the provided criteria, from being
opened. The `Snooze` applies for a specific time interval.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       CreateSnoozeRequest request =
           CreateSnoozeRequest.newBuilder()
               .setParent(ProjectName.of("[PROJECT]").toString())
               .setSnooze(Snooze.newBuilder().build())
               .build();
       ApiFuture<Snooze> future = snoozeServiceClient.createSnoozeCallable().futureCall(request);
       // Do something.
       Snooze 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-cloud-monitoring/latest/com.google.monitoring.v3.CreateSnoozeRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze>` |   |

### getSettings()

    public final SnoozeServiceSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.SnoozeServiceSettings` |   |

### getSnooze(GetSnoozeRequest request)

    public final Snooze getSnooze(GetSnoozeRequest request)

Retrieves a `Snooze` by `name`.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       GetSnoozeRequest request =
           GetSnoozeRequest.newBuilder()
               .setName(SnoozeName.of("[PROJECT]", "[SNOOZE]").toString())
               .build();
       Snooze response = snoozeServiceClient.getSnooze(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.GetSnoozeRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze` |   |

### getSnooze(SnoozeName name)

    public final Snooze getSnooze(SnoozeName name)

Retrieves a `Snooze` by `name`.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       SnoozeName name = SnoozeName.of("[PROJECT]", "[SNOOZE]");
       Snooze response = snoozeServiceClient.getSnooze(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.SnoozeName` Required. The ID of the `Snooze` to retrieve. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/snoozes/\[SNOOZE_ID\] |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze` |   |

### getSnooze(String name)

    public final Snooze getSnooze(String name)

Retrieves a `Snooze` by `name`.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       String name = SnoozeName.of("[PROJECT]", "[SNOOZE]").toString();
       Snooze response = snoozeServiceClient.getSnooze(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID of the `Snooze` to retrieve. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/snoozes/\[SNOOZE_ID\] |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze` |   |

### getSnoozeCallable()

    public final UnaryCallable<GetSnoozeRequest,Snooze> getSnoozeCallable()

Retrieves a `Snooze` by `name`.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       GetSnoozeRequest request =
           GetSnoozeRequest.newBuilder()
               .setName(SnoozeName.of("[PROJECT]", "[SNOOZE]").toString())
               .build();
       ApiFuture<Snooze> future = snoozeServiceClient.getSnoozeCallable().futureCall(request);
       // Do something.
       Snooze 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-cloud-monitoring/latest/com.google.monitoring.v3.GetSnoozeRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze>` |   |

### getStub()

    public SnoozeServiceStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.stub.SnoozeServiceStub` |   |

### 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` |   |

### listSnoozes(ListSnoozesRequest request)

    public final SnoozeServiceClient.ListSnoozesPagedResponse listSnoozes(ListSnoozesRequest request)

Lists the `Snooze`s associated with a project. Can optionally pass in `filter`, which specifies
predicates to match `Snooze`s.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       ListSnoozesRequest request =
           ListSnoozesRequest.newBuilder()
               .setParent(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (Snooze element : snoozeServiceClient.listSnoozes(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListSnoozesRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.SnoozeServiceClient.ListSnoozesPagedResponse` |   |

### listSnoozes(ProjectName parent)

    public final SnoozeServiceClient.ListSnoozesPagedResponse listSnoozes(ProjectName parent)

Lists the `Snooze`s associated with a project. Can optionally pass in `filter`, which specifies
predicates to match `Snooze`s.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       ProjectName parent = ProjectName.of("[PROJECT]");
       for (Snooze element : snoozeServiceClient.listSnoozes(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ProjectName` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) whose `Snooze`s should be listed. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.SnoozeServiceClient.ListSnoozesPagedResponse` |   |

### listSnoozes(String parent)

    public final SnoozeServiceClient.ListSnoozesPagedResponse listSnoozes(String parent)

Lists the `Snooze`s associated with a project. Can optionally pass in `filter`, which specifies
predicates to match `Snooze`s.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       String parent = ProjectName.of("[PROJECT]").toString();
       for (Snooze element : snoozeServiceClient.listSnoozes(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) whose `Snooze`s should be listed. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.SnoozeServiceClient.ListSnoozesPagedResponse` |   |

### listSnoozesCallable()

    public final UnaryCallable<ListSnoozesRequest,ListSnoozesResponse> listSnoozesCallable()

Lists the `Snooze`s associated with a project. Can optionally pass in `filter`, which specifies
predicates to match `Snooze`s.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       ListSnoozesRequest request =
           ListSnoozesRequest.newBuilder()
               .setParent(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListSnoozesResponse response = snoozeServiceClient.listSnoozesCallable().call(request);
         for (Snooze element : response.getSnoozesList()) {
           // 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-cloud-monitoring/latest/com.google.monitoring.v3.ListSnoozesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListSnoozesResponse>` |   |

### listSnoozesPagedCallable()

    public final UnaryCallable<ListSnoozesRequest,SnoozeServiceClient.ListSnoozesPagedResponse> listSnoozesPagedCallable()

Lists the `Snooze`s associated with a project. Can optionally pass in `filter`, which specifies
predicates to match `Snooze`s.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       ListSnoozesRequest request =
           ListSnoozesRequest.newBuilder()
               .setParent(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<Snooze> future = snoozeServiceClient.listSnoozesPagedCallable().futureCall(request);
       // Do something.
       for (Snooze 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-cloud-monitoring/latest/com.google.monitoring.v3.ListSnoozesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.SnoozeServiceClient.ListSnoozesPagedResponse>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### updateSnooze(Snooze snooze, FieldMask updateMask)

    public final Snooze updateSnooze(Snooze snooze, FieldMask updateMask)

Updates a `Snooze`, identified by its `name`, with the parameters in the given `Snooze` object.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       Snooze snooze = Snooze.newBuilder().build();
       FieldMask updateMask = FieldMask.newBuilder().build();
       Snooze response = snoozeServiceClient.updateSnooze(snooze, updateMask);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `snooze` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze` Required. The `Snooze` to update. Must have the name field present. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` Required. The fields to update. For each field listed in `update_mask`: \* If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a value for that field, the value of the field in the existing `Snooze` will be set to the value of the field in the supplied `Snooze`. \* If the field does not have a value in the supplied `Snooze`, the field in the existing `Snooze` is set to its default value. Fields not listed retain their existing value. The following are the field names that are accepted in `update_mask`: \* `display_name` \* `interval.start_time` \* `interval.end_time` That said, the start time and end time of the `Snooze` determines which fields can legally be updated. Before attempting an update, users should consult the documentation for `UpdateSnoozeRequest`, which talks about which fields can be updated. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze` |   |

### updateSnooze(UpdateSnoozeRequest request)

    public final Snooze updateSnooze(UpdateSnoozeRequest request)

Updates a `Snooze`, identified by its `name`, with the parameters in the given `Snooze` object.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       UpdateSnoozeRequest request =
           UpdateSnoozeRequest.newBuilder()
               .setSnooze(Snooze.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Snooze response = snoozeServiceClient.updateSnooze(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.UpdateSnoozeRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze` |   |

### updateSnoozeCallable()

    public final UnaryCallable<UpdateSnoozeRequest,Snooze> updateSnoozeCallable()

Updates a `Snooze`, identified by its `name`, with the parameters in the given `Snooze` object.

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 (SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.create()) {
       UpdateSnoozeRequest request =
           UpdateSnoozeRequest.newBuilder()
               .setSnooze(Snooze.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Snooze> future = snoozeServiceClient.updateSnoozeCallable().futureCall(request);
       // Do something.
       Snooze 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-cloud-monitoring/latest/com.google.monitoring.v3.UpdateSnoozeRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.Snooze>` |   |