# Class DashboardChartServiceClient (0.31.0)

0.31.0 (latest) 0.29.0 0.26.0 0.25.0 0.23.0 0.21.0 0.20.0 0.19.0 0.18.0 0.16.0 0.14.0 0.13.0 0.12.0 0.11.0 0.10.0 0.8.0 0.6.0 0.5.0 0.2.0 0.1.0

|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-chronicle/google-cloud-chronicle/src/main/java/com/google/cloud/chronicle/v1/DashboardChartServiceClient.java) | [Product Reference](https://cloud.google.com/chronicle/docs/secops/secops-overview) |

Service Description: A service providing functionality for managing dashboards' charts.

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 (DashboardChartServiceClient dashboardChartServiceClient =
         DashboardChartServiceClient.create()) {
       DashboardChartName name =
           DashboardChartName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[CHART]");
       DashboardChart response = dashboardChartServiceClient.getDashboardChart(name);
     }
     
Note: close() needs to be called on the DashboardChartServiceClient 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 |
|---|---|---|
| GetDashboardChart | Get a dashboard chart. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getDashboardChart(GetDashboardChartRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getDashboardChart(DashboardChartName name) - getDashboardChart(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. - getDashboardChartCallable() |
| BatchGetDashboardCharts | Get dashboard charts in batches. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - batchGetDashboardCharts(BatchGetDashboardChartsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - batchGetDashboardCharts(InstanceName parent, List\<String\> names) - batchGetDashboardCharts(String parent, List\<String\> names) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - batchGetDashboardChartsCallable() |
[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 DashboardChartServiceSettings
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
     DashboardChartServiceSettings dashboardChartServiceSettings =
         DashboardChartServiceSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     DashboardChartServiceClient dashboardChartServiceClient =
         DashboardChartServiceClient.create(dashboardChartServiceSettings);
     
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
     DashboardChartServiceSettings dashboardChartServiceSettings =
         DashboardChartServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
     DashboardChartServiceClient dashboardChartServiceClient =
         DashboardChartServiceClient.create(dashboardChartServiceSettings);
     
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
the wire:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     DashboardChartServiceSettings dashboardChartServiceSettings =
         DashboardChartServiceSettings.newHttpJsonBuilder().build();
     DashboardChartServiceClient dashboardChartServiceClient =
         DashboardChartServiceClient.create(dashboardChartServiceSettings);
     
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) \> DashboardChartServiceClient

## Static Methods

### create()

    public static final DashboardChartServiceClient create()

Constructs an instance of DashboardChartServiceClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.DashboardChartServiceClient` |   |

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

### create(DashboardChartServiceSettings settings)

    public static final DashboardChartServiceClient create(DashboardChartServiceSettings settings)

Constructs an instance of DashboardChartServiceClient, 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-chronicle/latest/com.google.cloud.chronicle.v1.DashboardChartServiceSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.DashboardChartServiceClient` |   |

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

### create(DashboardChartServiceStub stub)

    public static final DashboardChartServiceClient create(DashboardChartServiceStub stub)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.stub.DashboardChartServiceStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.DashboardChartServiceClient` |   |

## Constructors

### DashboardChartServiceClient(DashboardChartServiceSettings settings)

    protected DashboardChartServiceClient(DashboardChartServiceSettings settings)

Constructs an instance of DashboardChartServiceClient, 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-chronicle/latest/com.google.cloud.chronicle.v1.DashboardChartServiceSettings` |

### DashboardChartServiceClient(DashboardChartServiceStub stub)

    protected DashboardChartServiceClient(DashboardChartServiceStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.stub.DashboardChartServiceStub` |

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

### batchGetDashboardCharts(BatchGetDashboardChartsRequest request)

    public final BatchGetDashboardChartsResponse batchGetDashboardCharts(BatchGetDashboardChartsRequest request)

Get dashboard charts in batches.

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 (DashboardChartServiceClient dashboardChartServiceClient =
         DashboardChartServiceClient.create()) {
       BatchGetDashboardChartsRequest request =
           BatchGetDashboardChartsRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
               .addAllNames(new ArrayList<String>())
               .build();
       BatchGetDashboardChartsResponse response =
           dashboardChartServiceClient.batchGetDashboardCharts(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.BatchGetDashboardChartsRequest` 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-chronicle/latest/com.google.cloud.chronicle.v1.BatchGetDashboardChartsResponse` |   |

### batchGetDashboardCharts(InstanceName parent, List\<String\> names)

    public final BatchGetDashboardChartsResponse batchGetDashboardCharts(InstanceName parent, List<String> names)

Get dashboard charts in batches.

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 (DashboardChartServiceClient dashboardChartServiceClient =
         DashboardChartServiceClient.create()) {
       InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
       List<String> names = new ArrayList<>();
       BatchGetDashboardChartsResponse response =
           dashboardChartServiceClient.batchGetDashboardCharts(parent, names);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.InstanceName` Required. The parent resource shared by all dashboard charts being retrieved. Format: projects/{project}/locations/{location}/instances/{instance} If this is set, the parent of all of the dashboard charts specified in `names` must match this field. |
| `names` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` Required. The names of the dashboard charts to get. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.BatchGetDashboardChartsResponse` |   |

### batchGetDashboardCharts(String parent, List\<String\> names)

    public final BatchGetDashboardChartsResponse batchGetDashboardCharts(String parent, List<String> names)

Get dashboard charts in batches.

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 (DashboardChartServiceClient dashboardChartServiceClient =
         DashboardChartServiceClient.create()) {
       String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
       List<String> names = new ArrayList<>();
       BatchGetDashboardChartsResponse response =
           dashboardChartServiceClient.batchGetDashboardCharts(parent, names);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource shared by all dashboard charts being retrieved. Format: projects/{project}/locations/{location}/instances/{instance} If this is set, the parent of all of the dashboard charts specified in `names` must match this field. |
| `names` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` Required. The names of the dashboard charts to get. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.BatchGetDashboardChartsResponse` |   |

### batchGetDashboardChartsCallable()

    public final UnaryCallable<BatchGetDashboardChartsRequest,BatchGetDashboardChartsResponse> batchGetDashboardChartsCallable()

Get dashboard charts in batches.

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 (DashboardChartServiceClient dashboardChartServiceClient =
         DashboardChartServiceClient.create()) {
       BatchGetDashboardChartsRequest request =
           BatchGetDashboardChartsRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
               .addAllNames(new ArrayList<String>())
               .build();
       ApiFuture<BatchGetDashboardChartsResponse> future =
           dashboardChartServiceClient.batchGetDashboardChartsCallable().futureCall(request);
       // Do something.
       BatchGetDashboardChartsResponse 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-chronicle/latest/com.google.cloud.chronicle.v1.BatchGetDashboardChartsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.BatchGetDashboardChartsResponse>` |   |

### close()

    public final void close()

### getDashboardChart(DashboardChartName name)

    public final DashboardChart getDashboardChart(DashboardChartName name)

Get a dashboard chart.

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 (DashboardChartServiceClient dashboardChartServiceClient =
         DashboardChartServiceClient.create()) {
       DashboardChartName name =
           DashboardChartName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[CHART]");
       DashboardChart response = dashboardChartServiceClient.getDashboardChart(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.DashboardChartName` Required. The name of the dashboardChart to retrieve. Format: projects/{project}/locations/{location}/instances/{instance}/dashboardCharts/{chart} |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.DashboardChart` |   |

### getDashboardChart(GetDashboardChartRequest request)

    public final DashboardChart getDashboardChart(GetDashboardChartRequest request)

Get a dashboard chart.

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 (DashboardChartServiceClient dashboardChartServiceClient =
         DashboardChartServiceClient.create()) {
       GetDashboardChartRequest request =
           GetDashboardChartRequest.newBuilder()
               .setName(
                   DashboardChartName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[CHART]")
                       .toString())
               .build();
       DashboardChart response = dashboardChartServiceClient.getDashboardChart(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.GetDashboardChartRequest` 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-chronicle/latest/com.google.cloud.chronicle.v1.DashboardChart` |   |

### getDashboardChart(String name)

    public final DashboardChart getDashboardChart(String name)

Get a dashboard chart.

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 (DashboardChartServiceClient dashboardChartServiceClient =
         DashboardChartServiceClient.create()) {
       String name =
           DashboardChartName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[CHART]").toString();
       DashboardChart response = dashboardChartServiceClient.getDashboardChart(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the dashboardChart to retrieve. Format: projects/{project}/locations/{location}/instances/{instance}/dashboardCharts/{chart} |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.DashboardChart` |   |

### getDashboardChartCallable()

    public final UnaryCallable<GetDashboardChartRequest,DashboardChart> getDashboardChartCallable()

Get a dashboard chart.

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 (DashboardChartServiceClient dashboardChartServiceClient =
         DashboardChartServiceClient.create()) {
       GetDashboardChartRequest request =
           GetDashboardChartRequest.newBuilder()
               .setName(
                   DashboardChartName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[CHART]")
                       .toString())
               .build();
       ApiFuture<DashboardChart> future =
           dashboardChartServiceClient.getDashboardChartCallable().futureCall(request);
       // Do something.
       DashboardChart 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-chronicle/latest/com.google.cloud.chronicle.v1.GetDashboardChartRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.DashboardChart>` |   |

### getSettings()

    public final DashboardChartServiceSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.DashboardChartServiceSettings` |   |

### getStub()

    public DashboardChartServiceStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/com.google.cloud.chronicle.v1.stub.DashboardChartServiceStub` |   |

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

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()