# Class GrpcUsageServiceStub (0.16.0)

0.16.0 (latest) 0.14.0 0.11.0 0.10.0 0.8.0 0.6.0 0.5.0 0.4.0 0.3.0 0.1.0

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

    public class GrpcUsageServiceStub extends UsageServiceStub

gRPC stub implementation for the UsageService service API.

This class is for advanced usage and reflects the underlying API directly.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [UsageServiceStub](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub) \> GrpcUsageServiceStub

## Inherited Members

[UsageServiceStub.close()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_close__) [UsageServiceStub.exportForecastsCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_exportForecastsCallable__) [UsageServiceStub.exportForecastsOperationCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_exportForecastsOperationCallable__) [UsageServiceStub.exportReservationsUsageCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_exportReservationsUsageCallable__) [UsageServiceStub.exportReservationsUsageOperationCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_exportReservationsUsageOperationCallable__) [UsageServiceStub.exportUsageHistoriesCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_exportUsageHistoriesCallable__) [UsageServiceStub.exportUsageHistoriesOperationCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_exportUsageHistoriesOperationCallable__) [UsageServiceStub.getHttpJsonOperationsStub()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_getHttpJsonOperationsStub__) [UsageServiceStub.getOperationsStub()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_getOperationsStub__) [UsageServiceStub.queryForecastsCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_queryForecastsCallable__) [UsageServiceStub.queryReservationsCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_queryReservationsCallable__) [UsageServiceStub.queryUsageHistoriesCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_queryUsageHistoriesCallable__) [Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Methods

### create(ClientContext clientContext)

    public static final GrpcUsageServiceStub create(ClientContext clientContext)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `clientContext` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ClientContext.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.GrpcUsageServiceStub` |   |

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

### create(ClientContext clientContext, GrpcStubCallableFactory callableFactory)

    public static final GrpcUsageServiceStub create(ClientContext clientContext, GrpcStubCallableFactory callableFactory)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `clientContext` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ClientContext.html` |
| `callableFactory` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.grpc.GrpcStubCallableFactory.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.GrpcUsageServiceStub` |   |

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

### create(UsageServiceStubSettings settings)

    public static final GrpcUsageServiceStub create(UsageServiceStubSettings settings)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStubSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.GrpcUsageServiceStub` |   |

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

## Constructors

### GrpcUsageServiceStub(UsageServiceStubSettings settings, ClientContext clientContext)

    protected GrpcUsageServiceStub(UsageServiceStubSettings settings, ClientContext clientContext)

Constructs an instance of GrpcUsageServiceStub, 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.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStubSettings` |
| `clientContext` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ClientContext.html` |

### GrpcUsageServiceStub(UsageServiceStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)

    protected GrpcUsageServiceStub(UsageServiceStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)

Constructs an instance of GrpcUsageServiceStub, 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.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStubSettings` |
| `clientContext` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ClientContext.html` |
| `callableFactory` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.grpc.GrpcStubCallableFactory.html` |

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

**Overrides** [UsageServiceStub.close()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_close__)

### exportForecastsCallable()

    public UnaryCallable<ExportForecastsRequest,Operation> exportForecastsCallable()

| **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-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.ExportForecastsRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

**Overrides** [UsageServiceStub.exportForecastsCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_exportForecastsCallable__)

### exportForecastsOperationCallable()

    public OperationCallable<ExportForecastsRequest,ExportForecastsResponse,OperationMetadata> exportForecastsOperationCallable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.ExportForecastsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.ExportForecastsResponse,https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.OperationMetadata>` |   |

**Overrides** [UsageServiceStub.exportForecastsOperationCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_exportForecastsOperationCallable__)

### exportReservationsUsageCallable()

    public UnaryCallable<ExportReservationsUsageRequest,Operation> exportReservationsUsageCallable()

| **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-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.ExportReservationsUsageRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

**Overrides** [UsageServiceStub.exportReservationsUsageCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_exportReservationsUsageCallable__)

### exportReservationsUsageOperationCallable()

    public OperationCallable<ExportReservationsUsageRequest,ExportReservationsUsageResponse,OperationMetadata> exportReservationsUsageOperationCallable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.ExportReservationsUsageRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.ExportReservationsUsageResponse,https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.OperationMetadata>` |   |

**Overrides** [UsageServiceStub.exportReservationsUsageOperationCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_exportReservationsUsageOperationCallable__)

### exportUsageHistoriesCallable()

    public UnaryCallable<ExportUsageHistoriesRequest,Operation> exportUsageHistoriesCallable()

| **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-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.ExportUsageHistoriesRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

**Overrides** [UsageServiceStub.exportUsageHistoriesCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_exportUsageHistoriesCallable__)

### exportUsageHistoriesOperationCallable()

    public OperationCallable<ExportUsageHistoriesRequest,ExportUsageHistoriesResponse,OperationMetadata> exportUsageHistoriesOperationCallable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.ExportUsageHistoriesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.ExportUsageHistoriesResponse,https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.OperationMetadata>` |   |

**Overrides** [UsageServiceStub.exportUsageHistoriesOperationCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_exportUsageHistoriesOperationCallable__)

### getOperationsStub()

    public GrpcOperationsStub getOperationsStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.stub.GrpcOperationsStub.html` |   |

**Overrides** [UsageServiceStub.getOperationsStub()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_getOperationsStub__)

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

### queryForecastsCallable()

    public UnaryCallable<QueryForecastsRequest,QueryForecastsResponse> queryForecastsCallable()

| **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-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.QueryForecastsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.QueryForecastsResponse>` |   |

**Overrides** [UsageServiceStub.queryForecastsCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_queryForecastsCallable__)

### queryReservationsCallable()

    public UnaryCallable<QueryReservationsRequest,QueryReservationsResponse> queryReservationsCallable()

| **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-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.QueryReservationsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.QueryReservationsResponse>` |   |

**Overrides** [UsageServiceStub.queryReservationsCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_queryReservationsCallable__)

### queryUsageHistoriesCallable()

    public UnaryCallable<QueryUsageHistoriesRequest,QueryUsageHistoriesResponse> queryUsageHistoriesCallable()

| **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-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.QueryUsageHistoriesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.QueryUsageHistoriesResponse>` |   |

**Overrides** [UsageServiceStub.queryUsageHistoriesCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/com.google.cloud.capacityplanner.v1beta.stub.UsageServiceStub#com_google_cloud_capacityplanner_v1beta_stub_UsageServiceStub_queryUsageHistoriesCallable__)

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()