@BetaApi @Generated(value="by gapic-generator-java") public class ServiceUsageClient extends Object implements com.google.api.gax.core.BackgroundResource
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GetServiceRequest request = GetServiceRequest.newBuilder().setName("name3373707").build();
Service response = serviceUsageClient.getService(request);
}
Note: close() needs to be called on the ServiceUsageClient 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 |
|---|---|---|
EnableService |
Enables a service so that it can be used with a project. Operation response type: `google.protobuf.Empty` |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DisableService |
Disables a service so that it can no longer be used with a project. This prevents unintended usage that may cause unexpected billing charges or security leaks. It is not valid to call the disable method on a service that is not currently enabled. Callers will receive a `FAILED_PRECONDITION` status if the target service is not currently enabled. Operation response type: `google.protobuf.Empty` |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetService |
Returns the service configuration and enabled state for a given service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListServices |
Lists all services available to the specified project, and the current state of those services with respect to the project. The list includes all public services, all services for which the calling user has the `servicemanagement.services.bind` permission, and all services that have already been enabled on the project. The list can be filtered to only include services in a specific state, for example to only include services enabled on the project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchEnableServices |
Enables multiple services on a project. The operation is atomic: if enabling any service fails, then the entire batch fails, and no state changes occur. Operation response type: `google.protobuf.Empty` |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListConsumerQuotaMetrics |
Retrieves a summary of all quota information visible to the service consumer, organized by service metric. Each metric includes information about all of its defined limits. Each limit includes the limit configuration (quota unit, preciseness, default value), the current effective limit value, and all of the overrides applied to the limit. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetConsumerQuotaMetric |
Retrieves a summary of quota information for a specific quota metric |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetConsumerQuotaLimit |
Retrieves a summary of quota information for a specific quota limit. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateAdminOverride |
Creates an admin override. An admin override is applied by an administrator of a parent folder or parent organization of the consumer receiving the override. An admin override is intended to limit the amount of quota the consumer can use out of the total quota pool allocated to all children of the folder or organization. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateAdminOverride |
Updates an admin override. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteAdminOverride |
Deletes an admin override. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListAdminOverrides |
Lists all admin overrides on this limit. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ImportAdminOverrides |
Creates or updates multiple admin overrides atomically, all on the same consumer, but on many different metrics or limits. The name field in the quota override message should not be set. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateConsumerOverride |
Creates a consumer override. A consumer override is applied to the consumer on its own authority to limit its own quota usage. Consumer overrides cannot be used to grant more quota than would be allowed by admin overrides, producer overrides, or the default limit of the service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateConsumerOverride |
Updates a consumer override. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteConsumerOverride |
Deletes a consumer override. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListConsumerOverrides |
Lists all consumer overrides on this limit. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ImportConsumerOverrides |
Creates or updates multiple consumer overrides atomically, all on the same consumer, but on many different metrics or limits. The name field in the quota override message should not be set. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GenerateServiceIdentity |
Generates service identity for service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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 ServiceUsageSettings 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
ServiceUsageSettings serviceUsageSettings =
ServiceUsageSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ServiceUsageClient serviceUsageClient = ServiceUsageClient.create(serviceUsageSettings);
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
ServiceUsageSettings serviceUsageSettings =
ServiceUsageSettings.newBuilder().setEndpoint(myEndpoint).build();
ServiceUsageClient serviceUsageClient = ServiceUsageClient.create(serviceUsageSettings);
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
ServiceUsageSettings serviceUsageSettings = ServiceUsageSettings.newHttpJsonBuilder().build();
ServiceUsageClient serviceUsageClient = ServiceUsageClient.create(serviceUsageSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
ServiceUsageClient.ListAdminOverridesFixedSizeCollection |
static class |
ServiceUsageClient.ListAdminOverridesPage |
static class |
ServiceUsageClient.ListAdminOverridesPagedResponse |
static class |
ServiceUsageClient.ListConsumerOverridesFixedSizeCollection |
static class |
ServiceUsageClient.ListConsumerOverridesPage |
static class |
ServiceUsageClient.ListConsumerOverridesPagedResponse |
static class |
ServiceUsageClient.ListConsumerQuotaMetricsFixedSizeCollection |
static class |
ServiceUsageClient.ListConsumerQuotaMetricsPage |
static class |
ServiceUsageClient.ListConsumerQuotaMetricsPagedResponse |
static class |
ServiceUsageClient.ListServicesFixedSizeCollection |
static class |
ServiceUsageClient.ListServicesPage |
static class |
ServiceUsageClient.ListServicesPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
ServiceUsageClient(ServiceUsageSettings settings)
Constructs an instance of ServiceUsageClient, using the given settings.
|
protected |
ServiceUsageClient(ServiceUsageStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
batchEnableServicesAsync(BatchEnableServicesRequest request)
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.UnaryCallable<BatchEnableServicesRequest,com.google.longrunning.Operation> |
batchEnableServicesCallable()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.OperationCallable<BatchEnableServicesRequest,com.google.protobuf.Empty,OperationMetadata> |
batchEnableServicesOperationCallable()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
void |
close() |
static ServiceUsageClient |
create()
Constructs an instance of ServiceUsageClient with default settings.
|
static ServiceUsageClient |
create(ServiceUsageSettings settings)
Constructs an instance of ServiceUsageClient, using the given settings.
|
static ServiceUsageClient |
create(ServiceUsageStub stub)
Constructs an instance of ServiceUsageClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<QuotaOverride,OperationMetadata> |
createAdminOverrideAsync(CreateAdminOverrideRequest request)
Creates an admin override.
|
com.google.api.gax.rpc.UnaryCallable<CreateAdminOverrideRequest,com.google.longrunning.Operation> |
createAdminOverrideCallable()
Creates an admin override.
|
com.google.api.gax.rpc.OperationCallable<CreateAdminOverrideRequest,QuotaOverride,OperationMetadata> |
createAdminOverrideOperationCallable()
Creates an admin override.
|
com.google.api.gax.longrunning.OperationFuture<QuotaOverride,OperationMetadata> |
createConsumerOverrideAsync(CreateConsumerOverrideRequest request)
Creates a consumer override.
|
com.google.api.gax.rpc.UnaryCallable<CreateConsumerOverrideRequest,com.google.longrunning.Operation> |
createConsumerOverrideCallable()
Creates a consumer override.
|
com.google.api.gax.rpc.OperationCallable<CreateConsumerOverrideRequest,QuotaOverride,OperationMetadata> |
createConsumerOverrideOperationCallable()
Creates a consumer override.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteAdminOverrideAsync(DeleteAdminOverrideRequest request)
Deletes an admin override.
|
com.google.api.gax.rpc.UnaryCallable<DeleteAdminOverrideRequest,com.google.longrunning.Operation> |
deleteAdminOverrideCallable()
Deletes an admin override.
|
com.google.api.gax.rpc.OperationCallable<DeleteAdminOverrideRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteAdminOverrideOperationCallable()
Deletes an admin override.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteConsumerOverrideAsync(DeleteConsumerOverrideRequest request)
Deletes a consumer override.
|
com.google.api.gax.rpc.UnaryCallable<DeleteConsumerOverrideRequest,com.google.longrunning.Operation> |
deleteConsumerOverrideCallable()
Deletes a consumer override.
|
com.google.api.gax.rpc.OperationCallable<DeleteConsumerOverrideRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteConsumerOverrideOperationCallable()
Deletes a consumer override.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
disableServiceAsync(DisableServiceRequest request)
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.UnaryCallable<DisableServiceRequest,com.google.longrunning.Operation> |
disableServiceCallable()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.OperationCallable<DisableServiceRequest,com.google.protobuf.Empty,OperationMetadata> |
disableServiceOperationCallable()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
enableServiceAsync(EnableServiceRequest request)
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.UnaryCallable<EnableServiceRequest,com.google.longrunning.Operation> |
enableServiceCallable()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.OperationCallable<EnableServiceRequest,com.google.protobuf.Empty,OperationMetadata> |
enableServiceOperationCallable()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.longrunning.OperationFuture<ServiceIdentity,com.google.protobuf.Empty> |
generateServiceIdentityAsync(GenerateServiceIdentityRequest request)
Generates service identity for service.
|
com.google.api.gax.rpc.UnaryCallable<GenerateServiceIdentityRequest,com.google.longrunning.Operation> |
generateServiceIdentityCallable()
Generates service identity for service.
|
com.google.api.gax.rpc.OperationCallable<GenerateServiceIdentityRequest,ServiceIdentity,com.google.protobuf.Empty> |
generateServiceIdentityOperationCallable()
Generates service identity for service.
|
ConsumerQuotaLimit |
getConsumerQuotaLimit(GetConsumerQuotaLimitRequest request)
Retrieves a summary of quota information for a specific quota limit.
|
com.google.api.gax.rpc.UnaryCallable<GetConsumerQuotaLimitRequest,ConsumerQuotaLimit> |
getConsumerQuotaLimitCallable()
Retrieves a summary of quota information for a specific quota limit.
|
ConsumerQuotaMetric |
getConsumerQuotaMetric(GetConsumerQuotaMetricRequest request)
Retrieves a summary of quota information for a specific quota metric
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GetConsumerQuotaMetricRequest request =
GetConsumerQuotaMetricRequest.newBuilder()
.setName("name3373707")
.setView(QuotaView.forNumber(0))
.build();
ConsumerQuotaMetric response = serviceUsageClient.getConsumerQuotaMetric(request);
}
|
com.google.api.gax.rpc.UnaryCallable<GetConsumerQuotaMetricRequest,ConsumerQuotaMetric> |
getConsumerQuotaMetricCallable()
Retrieves a summary of quota information for a specific quota metric
Sample code:
{@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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GetConsumerQuotaMetricRequest request =
GetConsumerQuotaMetricRequest.newBuilder()
.setName("name3373707")
.setView(QuotaView.forNumber(0))
.build();
ApiFuture
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
Service |
getService(GetServiceRequest request)
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.UnaryCallable<GetServiceRequest,Service> |
getServiceCallable()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
ServiceUsageSettings |
getSettings() |
ServiceUsageStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<ImportAdminOverridesResponse,ImportAdminOverridesMetadata> |
importAdminOverridesAsync(ImportAdminOverridesRequest request)
Creates or updates multiple admin overrides atomically, all on the same consumer, but on many
different metrics or limits.
|
com.google.api.gax.rpc.UnaryCallable<ImportAdminOverridesRequest,com.google.longrunning.Operation> |
importAdminOverridesCallable()
Creates or updates multiple admin overrides atomically, all on the same consumer, but on many
different metrics or limits.
|
com.google.api.gax.rpc.OperationCallable<ImportAdminOverridesRequest,ImportAdminOverridesResponse,ImportAdminOverridesMetadata> |
importAdminOverridesOperationCallable()
Creates or updates multiple admin overrides atomically, all on the same consumer, but on many
different metrics or limits.
|
com.google.api.gax.longrunning.OperationFuture<ImportConsumerOverridesResponse,ImportConsumerOverridesMetadata> |
importConsumerOverridesAsync(ImportConsumerOverridesRequest request)
Creates or updates multiple consumer overrides atomically, all on the same consumer, but on
many different metrics or limits.
|
com.google.api.gax.rpc.UnaryCallable<ImportConsumerOverridesRequest,com.google.longrunning.Operation> |
importConsumerOverridesCallable()
Creates or updates multiple consumer overrides atomically, all on the same consumer, but on
many different metrics or limits.
|
com.google.api.gax.rpc.OperationCallable<ImportConsumerOverridesRequest,ImportConsumerOverridesResponse,ImportConsumerOverridesMetadata> |
importConsumerOverridesOperationCallable()
Creates or updates multiple consumer overrides atomically, all on the same consumer, but on
many different metrics or limits.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
ServiceUsageClient.ListAdminOverridesPagedResponse |
listAdminOverrides(ListAdminOverridesRequest request)
Lists all admin overrides on this limit.
|
com.google.api.gax.rpc.UnaryCallable<ListAdminOverridesRequest,ListAdminOverridesResponse> |
listAdminOverridesCallable()
Lists all admin overrides on this limit.
|
com.google.api.gax.rpc.UnaryCallable<ListAdminOverridesRequest,ServiceUsageClient.ListAdminOverridesPagedResponse> |
listAdminOverridesPagedCallable()
Lists all admin overrides on this limit.
|
ServiceUsageClient.ListConsumerOverridesPagedResponse |
listConsumerOverrides(ListConsumerOverridesRequest request)
Lists all consumer overrides on this limit.
|
com.google.api.gax.rpc.UnaryCallable<ListConsumerOverridesRequest,ListConsumerOverridesResponse> |
listConsumerOverridesCallable()
Lists all consumer overrides on this limit.
|
com.google.api.gax.rpc.UnaryCallable<ListConsumerOverridesRequest,ServiceUsageClient.ListConsumerOverridesPagedResponse> |
listConsumerOverridesPagedCallable()
Lists all consumer overrides on this limit.
|
ServiceUsageClient.ListConsumerQuotaMetricsPagedResponse |
listConsumerQuotaMetrics(ListConsumerQuotaMetricsRequest request)
Retrieves a summary of all quota information visible to the service consumer, organized by
service metric.
|
com.google.api.gax.rpc.UnaryCallable<ListConsumerQuotaMetricsRequest,ListConsumerQuotaMetricsResponse> |
listConsumerQuotaMetricsCallable()
Retrieves a summary of all quota information visible to the service consumer, organized by
service metric.
|
com.google.api.gax.rpc.UnaryCallable<ListConsumerQuotaMetricsRequest,ServiceUsageClient.ListConsumerQuotaMetricsPagedResponse> |
listConsumerQuotaMetricsPagedCallable()
Retrieves a summary of all quota information visible to the service consumer, organized by
service metric.
|
ServiceUsageClient.ListServicesPagedResponse |
listServices(ListServicesRequest request)
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.UnaryCallable<ListServicesRequest,ListServicesResponse> |
listServicesCallable()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.UnaryCallable<ListServicesRequest,ServiceUsageClient.ListServicesPagedResponse> |
listServicesPagedCallable()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<QuotaOverride,OperationMetadata> |
updateAdminOverrideAsync(UpdateAdminOverrideRequest request)
Updates an admin override.
|
com.google.api.gax.rpc.UnaryCallable<UpdateAdminOverrideRequest,com.google.longrunning.Operation> |
updateAdminOverrideCallable()
Updates an admin override.
|
com.google.api.gax.rpc.OperationCallable<UpdateAdminOverrideRequest,QuotaOverride,OperationMetadata> |
updateAdminOverrideOperationCallable()
Updates an admin override.
|
com.google.api.gax.longrunning.OperationFuture<QuotaOverride,OperationMetadata> |
updateConsumerOverrideAsync(UpdateConsumerOverrideRequest request)
Updates a consumer override.
|
com.google.api.gax.rpc.UnaryCallable<UpdateConsumerOverrideRequest,com.google.longrunning.Operation> |
updateConsumerOverrideCallable()
Updates a consumer override.
|
com.google.api.gax.rpc.OperationCallable<UpdateConsumerOverrideRequest,QuotaOverride,OperationMetadata> |
updateConsumerOverrideOperationCallable()
Updates a consumer override.
|
protected ServiceUsageClient(ServiceUsageSettings settings) throws IOException
IOExceptionprotected ServiceUsageClient(ServiceUsageStub stub)
public static final ServiceUsageClient create() throws IOException
IOExceptionpublic static final ServiceUsageClient create(ServiceUsageSettings settings) throws IOException
IOExceptionpublic static final ServiceUsageClient create(ServiceUsageStub stub)
public final ServiceUsageSettings getSettings()
public ServiceUsageStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
@Deprecated public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> enableServiceAsync(EnableServiceRequest request)
Operation response type: `google.protobuf.Empty`
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
EnableServiceRequest request =
EnableServiceRequest.newBuilder().setName("name3373707").build();
serviceUsageClient.enableServiceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call fails@Deprecated public final com.google.api.gax.rpc.OperationCallable<EnableServiceRequest,com.google.protobuf.Empty,OperationMetadata> enableServiceOperationCallable()
Operation response type: `google.protobuf.Empty`
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
EnableServiceRequest request =
EnableServiceRequest.newBuilder().setName("name3373707").build();
OperationFuture<Empty, OperationMetadata> future =
serviceUsageClient.enableServiceOperationCallable().futureCall(request);
// Do something.
future.get();
}
@Deprecated public final com.google.api.gax.rpc.UnaryCallable<EnableServiceRequest,com.google.longrunning.Operation> enableServiceCallable()
Operation response type: `google.protobuf.Empty`
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
EnableServiceRequest request =
EnableServiceRequest.newBuilder().setName("name3373707").build();
ApiFuture<Operation> future = serviceUsageClient.enableServiceCallable().futureCall(request);
// Do something.
future.get();
}
@Deprecated public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> disableServiceAsync(DisableServiceRequest request)
It is not valid to call the disable method on a service that is not currently enabled. Callers will receive a `FAILED_PRECONDITION` status if the target service is not currently enabled.
Operation response type: `google.protobuf.Empty`
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DisableServiceRequest request =
DisableServiceRequest.newBuilder().setName("name3373707").build();
serviceUsageClient.disableServiceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call fails@Deprecated public final com.google.api.gax.rpc.OperationCallable<DisableServiceRequest,com.google.protobuf.Empty,OperationMetadata> disableServiceOperationCallable()
It is not valid to call the disable method on a service that is not currently enabled. Callers will receive a `FAILED_PRECONDITION` status if the target service is not currently enabled.
Operation response type: `google.protobuf.Empty`
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DisableServiceRequest request =
DisableServiceRequest.newBuilder().setName("name3373707").build();
OperationFuture<Empty, OperationMetadata> future =
serviceUsageClient.disableServiceOperationCallable().futureCall(request);
// Do something.
future.get();
}
@Deprecated public final com.google.api.gax.rpc.UnaryCallable<DisableServiceRequest,com.google.longrunning.Operation> disableServiceCallable()
It is not valid to call the disable method on a service that is not currently enabled. Callers will receive a `FAILED_PRECONDITION` status if the target service is not currently enabled.
Operation response type: `google.protobuf.Empty`
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DisableServiceRequest request =
DisableServiceRequest.newBuilder().setName("name3373707").build();
ApiFuture<Operation> future = serviceUsageClient.disableServiceCallable().futureCall(request);
// Do something.
future.get();
}
@Deprecated public final Service getService(GetServiceRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GetServiceRequest request = GetServiceRequest.newBuilder().setName("name3373707").build();
Service response = serviceUsageClient.getService(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call fails@Deprecated public final com.google.api.gax.rpc.UnaryCallable<GetServiceRequest,Service> getServiceCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GetServiceRequest request = GetServiceRequest.newBuilder().setName("name3373707").build();
ApiFuture<Service> future = serviceUsageClient.getServiceCallable().futureCall(request);
// Do something.
Service response = future.get();
}
@Deprecated public final ServiceUsageClient.ListServicesPagedResponse listServices(ListServicesRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ListServicesRequest request =
ListServicesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
for (Service element : serviceUsageClient.listServices(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call fails@Deprecated public final com.google.api.gax.rpc.UnaryCallable<ListServicesRequest,ServiceUsageClient.ListServicesPagedResponse> listServicesPagedCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ListServicesRequest request =
ListServicesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
ApiFuture<Service> future =
serviceUsageClient.listServicesPagedCallable().futureCall(request);
// Do something.
for (Service element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@Deprecated public final com.google.api.gax.rpc.UnaryCallable<ListServicesRequest,ListServicesResponse> listServicesCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ListServicesRequest request =
ListServicesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
while (true) {
ListServicesResponse response = serviceUsageClient.listServicesCallable().call(request);
for (Service element : response.getServicesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@Deprecated public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> batchEnableServicesAsync(BatchEnableServicesRequest request)
Operation response type: `google.protobuf.Empty`
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
BatchEnableServicesRequest request =
BatchEnableServicesRequest.newBuilder()
.setParent("parent-995424086")
.addAllServiceIds(new ArrayList<String>())
.build();
serviceUsageClient.batchEnableServicesAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call fails@Deprecated public final com.google.api.gax.rpc.OperationCallable<BatchEnableServicesRequest,com.google.protobuf.Empty,OperationMetadata> batchEnableServicesOperationCallable()
Operation response type: `google.protobuf.Empty`
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
BatchEnableServicesRequest request =
BatchEnableServicesRequest.newBuilder()
.setParent("parent-995424086")
.addAllServiceIds(new ArrayList<String>())
.build();
OperationFuture<Empty, OperationMetadata> future =
serviceUsageClient.batchEnableServicesOperationCallable().futureCall(request);
// Do something.
future.get();
}
@Deprecated public final com.google.api.gax.rpc.UnaryCallable<BatchEnableServicesRequest,com.google.longrunning.Operation> batchEnableServicesCallable()
Operation response type: `google.protobuf.Empty`
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
BatchEnableServicesRequest request =
BatchEnableServicesRequest.newBuilder()
.setParent("parent-995424086")
.addAllServiceIds(new ArrayList<String>())
.build();
ApiFuture<Operation> future =
serviceUsageClient.batchEnableServicesCallable().futureCall(request);
// Do something.
future.get();
}
public final ServiceUsageClient.ListConsumerQuotaMetricsPagedResponse listConsumerQuotaMetrics(ListConsumerQuotaMetricsRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ListConsumerQuotaMetricsRequest request =
ListConsumerQuotaMetricsRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setView(QuotaView.forNumber(0))
.build();
for (ConsumerQuotaMetric element :
serviceUsageClient.listConsumerQuotaMetrics(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListConsumerQuotaMetricsRequest,ServiceUsageClient.ListConsumerQuotaMetricsPagedResponse> listConsumerQuotaMetricsPagedCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ListConsumerQuotaMetricsRequest request =
ListConsumerQuotaMetricsRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setView(QuotaView.forNumber(0))
.build();
ApiFuture<ConsumerQuotaMetric> future =
serviceUsageClient.listConsumerQuotaMetricsPagedCallable().futureCall(request);
// Do something.
for (ConsumerQuotaMetric element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListConsumerQuotaMetricsRequest,ListConsumerQuotaMetricsResponse> listConsumerQuotaMetricsCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ListConsumerQuotaMetricsRequest request =
ListConsumerQuotaMetricsRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setView(QuotaView.forNumber(0))
.build();
while (true) {
ListConsumerQuotaMetricsResponse response =
serviceUsageClient.listConsumerQuotaMetricsCallable().call(request);
for (ConsumerQuotaMetric element : response.getMetricsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final ConsumerQuotaMetric getConsumerQuotaMetric(GetConsumerQuotaMetricRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GetConsumerQuotaMetricRequest request =
GetConsumerQuotaMetricRequest.newBuilder()
.setName("name3373707")
.setView(QuotaView.forNumber(0))
.build();
ConsumerQuotaMetric response = serviceUsageClient.getConsumerQuotaMetric(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetConsumerQuotaMetricRequest,ConsumerQuotaMetric> getConsumerQuotaMetricCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GetConsumerQuotaMetricRequest request =
GetConsumerQuotaMetricRequest.newBuilder()
.setName("name3373707")
.setView(QuotaView.forNumber(0))
.build();
ApiFuture<ConsumerQuotaMetric> future =
serviceUsageClient.getConsumerQuotaMetricCallable().futureCall(request);
// Do something.
ConsumerQuotaMetric response = future.get();
}
public final ConsumerQuotaLimit getConsumerQuotaLimit(GetConsumerQuotaLimitRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GetConsumerQuotaLimitRequest request =
GetConsumerQuotaLimitRequest.newBuilder()
.setName("name3373707")
.setView(QuotaView.forNumber(0))
.build();
ConsumerQuotaLimit response = serviceUsageClient.getConsumerQuotaLimit(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetConsumerQuotaLimitRequest,ConsumerQuotaLimit> getConsumerQuotaLimitCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GetConsumerQuotaLimitRequest request =
GetConsumerQuotaLimitRequest.newBuilder()
.setName("name3373707")
.setView(QuotaView.forNumber(0))
.build();
ApiFuture<ConsumerQuotaLimit> future =
serviceUsageClient.getConsumerQuotaLimitCallable().futureCall(request);
// Do something.
ConsumerQuotaLimit response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<QuotaOverride,OperationMetadata> createAdminOverrideAsync(CreateAdminOverrideRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
CreateAdminOverrideRequest request =
CreateAdminOverrideRequest.newBuilder()
.setParent("parent-995424086")
.setOverride(QuotaOverride.newBuilder().build())
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
QuotaOverride response = serviceUsageClient.createAdminOverrideAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateAdminOverrideRequest,QuotaOverride,OperationMetadata> createAdminOverrideOperationCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
CreateAdminOverrideRequest request =
CreateAdminOverrideRequest.newBuilder()
.setParent("parent-995424086")
.setOverride(QuotaOverride.newBuilder().build())
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
OperationFuture<QuotaOverride, OperationMetadata> future =
serviceUsageClient.createAdminOverrideOperationCallable().futureCall(request);
// Do something.
QuotaOverride response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateAdminOverrideRequest,com.google.longrunning.Operation> createAdminOverrideCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
CreateAdminOverrideRequest request =
CreateAdminOverrideRequest.newBuilder()
.setParent("parent-995424086")
.setOverride(QuotaOverride.newBuilder().build())
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
ApiFuture<Operation> future =
serviceUsageClient.createAdminOverrideCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<QuotaOverride,OperationMetadata> updateAdminOverrideAsync(UpdateAdminOverrideRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
UpdateAdminOverrideRequest request =
UpdateAdminOverrideRequest.newBuilder()
.setName("name3373707")
.setOverride(QuotaOverride.newBuilder().build())
.setForce(true)
.setUpdateMask(FieldMask.newBuilder().build())
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
QuotaOverride response = serviceUsageClient.updateAdminOverrideAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateAdminOverrideRequest,QuotaOverride,OperationMetadata> updateAdminOverrideOperationCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
UpdateAdminOverrideRequest request =
UpdateAdminOverrideRequest.newBuilder()
.setName("name3373707")
.setOverride(QuotaOverride.newBuilder().build())
.setForce(true)
.setUpdateMask(FieldMask.newBuilder().build())
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
OperationFuture<QuotaOverride, OperationMetadata> future =
serviceUsageClient.updateAdminOverrideOperationCallable().futureCall(request);
// Do something.
QuotaOverride response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateAdminOverrideRequest,com.google.longrunning.Operation> updateAdminOverrideCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
UpdateAdminOverrideRequest request =
UpdateAdminOverrideRequest.newBuilder()
.setName("name3373707")
.setOverride(QuotaOverride.newBuilder().build())
.setForce(true)
.setUpdateMask(FieldMask.newBuilder().build())
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
ApiFuture<Operation> future =
serviceUsageClient.updateAdminOverrideCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAdminOverrideAsync(DeleteAdminOverrideRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DeleteAdminOverrideRequest request =
DeleteAdminOverrideRequest.newBuilder()
.setName("name3373707")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
serviceUsageClient.deleteAdminOverrideAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteAdminOverrideRequest,com.google.protobuf.Empty,OperationMetadata> deleteAdminOverrideOperationCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DeleteAdminOverrideRequest request =
DeleteAdminOverrideRequest.newBuilder()
.setName("name3373707")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
OperationFuture<Empty, OperationMetadata> future =
serviceUsageClient.deleteAdminOverrideOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteAdminOverrideRequest,com.google.longrunning.Operation> deleteAdminOverrideCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DeleteAdminOverrideRequest request =
DeleteAdminOverrideRequest.newBuilder()
.setName("name3373707")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
ApiFuture<Operation> future =
serviceUsageClient.deleteAdminOverrideCallable().futureCall(request);
// Do something.
future.get();
}
public final ServiceUsageClient.ListAdminOverridesPagedResponse listAdminOverrides(ListAdminOverridesRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ListAdminOverridesRequest request =
ListAdminOverridesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (QuotaOverride element : serviceUsageClient.listAdminOverrides(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListAdminOverridesRequest,ServiceUsageClient.ListAdminOverridesPagedResponse> listAdminOverridesPagedCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ListAdminOverridesRequest request =
ListAdminOverridesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<QuotaOverride> future =
serviceUsageClient.listAdminOverridesPagedCallable().futureCall(request);
// Do something.
for (QuotaOverride element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListAdminOverridesRequest,ListAdminOverridesResponse> listAdminOverridesCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ListAdminOverridesRequest request =
ListAdminOverridesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListAdminOverridesResponse response =
serviceUsageClient.listAdminOverridesCallable().call(request);
for (QuotaOverride element : response.getOverridesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<ImportAdminOverridesResponse,ImportAdminOverridesMetadata> importAdminOverridesAsync(ImportAdminOverridesRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ImportAdminOverridesRequest request =
ImportAdminOverridesRequest.newBuilder()
.setParent("parent-995424086")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
ImportAdminOverridesResponse response =
serviceUsageClient.importAdminOverridesAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ImportAdminOverridesRequest,ImportAdminOverridesResponse,ImportAdminOverridesMetadata> importAdminOverridesOperationCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ImportAdminOverridesRequest request =
ImportAdminOverridesRequest.newBuilder()
.setParent("parent-995424086")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
OperationFuture<ImportAdminOverridesResponse, ImportAdminOverridesMetadata> future =
serviceUsageClient.importAdminOverridesOperationCallable().futureCall(request);
// Do something.
ImportAdminOverridesResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ImportAdminOverridesRequest,com.google.longrunning.Operation> importAdminOverridesCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ImportAdminOverridesRequest request =
ImportAdminOverridesRequest.newBuilder()
.setParent("parent-995424086")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
ApiFuture<Operation> future =
serviceUsageClient.importAdminOverridesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<QuotaOverride,OperationMetadata> createConsumerOverrideAsync(CreateConsumerOverrideRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
CreateConsumerOverrideRequest request =
CreateConsumerOverrideRequest.newBuilder()
.setParent("parent-995424086")
.setOverride(QuotaOverride.newBuilder().build())
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
QuotaOverride response = serviceUsageClient.createConsumerOverrideAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateConsumerOverrideRequest,QuotaOverride,OperationMetadata> createConsumerOverrideOperationCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
CreateConsumerOverrideRequest request =
CreateConsumerOverrideRequest.newBuilder()
.setParent("parent-995424086")
.setOverride(QuotaOverride.newBuilder().build())
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
OperationFuture<QuotaOverride, OperationMetadata> future =
serviceUsageClient.createConsumerOverrideOperationCallable().futureCall(request);
// Do something.
QuotaOverride response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateConsumerOverrideRequest,com.google.longrunning.Operation> createConsumerOverrideCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
CreateConsumerOverrideRequest request =
CreateConsumerOverrideRequest.newBuilder()
.setParent("parent-995424086")
.setOverride(QuotaOverride.newBuilder().build())
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
ApiFuture<Operation> future =
serviceUsageClient.createConsumerOverrideCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<QuotaOverride,OperationMetadata> updateConsumerOverrideAsync(UpdateConsumerOverrideRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
UpdateConsumerOverrideRequest request =
UpdateConsumerOverrideRequest.newBuilder()
.setName("name3373707")
.setOverride(QuotaOverride.newBuilder().build())
.setForce(true)
.setUpdateMask(FieldMask.newBuilder().build())
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
QuotaOverride response = serviceUsageClient.updateConsumerOverrideAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateConsumerOverrideRequest,QuotaOverride,OperationMetadata> updateConsumerOverrideOperationCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
UpdateConsumerOverrideRequest request =
UpdateConsumerOverrideRequest.newBuilder()
.setName("name3373707")
.setOverride(QuotaOverride.newBuilder().build())
.setForce(true)
.setUpdateMask(FieldMask.newBuilder().build())
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
OperationFuture<QuotaOverride, OperationMetadata> future =
serviceUsageClient.updateConsumerOverrideOperationCallable().futureCall(request);
// Do something.
QuotaOverride response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateConsumerOverrideRequest,com.google.longrunning.Operation> updateConsumerOverrideCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
UpdateConsumerOverrideRequest request =
UpdateConsumerOverrideRequest.newBuilder()
.setName("name3373707")
.setOverride(QuotaOverride.newBuilder().build())
.setForce(true)
.setUpdateMask(FieldMask.newBuilder().build())
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
ApiFuture<Operation> future =
serviceUsageClient.updateConsumerOverrideCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConsumerOverrideAsync(DeleteConsumerOverrideRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DeleteConsumerOverrideRequest request =
DeleteConsumerOverrideRequest.newBuilder()
.setName("name3373707")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
serviceUsageClient.deleteConsumerOverrideAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteConsumerOverrideRequest,com.google.protobuf.Empty,OperationMetadata> deleteConsumerOverrideOperationCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DeleteConsumerOverrideRequest request =
DeleteConsumerOverrideRequest.newBuilder()
.setName("name3373707")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
OperationFuture<Empty, OperationMetadata> future =
serviceUsageClient.deleteConsumerOverrideOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteConsumerOverrideRequest,com.google.longrunning.Operation> deleteConsumerOverrideCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DeleteConsumerOverrideRequest request =
DeleteConsumerOverrideRequest.newBuilder()
.setName("name3373707")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
ApiFuture<Operation> future =
serviceUsageClient.deleteConsumerOverrideCallable().futureCall(request);
// Do something.
future.get();
}
public final ServiceUsageClient.ListConsumerOverridesPagedResponse listConsumerOverrides(ListConsumerOverridesRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ListConsumerOverridesRequest request =
ListConsumerOverridesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (QuotaOverride element : serviceUsageClient.listConsumerOverrides(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListConsumerOverridesRequest,ServiceUsageClient.ListConsumerOverridesPagedResponse> listConsumerOverridesPagedCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ListConsumerOverridesRequest request =
ListConsumerOverridesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<QuotaOverride> future =
serviceUsageClient.listConsumerOverridesPagedCallable().futureCall(request);
// Do something.
for (QuotaOverride element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListConsumerOverridesRequest,ListConsumerOverridesResponse> listConsumerOverridesCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ListConsumerOverridesRequest request =
ListConsumerOverridesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListConsumerOverridesResponse response =
serviceUsageClient.listConsumerOverridesCallable().call(request);
for (QuotaOverride element : response.getOverridesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<ImportConsumerOverridesResponse,ImportConsumerOverridesMetadata> importConsumerOverridesAsync(ImportConsumerOverridesRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ImportConsumerOverridesRequest request =
ImportConsumerOverridesRequest.newBuilder()
.setParent("parent-995424086")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
ImportConsumerOverridesResponse response =
serviceUsageClient.importConsumerOverridesAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ImportConsumerOverridesRequest,ImportConsumerOverridesResponse,ImportConsumerOverridesMetadata> importConsumerOverridesOperationCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ImportConsumerOverridesRequest request =
ImportConsumerOverridesRequest.newBuilder()
.setParent("parent-995424086")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
OperationFuture<ImportConsumerOverridesResponse, ImportConsumerOverridesMetadata> future =
serviceUsageClient.importConsumerOverridesOperationCallable().futureCall(request);
// Do something.
ImportConsumerOverridesResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ImportConsumerOverridesRequest,com.google.longrunning.Operation> importConsumerOverridesCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
ImportConsumerOverridesRequest request =
ImportConsumerOverridesRequest.newBuilder()
.setParent("parent-995424086")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
ApiFuture<Operation> future =
serviceUsageClient.importConsumerOverridesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<ServiceIdentity,com.google.protobuf.Empty> generateServiceIdentityAsync(GenerateServiceIdentityRequest request)
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GenerateServiceIdentityRequest request =
GenerateServiceIdentityRequest.newBuilder().setParent("parent-995424086").build();
ServiceIdentity response = serviceUsageClient.generateServiceIdentityAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<GenerateServiceIdentityRequest,ServiceIdentity,com.google.protobuf.Empty> generateServiceIdentityOperationCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GenerateServiceIdentityRequest request =
GenerateServiceIdentityRequest.newBuilder().setParent("parent-995424086").build();
OperationFuture<ServiceIdentity, Empty> future =
serviceUsageClient.generateServiceIdentityOperationCallable().futureCall(request);
// Do something.
ServiceIdentity response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<GenerateServiceIdentityRequest,com.google.longrunning.Operation> generateServiceIdentityCallable()
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 (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GenerateServiceIdentityRequest request =
GenerateServiceIdentityRequest.newBuilder().setParent("parent-995424086").build();
ApiFuture<Operation> future =
serviceUsageClient.generateServiceIdentityCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2025 Google LLC. All rights reserved.