# Class MetricServiceClient (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/MetricServiceClient.java) | [Product Reference](https://cloud.google.com/monitoring/docs) |

Service Description: Manages metric descriptors, monitored resource descriptors, and time series
data.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       MonitoredResourceDescriptorName name =
           MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
               "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
       MonitoredResourceDescriptor response =
           metricServiceClient.getMonitoredResourceDescriptor(name);
     }
     
Note: close() needs to be called on the MetricServiceClient 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 |
|---|---|---|
| ListMonitoredResourceDescriptors | Lists monitored resource descriptors that match a filter. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listMonitoredResourceDescriptors(ResourceName name) - listMonitoredResourceDescriptors(OrganizationName name) - listMonitoredResourceDescriptors(ProjectName name) - listMonitoredResourceDescriptors(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. - listMonitoredResourceDescriptorsPagedCallable() - listMonitoredResourceDescriptorsCallable() |
| GetMonitoredResourceDescriptor | Gets a single monitored resource descriptor. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getMonitoredResourceDescriptor(GetMonitoredResourceDescriptorRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getMonitoredResourceDescriptor(MonitoredResourceDescriptorName name) - getMonitoredResourceDescriptor(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. - getMonitoredResourceDescriptorCallable() |
| ListMetricDescriptors | Lists metric descriptors that match a filter. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listMetricDescriptors(ListMetricDescriptorsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listMetricDescriptors(ResourceName name) - listMetricDescriptors(OrganizationName name) - listMetricDescriptors(ProjectName name) - listMetricDescriptors(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. - listMetricDescriptorsPagedCallable() - listMetricDescriptorsCallable() |
| GetMetricDescriptor | Gets a single metric descriptor. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getMetricDescriptor(GetMetricDescriptorRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getMetricDescriptor(MetricDescriptorName name) - getMetricDescriptor(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. - getMetricDescriptorCallable() |
| CreateMetricDescriptor | Creates a new metric descriptor. The creation is executed asynchronously. User-created metric descriptors define [custom metrics](https://cloud.google.com/monitoring/custom-metrics). The metric descriptor is updated if it already exists, except that metric labels are never removed. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createMetricDescriptor(CreateMetricDescriptorRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - createMetricDescriptor(ResourceName name, MetricDescriptor metricDescriptor) - createMetricDescriptor(OrganizationName name, MetricDescriptor metricDescriptor) - createMetricDescriptor(ProjectName name, MetricDescriptor metricDescriptor) - createMetricDescriptor(String name, MetricDescriptor metricDescriptor) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createMetricDescriptorCallable() |
| DeleteMetricDescriptor | Deletes a metric descriptor. Only user-created [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be deleted. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteMetricDescriptor(DeleteMetricDescriptorRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - deleteMetricDescriptor(MetricDescriptorName name) - deleteMetricDescriptor(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. - deleteMetricDescriptorCallable() |
| ListTimeSeries | Lists time series that match a filter. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listTimeSeries(ListTimeSeriesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listTimeSeries(ResourceName name, String filter, TimeInterval interval, ListTimeSeriesRequest.TimeSeriesView view) - listTimeSeries(OrganizationName name, String filter, TimeInterval interval, ListTimeSeriesRequest.TimeSeriesView view) - listTimeSeries(ProjectName name, String filter, TimeInterval interval, ListTimeSeriesRequest.TimeSeriesView view) - listTimeSeries(String name, String filter, TimeInterval interval, ListTimeSeriesRequest.TimeSeriesView view) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listTimeSeriesPagedCallable() - listTimeSeriesCallable() |
| CreateTimeSeries | Creates or adds data to one or more time series. The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response. This method does not support [resource locations constraint of an organization policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createTimeSeries(CreateTimeSeriesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - createTimeSeries(ProjectName name, List\<TimeSeries\> timeSeries) - createTimeSeries(String name, List\<TimeSeries\> timeSeries) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createTimeSeriesCallable() |
| CreateServiceTimeSeries | Creates or adds data to one or more service time series. A service time series is a time series for a metric from a Google Cloud service. The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response. This endpoint rejects writes to user-defined metrics. This method is only for use by Google Cloud services. Use projects.timeSeries.create instead. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createServiceTimeSeries(CreateTimeSeriesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - createServiceTimeSeries(ProjectName name, List\<TimeSeries\> timeSeries) - createServiceTimeSeries(String name, List\<TimeSeries\> timeSeries) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createServiceTimeSeriesCallable() |
[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 MetricServiceSettings 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
     MetricServiceSettings metricServiceSettings =
         MetricServiceSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     MetricServiceClient metricServiceClient = MetricServiceClient.create(metricServiceSettings);
     
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
     MetricServiceSettings metricServiceSettings =
         MetricServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
     MetricServiceClient metricServiceClient = MetricServiceClient.create(metricServiceSettings);
     
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) \> MetricServiceClient

## Static Methods

### create()

    public static final MetricServiceClient create()

Constructs an instance of MetricServiceClient with default settings.

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

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

### create(MetricServiceSettings settings)

    public static final MetricServiceClient create(MetricServiceSettings settings)

Constructs an instance of MetricServiceClient, 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.MetricServiceSettings` |

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

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

### create(MetricServiceStub stub)

    public static final MetricServiceClient create(MetricServiceStub stub)

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

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

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

## Constructors

### MetricServiceClient(MetricServiceSettings settings)

    protected MetricServiceClient(MetricServiceSettings settings)

Constructs an instance of MetricServiceClient, 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.MetricServiceSettings` |

### MetricServiceClient(MetricServiceStub stub)

    protected MetricServiceClient(MetricServiceStub stub)

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

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

### createMetricDescriptor(ResourceName name, MetricDescriptor metricDescriptor)

    public final MetricDescriptor createMetricDescriptor(ResourceName name, MetricDescriptor metricDescriptor)

Creates a new metric descriptor. The creation is executed asynchronously. User-created metric
descriptors define [custom metrics](https://cloud.google.com/monitoring/custom-metrics). The
metric descriptor is updated if it already exists, except that metric labels are never removed.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ResourceName name = ResourceName.of("[FOLDER]");
       MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
       MetricDescriptor response =
           metricServiceClient.createMetricDescriptor(name, metricDescriptor);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `com.google.api.resourcenames.ResourceName` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. The format is: 4 projects/\[PROJECT_ID_OR_NUMBER\] |
| `metricDescriptor` | `com.google.api.MetricDescriptor` Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) descriptor. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.MetricDescriptor` |   |

### createMetricDescriptor(CreateMetricDescriptorRequest request)

    public final MetricDescriptor createMetricDescriptor(CreateMetricDescriptorRequest request)

Creates a new metric descriptor. The creation is executed asynchronously. User-created metric
descriptors define [custom metrics](https://cloud.google.com/monitoring/custom-metrics). The
metric descriptor is updated if it already exists, except that metric labels are never removed.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       CreateMetricDescriptorRequest request =
           CreateMetricDescriptorRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .setMetricDescriptor(MetricDescriptor.newBuilder().build())
               .build();
       MetricDescriptor response = metricServiceClient.createMetricDescriptor(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.CreateMetricDescriptorRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.MetricDescriptor` |   |

### createMetricDescriptor(OrganizationName name, MetricDescriptor metricDescriptor)

    public final MetricDescriptor createMetricDescriptor(OrganizationName name, MetricDescriptor metricDescriptor)

Creates a new metric descriptor. The creation is executed asynchronously. User-created metric
descriptors define [custom metrics](https://cloud.google.com/monitoring/custom-metrics). The
metric descriptor is updated if it already exists, except that metric labels are never removed.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       OrganizationName name = OrganizationName.of("[ORGANIZATION]");
       MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
       MetricDescriptor response =
           metricServiceClient.createMetricDescriptor(name, metricDescriptor);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.OrganizationName` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. The format is: 4 projects/\[PROJECT_ID_OR_NUMBER\] |
| `metricDescriptor` | `com.google.api.MetricDescriptor` Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) descriptor. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.MetricDescriptor` |   |

### createMetricDescriptor(ProjectName name, MetricDescriptor metricDescriptor)

    public final MetricDescriptor createMetricDescriptor(ProjectName name, MetricDescriptor metricDescriptor)

Creates a new metric descriptor. The creation is executed asynchronously. User-created metric
descriptors define [custom metrics](https://cloud.google.com/monitoring/custom-metrics). The
metric descriptor is updated if it already exists, except that metric labels are never removed.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ProjectName name = ProjectName.of("[PROJECT]");
       MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
       MetricDescriptor response =
           metricServiceClient.createMetricDescriptor(name, metricDescriptor);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `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) on which to execute the request. The format is: 4 projects/\[PROJECT_ID_OR_NUMBER\] |
| `metricDescriptor` | `com.google.api.MetricDescriptor` Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) descriptor. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.MetricDescriptor` |   |

### createMetricDescriptor(String name, MetricDescriptor metricDescriptor)

    public final MetricDescriptor createMetricDescriptor(String name, MetricDescriptor metricDescriptor)

Creates a new metric descriptor. The creation is executed asynchronously. User-created metric
descriptors define [custom metrics](https://cloud.google.com/monitoring/custom-metrics). The
metric descriptor is updated if it already exists, except that metric labels are never removed.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       String name = ProjectName.of("[PROJECT]").toString();
       MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
       MetricDescriptor response =
           metricServiceClient.createMetricDescriptor(name, metricDescriptor);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. The format is: 4 projects/\[PROJECT_ID_OR_NUMBER\] |
| `metricDescriptor` | `com.google.api.MetricDescriptor` Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) descriptor. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.MetricDescriptor` |   |

### createMetricDescriptorCallable()

    public final UnaryCallable<CreateMetricDescriptorRequest,MetricDescriptor> createMetricDescriptorCallable()

Creates a new metric descriptor. The creation is executed asynchronously. User-created metric
descriptors define [custom metrics](https://cloud.google.com/monitoring/custom-metrics). The
metric descriptor is updated if it already exists, except that metric labels are never removed.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       CreateMetricDescriptorRequest request =
           CreateMetricDescriptorRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .setMetricDescriptor(MetricDescriptor.newBuilder().build())
               .build();
       ApiFuture<MetricDescriptor> future =
           metricServiceClient.createMetricDescriptorCallable().futureCall(request);
       // Do something.
       MetricDescriptor 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.CreateMetricDescriptorRequest,com.google.api.MetricDescriptor>` |   |

### createServiceTimeSeries(CreateTimeSeriesRequest request)

    public final void createServiceTimeSeries(CreateTimeSeriesRequest request)

Creates or adds data to one or more service time series. A service time series is a time series
for a metric from a Google Cloud service. The response is empty if all time series in the
request were written. If any time series could not be written, a corresponding failure message
is included in the error response. This endpoint rejects writes to user-defined metrics. This
method is only for use by Google Cloud services. Use
projects.timeSeries.create instead.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       CreateTimeSeriesRequest request =
           CreateTimeSeriesRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .addAllTimeSeries(new ArrayList<TimeSeries>())
               .build();
       metricServiceClient.createServiceTimeSeries(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.CreateTimeSeriesRequest` The request object containing all of the parameters for the API call. |

### createServiceTimeSeries(ProjectName name, List\<TimeSeries\> timeSeries)

    public final void createServiceTimeSeries(ProjectName name, List<TimeSeries> timeSeries)

Creates or adds data to one or more service time series. A service time series is a time series
for a metric from a Google Cloud service. The response is empty if all time series in the
request were written. If any time series could not be written, a corresponding failure message
is included in the error response. This endpoint rejects writes to user-defined metrics. This
method is only for use by Google Cloud services. Use
projects.timeSeries.create instead.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ProjectName name = ProjectName.of("[PROJECT]");
       List<TimeSeries> timeSeries = new ArrayList<>();
       metricServiceClient.createServiceTimeSeries(name, timeSeries);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `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) on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |
| `timeSeries` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.TimeSeries>` Required. The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each `TimeSeries` value must fully specify a unique time series by supplying all label values for the metric and the monitored resource. The maximum number of `TimeSeries` objects per `Create` request is 200. |

### createServiceTimeSeries(String name, List\<TimeSeries\> timeSeries)

    public final void createServiceTimeSeries(String name, List<TimeSeries> timeSeries)

Creates or adds data to one or more service time series. A service time series is a time series
for a metric from a Google Cloud service. The response is empty if all time series in the
request were written. If any time series could not be written, a corresponding failure message
is included in the error response. This endpoint rejects writes to user-defined metrics. This
method is only for use by Google Cloud services. Use
projects.timeSeries.create instead.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       String name = ProjectName.of("[PROJECT]").toString();
       List<TimeSeries> timeSeries = new ArrayList<>();
       metricServiceClient.createServiceTimeSeries(name, timeSeries);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |
| `timeSeries` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.TimeSeries>` Required. The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each `TimeSeries` value must fully specify a unique time series by supplying all label values for the metric and the monitored resource. The maximum number of `TimeSeries` objects per `Create` request is 200. |

### createServiceTimeSeriesCallable()

    public final UnaryCallable<CreateTimeSeriesRequest,Empty> createServiceTimeSeriesCallable()

Creates or adds data to one or more service time series. A service time series is a time series
for a metric from a Google Cloud service. The response is empty if all time series in the
request were written. If any time series could not be written, a corresponding failure message
is included in the error response. This endpoint rejects writes to user-defined metrics. This
method is only for use by Google Cloud services. Use
projects.timeSeries.create instead.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       CreateTimeSeriesRequest request =
           CreateTimeSeriesRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .addAllTimeSeries(new ArrayList<TimeSeries>())
               .build();
       ApiFuture<Empty> future =
           metricServiceClient.createServiceTimeSeriesCallable().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-cloud-monitoring/latest/com.google.monitoring.v3.CreateTimeSeriesRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### createTimeSeries(CreateTimeSeriesRequest request)

    public final void createTimeSeries(CreateTimeSeriesRequest request)

Creates or adds data to one or more time series. The response is empty if all time series in
the request were written. If any time series could not be written, a corresponding failure
message is included in the error response. This method does not support [resource locations
constraint of an organization
policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy).

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       CreateTimeSeriesRequest request =
           CreateTimeSeriesRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .addAllTimeSeries(new ArrayList<TimeSeries>())
               .build();
       metricServiceClient.createTimeSeries(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.CreateTimeSeriesRequest` The request object containing all of the parameters for the API call. |

### createTimeSeries(ProjectName name, List\<TimeSeries\> timeSeries)

    public final void createTimeSeries(ProjectName name, List<TimeSeries> timeSeries)

Creates or adds data to one or more time series. The response is empty if all time series in
the request were written. If any time series could not be written, a corresponding failure
message is included in the error response. This method does not support [resource locations
constraint of an organization
policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy).

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ProjectName name = ProjectName.of("[PROJECT]");
       List<TimeSeries> timeSeries = new ArrayList<>();
       metricServiceClient.createTimeSeries(name, timeSeries);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `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) on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |
| `timeSeries` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.TimeSeries>` Required. The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each `TimeSeries` value must fully specify a unique time series by supplying all label values for the metric and the monitored resource. The maximum number of `TimeSeries` objects per `Create` request is 200. |

### createTimeSeries(String name, List\<TimeSeries\> timeSeries)

    public final void createTimeSeries(String name, List<TimeSeries> timeSeries)

Creates or adds data to one or more time series. The response is empty if all time series in
the request were written. If any time series could not be written, a corresponding failure
message is included in the error response. This method does not support [resource locations
constraint of an organization
policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy).

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       String name = ProjectName.of("[PROJECT]").toString();
       List<TimeSeries> timeSeries = new ArrayList<>();
       metricServiceClient.createTimeSeries(name, timeSeries);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\] |
| `timeSeries` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.TimeSeries>` Required. The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each `TimeSeries` value must fully specify a unique time series by supplying all label values for the metric and the monitored resource. The maximum number of `TimeSeries` objects per `Create` request is 200. |

### createTimeSeriesCallable()

    public final UnaryCallable<CreateTimeSeriesRequest,Empty> createTimeSeriesCallable()

Creates or adds data to one or more time series. The response is empty if all time series in
the request were written. If any time series could not be written, a corresponding failure
message is included in the error response. This method does not support [resource locations
constraint of an organization
policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy).

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       CreateTimeSeriesRequest request =
           CreateTimeSeriesRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .addAllTimeSeries(new ArrayList<TimeSeries>())
               .build();
       ApiFuture<Empty> future = metricServiceClient.createTimeSeriesCallable().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-cloud-monitoring/latest/com.google.monitoring.v3.CreateTimeSeriesRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### deleteMetricDescriptor(DeleteMetricDescriptorRequest request)

    public final void deleteMetricDescriptor(DeleteMetricDescriptorRequest request)

Deletes a metric descriptor. Only user-created [custom
metrics](https://cloud.google.com/monitoring/custom-metrics) can be deleted.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       DeleteMetricDescriptorRequest request =
           DeleteMetricDescriptorRequest.newBuilder()
               .setName(
                   MetricDescriptorName.ofProjectMetricDescriptorName(
                           "[PROJECT]", "[METRIC_DESCRIPTOR]")
                       .toString())
               .build();
       metricServiceClient.deleteMetricDescriptor(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.DeleteMetricDescriptorRequest` The request object containing all of the parameters for the API call. |

### deleteMetricDescriptor(MetricDescriptorName name)

    public final void deleteMetricDescriptor(MetricDescriptorName name)

Deletes a metric descriptor. Only user-created [custom
metrics](https://cloud.google.com/monitoring/custom-metrics) can be deleted.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       MetricDescriptorName name =
           MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
       metricServiceClient.deleteMetricDescriptor(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.MetricDescriptorName` Required. The metric descriptor on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/metricDescriptors/\[METRIC_ID\] An example of `[METRIC_ID]` is: `"custom.googleapis.com/my_test_metric"`. |

### deleteMetricDescriptor(String name)

    public final void deleteMetricDescriptor(String name)

Deletes a metric descriptor. Only user-created [custom
metrics](https://cloud.google.com/monitoring/custom-metrics) can be deleted.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       String name =
           MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]")
               .toString();
       metricServiceClient.deleteMetricDescriptor(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The metric descriptor on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/metricDescriptors/\[METRIC_ID\] An example of `[METRIC_ID]` is: `"custom.googleapis.com/my_test_metric"`. |

### deleteMetricDescriptorCallable()

    public final UnaryCallable<DeleteMetricDescriptorRequest,Empty> deleteMetricDescriptorCallable()

Deletes a metric descriptor. Only user-created [custom
metrics](https://cloud.google.com/monitoring/custom-metrics) can be deleted.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       DeleteMetricDescriptorRequest request =
           DeleteMetricDescriptorRequest.newBuilder()
               .setName(
                   MetricDescriptorName.ofProjectMetricDescriptorName(
                           "[PROJECT]", "[METRIC_DESCRIPTOR]")
                       .toString())
               .build();
       ApiFuture<Empty> future =
           metricServiceClient.deleteMetricDescriptorCallable().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-cloud-monitoring/latest/com.google.monitoring.v3.DeleteMetricDescriptorRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### getMetricDescriptor(GetMetricDescriptorRequest request)

    public final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest request)

Gets a single metric descriptor.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       GetMetricDescriptorRequest request =
           GetMetricDescriptorRequest.newBuilder()
               .setName(
                   MetricDescriptorName.ofProjectMetricDescriptorName(
                           "[PROJECT]", "[METRIC_DESCRIPTOR]")
                       .toString())
               .build();
       MetricDescriptor response = metricServiceClient.getMetricDescriptor(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.GetMetricDescriptorRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.MetricDescriptor` |   |

### getMetricDescriptor(MetricDescriptorName name)

    public final MetricDescriptor getMetricDescriptor(MetricDescriptorName name)

Gets a single metric descriptor.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       MetricDescriptorName name =
           MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
       MetricDescriptor response = metricServiceClient.getMetricDescriptor(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.MetricDescriptorName` Required. The metric descriptor on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/metricDescriptors/\[METRIC_ID\] An example value of `[METRIC_ID]` is `"compute.googleapis.com/instance/disk/read_bytes_count"`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.MetricDescriptor` |   |

### getMetricDescriptor(String name)

    public final MetricDescriptor getMetricDescriptor(String name)

Gets a single metric descriptor.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       String name =
           MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]")
               .toString();
       MetricDescriptor response = metricServiceClient.getMetricDescriptor(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The metric descriptor on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/metricDescriptors/\[METRIC_ID\] An example value of `[METRIC_ID]` is `"compute.googleapis.com/instance/disk/read_bytes_count"`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.MetricDescriptor` |   |

### getMetricDescriptorCallable()

    public final UnaryCallable<GetMetricDescriptorRequest,MetricDescriptor> getMetricDescriptorCallable()

Gets a single metric descriptor.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       GetMetricDescriptorRequest request =
           GetMetricDescriptorRequest.newBuilder()
               .setName(
                   MetricDescriptorName.ofProjectMetricDescriptorName(
                           "[PROJECT]", "[METRIC_DESCRIPTOR]")
                       .toString())
               .build();
       ApiFuture<MetricDescriptor> future =
           metricServiceClient.getMetricDescriptorCallable().futureCall(request);
       // Do something.
       MetricDescriptor 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.GetMetricDescriptorRequest,com.google.api.MetricDescriptor>` |   |

### getMonitoredResourceDescriptor(GetMonitoredResourceDescriptorRequest request)

    public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(GetMonitoredResourceDescriptorRequest request)

Gets a single monitored resource descriptor.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       GetMonitoredResourceDescriptorRequest request =
           GetMonitoredResourceDescriptorRequest.newBuilder()
               .setName(
                   MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
                           "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]")
                       .toString())
               .build();
       MonitoredResourceDescriptor response =
           metricServiceClient.getMonitoredResourceDescriptor(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.GetMonitoredResourceDescriptorRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.MonitoredResourceDescriptor` |   |

### getMonitoredResourceDescriptor(MonitoredResourceDescriptorName name)

    public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(MonitoredResourceDescriptorName name)

Gets a single monitored resource descriptor.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       MonitoredResourceDescriptorName name =
           MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
               "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
       MonitoredResourceDescriptor response =
           metricServiceClient.getMonitoredResourceDescriptor(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.MonitoredResourceDescriptorName` Required. The monitored resource descriptor to get. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/monitoredResourceDescriptors/\[RESOURCE_TYPE\] The `[RESOURCE_TYPE]` is a predefined type, such as `cloudsql_database`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.MonitoredResourceDescriptor` |   |

### getMonitoredResourceDescriptor(String name)

    public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(String name)

Gets a single monitored resource descriptor.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       String name =
           MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
                   "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]")
               .toString();
       MonitoredResourceDescriptor response =
           metricServiceClient.getMonitoredResourceDescriptor(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The monitored resource descriptor to get. The format is: projects/\[PROJECT_ID_OR_NUMBER\]/monitoredResourceDescriptors/\[RESOURCE_TYPE\] The `[RESOURCE_TYPE]` is a predefined type, such as `cloudsql_database`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.MonitoredResourceDescriptor` |   |

### getMonitoredResourceDescriptorCallable()

    public final UnaryCallable<GetMonitoredResourceDescriptorRequest,MonitoredResourceDescriptor> getMonitoredResourceDescriptorCallable()

Gets a single monitored resource descriptor.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       GetMonitoredResourceDescriptorRequest request =
           GetMonitoredResourceDescriptorRequest.newBuilder()
               .setName(
                   MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
                           "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]")
                       .toString())
               .build();
       ApiFuture<MonitoredResourceDescriptor> future =
           metricServiceClient.getMonitoredResourceDescriptorCallable().futureCall(request);
       // Do something.
       MonitoredResourceDescriptor 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.GetMonitoredResourceDescriptorRequest,com.google.api.MonitoredResourceDescriptor>` |   |

### getSettings()

    public final MetricServiceSettings getSettings()

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

### getStub()

    public MetricServiceStub getStub()

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

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

### listMetricDescriptors(ResourceName name)

    public final MetricServiceClient.ListMetricDescriptorsPagedResponse listMetricDescriptors(ResourceName name)

Lists metric descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ResourceName name = ResourceName.of("[FOLDER]");
       for (MetricDescriptor element :
           metricServiceClient.listMetricDescriptors(name).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `com.google.api.resourcenames.ResourceName` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. 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.MetricServiceClient.ListMetricDescriptorsPagedResponse` |   |

### listMetricDescriptors(ListMetricDescriptorsRequest request)

    public final MetricServiceClient.ListMetricDescriptorsPagedResponse listMetricDescriptors(ListMetricDescriptorsRequest request)

Lists metric descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ListMetricDescriptorsRequest request =
           ListMetricDescriptorsRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setActiveOnly(true)
               .build();
       for (MetricDescriptor element :
           metricServiceClient.listMetricDescriptors(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListMetricDescriptorsRequest` 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.MetricServiceClient.ListMetricDescriptorsPagedResponse` |   |

### listMetricDescriptors(OrganizationName name)

    public final MetricServiceClient.ListMetricDescriptorsPagedResponse listMetricDescriptors(OrganizationName name)

Lists metric descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       OrganizationName name = OrganizationName.of("[ORGANIZATION]");
       for (MetricDescriptor element :
           metricServiceClient.listMetricDescriptors(name).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.OrganizationName` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. 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.MetricServiceClient.ListMetricDescriptorsPagedResponse` |   |

### listMetricDescriptors(ProjectName name)

    public final MetricServiceClient.ListMetricDescriptorsPagedResponse listMetricDescriptors(ProjectName name)

Lists metric descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ProjectName name = ProjectName.of("[PROJECT]");
       for (MetricDescriptor element :
           metricServiceClient.listMetricDescriptors(name).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `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) on which to execute the request. 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.MetricServiceClient.ListMetricDescriptorsPagedResponse` |   |

### listMetricDescriptors(String name)

    public final MetricServiceClient.ListMetricDescriptorsPagedResponse listMetricDescriptors(String name)

Lists metric descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       String name = ProjectName.of("[PROJECT]").toString();
       for (MetricDescriptor element :
           metricServiceClient.listMetricDescriptors(name).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. 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.MetricServiceClient.ListMetricDescriptorsPagedResponse` |   |

### listMetricDescriptorsCallable()

    public final UnaryCallable<ListMetricDescriptorsRequest,ListMetricDescriptorsResponse> listMetricDescriptorsCallable()

Lists metric descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ListMetricDescriptorsRequest request =
           ListMetricDescriptorsRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setActiveOnly(true)
               .build();
       while (true) {
         ListMetricDescriptorsResponse response =
             metricServiceClient.listMetricDescriptorsCallable().call(request);
         for (MetricDescriptor element : response.getMetricDescriptorsList()) {
           // 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.ListMetricDescriptorsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListMetricDescriptorsResponse>` |   |

### listMetricDescriptorsPagedCallable()

    public final UnaryCallable<ListMetricDescriptorsRequest,MetricServiceClient.ListMetricDescriptorsPagedResponse> listMetricDescriptorsPagedCallable()

Lists metric descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ListMetricDescriptorsRequest request =
           ListMetricDescriptorsRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setActiveOnly(true)
               .build();
       ApiFuture<MetricDescriptor> future =
           metricServiceClient.listMetricDescriptorsPagedCallable().futureCall(request);
       // Do something.
       for (MetricDescriptor 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.ListMetricDescriptorsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.MetricServiceClient.ListMetricDescriptorsPagedResponse>` |   |

### listMonitoredResourceDescriptors(ResourceName name)

    public final MetricServiceClient.ListMonitoredResourceDescriptorsPagedResponse listMonitoredResourceDescriptors(ResourceName name)

Lists monitored resource descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ResourceName name = ResourceName.of("[FOLDER]");
       for (MonitoredResourceDescriptor element :
           metricServiceClient.listMonitoredResourceDescriptors(name).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `com.google.api.resourcenames.ResourceName` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. 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.MetricServiceClient.ListMonitoredResourceDescriptorsPagedResponse` |   |

### listMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest request)

    public final MetricServiceClient.ListMonitoredResourceDescriptorsPagedResponse listMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest request)

Lists monitored resource descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ListMonitoredResourceDescriptorsRequest request =
           ListMonitoredResourceDescriptorsRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (MonitoredResourceDescriptor element :
           metricServiceClient.listMonitoredResourceDescriptors(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest` 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.MetricServiceClient.ListMonitoredResourceDescriptorsPagedResponse` |   |

### listMonitoredResourceDescriptors(OrganizationName name)

    public final MetricServiceClient.ListMonitoredResourceDescriptorsPagedResponse listMonitoredResourceDescriptors(OrganizationName name)

Lists monitored resource descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       OrganizationName name = OrganizationName.of("[ORGANIZATION]");
       for (MonitoredResourceDescriptor element :
           metricServiceClient.listMonitoredResourceDescriptors(name).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.OrganizationName` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. 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.MetricServiceClient.ListMonitoredResourceDescriptorsPagedResponse` |   |

### listMonitoredResourceDescriptors(ProjectName name)

    public final MetricServiceClient.ListMonitoredResourceDescriptorsPagedResponse listMonitoredResourceDescriptors(ProjectName name)

Lists monitored resource descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ProjectName name = ProjectName.of("[PROJECT]");
       for (MonitoredResourceDescriptor element :
           metricServiceClient.listMonitoredResourceDescriptors(name).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `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) on which to execute the request. 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.MetricServiceClient.ListMonitoredResourceDescriptorsPagedResponse` |   |

### listMonitoredResourceDescriptors(String name)

    public final MetricServiceClient.ListMonitoredResourceDescriptorsPagedResponse listMonitoredResourceDescriptors(String name)

Lists monitored resource descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       String name = ProjectName.of("[PROJECT]").toString();
       for (MonitoredResourceDescriptor element :
           metricServiceClient.listMonitoredResourceDescriptors(name).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. 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.MetricServiceClient.ListMonitoredResourceDescriptorsPagedResponse` |   |

### listMonitoredResourceDescriptorsCallable()

    public final UnaryCallable<ListMonitoredResourceDescriptorsRequest,ListMonitoredResourceDescriptorsResponse> listMonitoredResourceDescriptorsCallable()

Lists monitored resource descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ListMonitoredResourceDescriptorsRequest request =
           ListMonitoredResourceDescriptorsRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListMonitoredResourceDescriptorsResponse response =
             metricServiceClient.listMonitoredResourceDescriptorsCallable().call(request);
         for (MonitoredResourceDescriptor element : response.getResourceDescriptorsList()) {
           // 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.ListMonitoredResourceDescriptorsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse>` |   |

### listMonitoredResourceDescriptorsPagedCallable()

    public final UnaryCallable<ListMonitoredResourceDescriptorsRequest,MetricServiceClient.ListMonitoredResourceDescriptorsPagedResponse> listMonitoredResourceDescriptorsPagedCallable()

Lists monitored resource descriptors that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ListMonitoredResourceDescriptorsRequest request =
           ListMonitoredResourceDescriptorsRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<MonitoredResourceDescriptor> future =
           metricServiceClient.listMonitoredResourceDescriptorsPagedCallable().futureCall(request);
       // Do something.
       for (MonitoredResourceDescriptor 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.ListMonitoredResourceDescriptorsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.MetricServiceClient.ListMonitoredResourceDescriptorsPagedResponse>` |   |

### listTimeSeries(ResourceName name, String filter, TimeInterval interval, ListTimeSeriesRequest.TimeSeriesView view)

    public final MetricServiceClient.ListTimeSeriesPagedResponse listTimeSeries(ResourceName name, String filter, TimeInterval interval, ListTimeSeriesRequest.TimeSeriesView view)

Lists time series that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ResourceName name = ResourceName.of("[FOLDER]");
       String filter = "filter-1274492040";
       TimeInterval interval = TimeInterval.newBuilder().build();
       ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0);
       for (TimeSeries element :
           metricServiceClient.listTimeSeries(name, filter, interval, view).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `com.google.api.resourcenames.ResourceName` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name), organization or folder on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\] organizations/\[ORGANIZATION_ID\] folders/\[FOLDER_ID\] |
| `filter` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies which time series should be returned. The filter must specify a single metric type, and can additionally specify metric labels and other information. For example: metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND metric.labels.instance_name = "my-instance-name" |
| `interval` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.TimeInterval` Required. The time interval for which results should be returned. Only time series that contain data points in the specified interval are included in the response. |
| `view` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView` Required. Specifies which information is returned about the time series. |

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

### listTimeSeries(ListTimeSeriesRequest request)

    public final MetricServiceClient.ListTimeSeriesPagedResponse listTimeSeries(ListTimeSeriesRequest request)

Lists time series that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ListTimeSeriesRequest request =
           ListTimeSeriesRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setInterval(TimeInterval.newBuilder().build())
               .setAggregation(Aggregation.newBuilder().build())
               .setSecondaryAggregation(Aggregation.newBuilder().build())
               .setOrderBy("orderBy-1207110587")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (TimeSeries element : metricServiceClient.listTimeSeries(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListTimeSeriesRequest` 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.MetricServiceClient.ListTimeSeriesPagedResponse` |   |

### listTimeSeries(OrganizationName name, String filter, TimeInterval interval, ListTimeSeriesRequest.TimeSeriesView view)

    public final MetricServiceClient.ListTimeSeriesPagedResponse listTimeSeries(OrganizationName name, String filter, TimeInterval interval, ListTimeSeriesRequest.TimeSeriesView view)

Lists time series that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       OrganizationName name = OrganizationName.of("[ORGANIZATION]");
       String filter = "filter-1274492040";
       TimeInterval interval = TimeInterval.newBuilder().build();
       ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0);
       for (TimeSeries element :
           metricServiceClient.listTimeSeries(name, filter, interval, view).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.OrganizationName` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name), organization or folder on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\] organizations/\[ORGANIZATION_ID\] folders/\[FOLDER_ID\] |
| `filter` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies which time series should be returned. The filter must specify a single metric type, and can additionally specify metric labels and other information. For example: metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND metric.labels.instance_name = "my-instance-name" |
| `interval` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.TimeInterval` Required. The time interval for which results should be returned. Only time series that contain data points in the specified interval are included in the response. |
| `view` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView` Required. Specifies which information is returned about the time series. |

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

### listTimeSeries(ProjectName name, String filter, TimeInterval interval, ListTimeSeriesRequest.TimeSeriesView view)

    public final MetricServiceClient.ListTimeSeriesPagedResponse listTimeSeries(ProjectName name, String filter, TimeInterval interval, ListTimeSeriesRequest.TimeSeriesView view)

Lists time series that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ProjectName name = ProjectName.of("[PROJECT]");
       String filter = "filter-1274492040";
       TimeInterval interval = TimeInterval.newBuilder().build();
       ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0);
       for (TimeSeries element :
           metricServiceClient.listTimeSeries(name, filter, interval, view).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `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), organization or folder on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\] organizations/\[ORGANIZATION_ID\] folders/\[FOLDER_ID\] |
| `filter` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies which time series should be returned. The filter must specify a single metric type, and can additionally specify metric labels and other information. For example: metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND metric.labels.instance_name = "my-instance-name" |
| `interval` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.TimeInterval` Required. The time interval for which results should be returned. Only time series that contain data points in the specified interval are included in the response. |
| `view` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView` Required. Specifies which information is returned about the time series. |

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

### listTimeSeries(String name, String filter, TimeInterval interval, ListTimeSeriesRequest.TimeSeriesView view)

    public final MetricServiceClient.ListTimeSeriesPagedResponse listTimeSeries(String name, String filter, TimeInterval interval, ListTimeSeriesRequest.TimeSeriesView view)

Lists time series that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       String name = ProjectName.of("[PROJECT]").toString();
       String filter = "filter-1274492040";
       TimeInterval interval = TimeInterval.newBuilder().build();
       ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0);
       for (TimeSeries element :
           metricServiceClient.listTimeSeries(name, filter, interval, view).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name), organization or folder on which to execute the request. The format is: projects/\[PROJECT_ID_OR_NUMBER\] organizations/\[ORGANIZATION_ID\] folders/\[FOLDER_ID\] |
| `filter` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies which time series should be returned. The filter must specify a single metric type, and can additionally specify metric labels and other information. For example: metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND metric.labels.instance_name = "my-instance-name" |
| `interval` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.TimeInterval` Required. The time interval for which results should be returned. Only time series that contain data points in the specified interval are included in the response. |
| `view` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView` Required. Specifies which information is returned about the time series. |

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

### listTimeSeriesCallable()

    public final UnaryCallable<ListTimeSeriesRequest,ListTimeSeriesResponse> listTimeSeriesCallable()

Lists time series that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ListTimeSeriesRequest request =
           ListTimeSeriesRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setInterval(TimeInterval.newBuilder().build())
               .setAggregation(Aggregation.newBuilder().build())
               .setSecondaryAggregation(Aggregation.newBuilder().build())
               .setOrderBy("orderBy-1207110587")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListTimeSeriesResponse response =
             metricServiceClient.listTimeSeriesCallable().call(request);
         for (TimeSeries element : response.getTimeSeriesList()) {
           // 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.ListTimeSeriesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.monitoring.v3.ListTimeSeriesResponse>` |   |

### listTimeSeriesPagedCallable()

    public final UnaryCallable<ListTimeSeriesRequest,MetricServiceClient.ListTimeSeriesPagedResponse> listTimeSeriesPagedCallable()

Lists time series that match a filter.

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 (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
       ListTimeSeriesRequest request =
           ListTimeSeriesRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .setFilter("filter-1274492040")
               .setInterval(TimeInterval.newBuilder().build())
               .setAggregation(Aggregation.newBuilder().build())
               .setSecondaryAggregation(Aggregation.newBuilder().build())
               .setOrderBy("orderBy-1207110587")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<TimeSeries> future =
           metricServiceClient.listTimeSeriesPagedCallable().futureCall(request);
       // Do something.
       for (TimeSeries 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.ListTimeSeriesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/com.google.cloud.monitoring.v3.MetricServiceClient.ListTimeSeriesPagedResponse>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()