- 2.53.0 (latest)
- 2.52.0
- 2.51.0
- 2.49.0
- 2.48.0
- 2.47.0
- 2.46.0
- 2.45.0
- 2.44.0
- 2.43.0
- 2.42.0
- 2.41.0
- 2.40.0
- 2.39.0
- 2.37.0
- 2.36.0
- 2.35.0
- 2.34.0
- 2.33.0
- 2.32.0
- 2.31.0
- 2.30.0
- 2.29.0
- 2.28.0
- 2.27.0
- 2.24.0
- 2.23.0
- 2.22.0
- 2.21.0
- 2.20.0
- 2.19.0
- 2.18.0
- 2.17.0
- 2.16.0
- 2.15.0
- 2.14.0
- 2.13.0
- 2.12.0
- 2.11.0
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.7
- 2.2.8
public class ServiceUsageClient implements BackgroundResource
Service Description: Service Usage API
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:
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().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns 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:
ServiceUsageSettings serviceUsageSettings =
ServiceUsageSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ServiceUsageClient serviceUsageClient = ServiceUsageClient.create(serviceUsageSettings);
To customize the endpoint:
ServiceUsageSettings serviceUsageSettings =
ServiceUsageSettings.newBuilder().setEndpoint(myEndpoint).build();
ServiceUsageClient serviceUsageClient = ServiceUsageClient.create(serviceUsageSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceStatic Methods
create()
public static final ServiceUsageClient create()
Constructs an instance of ServiceUsageClient with default settings.
Type | Description |
ServiceUsageClient |
Type | Description |
IOException |
create(ServiceUsageSettings settings)
public static final ServiceUsageClient create(ServiceUsageSettings settings)
Constructs an instance of ServiceUsageClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings | ServiceUsageSettings |
Type | Description |
ServiceUsageClient |
Type | Description |
IOException |
create(ServiceUsageStub stub)
public static final ServiceUsageClient create(ServiceUsageStub stub)
Constructs an instance of ServiceUsageClient, using the given stub for making calls. This is for advanced usage - prefer using create(ServiceUsageSettings).
Name | Description |
stub | ServiceUsageStub |
Type | Description |
ServiceUsageClient |
Constructors
ServiceUsageClient(ServiceUsageSettings settings)
protected ServiceUsageClient(ServiceUsageSettings settings)
Constructs an instance of ServiceUsageClient, 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.
Name | Description |
settings | ServiceUsageSettings |
ServiceUsageClient(ServiceUsageStub stub)
protected ServiceUsageClient(ServiceUsageStub stub)
Name | Description |
stub | ServiceUsageStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
batchEnableServicesAsync(BatchEnableServicesRequest request) (deprecated)
public final OperationFuture<Empty,OperationMetadata> batchEnableServicesAsync(BatchEnableServicesRequest request)
Deprecated. This method is deprecated and will be removed in the next major version update.
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
Sample code:
try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
BatchEnableServicesRequest request =
BatchEnableServicesRequest.newBuilder()
.setParent("parent-995424086")
.addAllServiceIds(new ArrayList<String>())
.build();
serviceUsageClient.batchEnableServicesAsync(request).get();
}
Name | Description |
request | BatchEnableServicesRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Empty,OperationMetadata> |
batchEnableServicesCallable() (deprecated)
public final UnaryCallable<BatchEnableServicesRequest,Operation> batchEnableServicesCallable()
Deprecated. This method is deprecated and will be removed in the next major version update.
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
Sample code:
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();
}
Type | Description |
UnaryCallable<BatchEnableServicesRequest,Operation> |
batchEnableServicesOperationCallable() (deprecated)
public final OperationCallable<BatchEnableServicesRequest,Empty,OperationMetadata> batchEnableServicesOperationCallable()
Deprecated. This method is deprecated and will be removed in the next major version update.
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
Sample code:
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();
}
Type | Description |
OperationCallable<BatchEnableServicesRequest,Empty,OperationMetadata> |
close()
public final void close()
createAdminOverrideAsync(CreateAdminOverrideRequest request)
public final OperationFuture<QuotaOverride,OperationMetadata> createAdminOverrideAsync(CreateAdminOverrideRequest request)
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.
Sample code:
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();
}
Name | Description |
request | CreateAdminOverrideRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<QuotaOverride,OperationMetadata> |
createAdminOverrideCallable()
public final UnaryCallable<CreateAdminOverrideRequest,Operation> createAdminOverrideCallable()
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.
Sample code:
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();
}
Type | Description |
UnaryCallable<CreateAdminOverrideRequest,Operation> |
createAdminOverrideOperationCallable()
public final OperationCallable<CreateAdminOverrideRequest,QuotaOverride,OperationMetadata> createAdminOverrideOperationCallable()
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.
Sample code:
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();
}
Type | Description |
OperationCallable<CreateAdminOverrideRequest,QuotaOverride,OperationMetadata> |
createConsumerOverrideAsync(CreateConsumerOverrideRequest request)
public final OperationFuture<QuotaOverride,OperationMetadata> createConsumerOverrideAsync(CreateConsumerOverrideRequest request)
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.
Sample code:
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();
}
Name | Description |
request | CreateConsumerOverrideRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<QuotaOverride,OperationMetadata> |
createConsumerOverrideCallable()
public final UnaryCallable<CreateConsumerOverrideRequest,Operation> createConsumerOverrideCallable()
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.
Sample code:
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();
}
Type | Description |
UnaryCallable<CreateConsumerOverrideRequest,Operation> |
createConsumerOverrideOperationCallable()
public final OperationCallable<CreateConsumerOverrideRequest,QuotaOverride,OperationMetadata> createConsumerOverrideOperationCallable()
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.
Sample code:
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();
}
Type | Description |
OperationCallable<CreateConsumerOverrideRequest,QuotaOverride,OperationMetadata> |
deleteAdminOverrideAsync(DeleteAdminOverrideRequest request)
public final OperationFuture<Empty,OperationMetadata> deleteAdminOverrideAsync(DeleteAdminOverrideRequest request)
Deletes an admin override.
Sample code:
try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DeleteAdminOverrideRequest request =
DeleteAdminOverrideRequest.newBuilder()
.setName("name3373707")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
serviceUsageClient.deleteAdminOverrideAsync(request).get();
}
Name | Description |
request | DeleteAdminOverrideRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Empty,OperationMetadata> |
deleteAdminOverrideCallable()
public final UnaryCallable<DeleteAdminOverrideRequest,Operation> deleteAdminOverrideCallable()
Deletes an admin override.
Sample code:
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();
}
Type | Description |
UnaryCallable<DeleteAdminOverrideRequest,Operation> |
deleteAdminOverrideOperationCallable()
public final OperationCallable<DeleteAdminOverrideRequest,Empty,OperationMetadata> deleteAdminOverrideOperationCallable()
Deletes an admin override.
Sample code:
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();
}
Type | Description |
OperationCallable<DeleteAdminOverrideRequest,Empty,OperationMetadata> |
deleteConsumerOverrideAsync(DeleteConsumerOverrideRequest request)
public final OperationFuture<Empty,OperationMetadata> deleteConsumerOverrideAsync(DeleteConsumerOverrideRequest request)
Deletes a consumer override.
Sample code:
try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DeleteConsumerOverrideRequest request =
DeleteConsumerOverrideRequest.newBuilder()
.setName("name3373707")
.setForce(true)
.addAllForceOnly(new ArrayList<QuotaSafetyCheck>())
.build();
serviceUsageClient.deleteConsumerOverrideAsync(request).get();
}
Name | Description |
request | DeleteConsumerOverrideRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Empty,OperationMetadata> |
deleteConsumerOverrideCallable()
public final UnaryCallable<DeleteConsumerOverrideRequest,Operation> deleteConsumerOverrideCallable()
Deletes a consumer override.
Sample code:
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();
}
Type | Description |
UnaryCallable<DeleteConsumerOverrideRequest,Operation> |
deleteConsumerOverrideOperationCallable()
public final OperationCallable<DeleteConsumerOverrideRequest,Empty,OperationMetadata> deleteConsumerOverrideOperationCallable()
Deletes a consumer override.
Sample code:
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();
}
Type | Description |
OperationCallable<DeleteConsumerOverrideRequest,Empty,OperationMetadata> |
disableServiceAsync(DisableServiceRequest request) (deprecated)
public final OperationFuture<Empty,OperationMetadata> disableServiceAsync(DisableServiceRequest request)
Deprecated. This method is deprecated and will be removed in the next major version update.
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
Sample code:
try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DisableServiceRequest request =
DisableServiceRequest.newBuilder().setName("name3373707").build();
serviceUsageClient.disableServiceAsync(request).get();
}
Name | Description |
request | DisableServiceRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Empty,OperationMetadata> |
disableServiceCallable() (deprecated)
public final UnaryCallable<DisableServiceRequest,Operation> disableServiceCallable()
Deprecated. This method is deprecated and will be removed in the next major version update.
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
Sample code:
try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DisableServiceRequest request =
DisableServiceRequest.newBuilder().setName("name3373707").build();
ApiFuture<Operation> future = serviceUsageClient.disableServiceCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<DisableServiceRequest,Operation> |
disableServiceOperationCallable() (deprecated)
public final OperationCallable<DisableServiceRequest,Empty,OperationMetadata> disableServiceOperationCallable()
Deprecated. This method is deprecated and will be removed in the next major version update.
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
Sample code:
try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
DisableServiceRequest request =
DisableServiceRequest.newBuilder().setName("name3373707").build();
OperationFuture<Empty, OperationMetadata> future =
serviceUsageClient.disableServiceOperationCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
OperationCallable<DisableServiceRequest,Empty,OperationMetadata> |
enableServiceAsync(EnableServiceRequest request) (deprecated)
public final OperationFuture<Empty,OperationMetadata> enableServiceAsync(EnableServiceRequest request)
Deprecated. This method is deprecated and will be removed in the next major version update.
Enables a service so that it can be used with a project.
Operation response type: google.protobuf.Empty
Sample code:
try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
EnableServiceRequest request =
EnableServiceRequest.newBuilder().setName("name3373707").build();
serviceUsageClient.enableServiceAsync(request).get();
}
Name | Description |
request | EnableServiceRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Empty,OperationMetadata> |
enableServiceCallable() (deprecated)
public final UnaryCallable<EnableServiceRequest,Operation> enableServiceCallable()
Deprecated. This method is deprecated and will be removed in the next major version update.
Enables a service so that it can be used with a project.
Operation response type: google.protobuf.Empty
Sample code:
try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
EnableServiceRequest request =
EnableServiceRequest.newBuilder().setName("name3373707").build();
ApiFuture<Operation> future = serviceUsageClient.enableServiceCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<EnableServiceRequest,Operation> |
enableServiceOperationCallable() (deprecated)
public final OperationCallable<EnableServiceRequest,Empty,OperationMetadata> enableServiceOperationCallable()
Deprecated. This method is deprecated and will be removed in the next major version update.
Enables a service so that it can be used with a project.
Operation response type: google.protobuf.Empty
Sample code:
try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
EnableServiceRequest request =
EnableServiceRequest.newBuilder().setName("name3373707").build();
OperationFuture<Empty, OperationMetadata> future =
serviceUsageClient.enableServiceOperationCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
OperationCallable<EnableServiceRequest,Empty,OperationMetadata> |
generateServiceIdentityAsync(GenerateServiceIdentityRequest request)
public final OperationFuture<ServiceIdentity,Empty> generateServiceIdentityAsync(GenerateServiceIdentityRequest request)
Generates service identity for service.
Sample code:
try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GenerateServiceIdentityRequest request =
GenerateServiceIdentityRequest.newBuilder().setParent("parent-995424086").build();
ServiceIdentity response = serviceUsageClient.generateServiceIdentityAsync(request).get();
}
Name | Description |
request | GenerateServiceIdentityRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<ServiceIdentity,Empty> |
generateServiceIdentityCallable()
public final UnaryCallable<GenerateServiceIdentityRequest,Operation> generateServiceIdentityCallable()
Generates service identity for service.
Sample code:
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();
}
Type | Description |
UnaryCallable<GenerateServiceIdentityRequest,Operation> |
generateServiceIdentityOperationCallable()
public final OperationCallable<GenerateServiceIdentityRequest,ServiceIdentity,Empty> generateServiceIdentityOperationCallable()
Generates service identity for service.
Sample code:
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();
}
Type | Description |
OperationCallable<GenerateServiceIdentityRequest,ServiceIdentity,Empty> |
getConsumerQuotaLimit(GetConsumerQuotaLimitRequest request)
public final ConsumerQuotaLimit getConsumerQuotaLimit(GetConsumerQuotaLimitRequest request)
Retrieves a summary of quota information for a specific quota limit.
Sample code:
try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GetConsumerQuotaLimitRequest request =
GetConsumerQuotaLimitRequest.newBuilder()
.setName("name3373707")
.setView(QuotaView.forNumber(0))
.build();
ConsumerQuotaLimit response = serviceUsageClient.getConsumerQuotaLimit(request);
}
Name | Description |
request | GetConsumerQuotaLimitRequest The request object containing all of the parameters for the API call. |
Type | Description |
ConsumerQuotaLimit |
getConsumerQuotaLimitCallable()
public final UnaryCallable<GetConsumerQuotaLimitRequest,ConsumerQuotaLimit> getConsumerQuotaLimitCallable()
Retrieves a summary of quota information for a specific quota limit.
Sample code:
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();
}
Type | Description |
UnaryCallable<GetConsumerQuotaLimitRequest,ConsumerQuotaLimit> |
getConsumerQuotaMetric(GetConsumerQuotaMetricRequest request)
public final ConsumerQuotaMetric getConsumerQuotaMetric(GetConsumerQuotaMetricRequest request)
Retrieves a summary of quota information for a specific quota metric
Sample code:
try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GetConsumerQuotaMetricRequest request =
GetConsumerQuotaMetricRequest.newBuilder()
.setName("name3373707")
.setView(QuotaView.forNumber(0))
.build();
ConsumerQuotaMetric response = serviceUsageClient.getConsumerQuotaMetric(request);
}
Name | Description |
request | GetConsumerQuotaMetricRequest The request object containing all of the parameters for the API call. |
Type | Description |
ConsumerQuotaMetric |
getConsumerQuotaMetricCallable()
public final UnaryCallable<GetConsumerQuotaMetricRequest,ConsumerQuotaMetric> getConsumerQuotaMetricCallable()
Retrieves a summary of quota information for a specific quota metric
Sample code:
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();
}
Type | Description |
UnaryCallable<GetConsumerQuotaMetricRequest,ConsumerQuotaMetric> |
getOperationsClient()
public final OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Type | Description |
OperationsClient |
getService(GetServiceRequest request) (deprecated)
public final Service getService(GetServiceRequest request)
Deprecated. This method is deprecated and will be removed in the next major version update.
Returns the service configuration and enabled state for a given service.
Sample code:
try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) {
GetServiceRequest request = GetServiceRequest.newBuilder().setName("name3373707").build();
Service response = serviceUsageClient.getService(request);
}
Name | Description |
request | GetServiceRequest The request object containing all of the parameters for the API call. |
Type | Description |
Service |
getServiceCallable() (deprecated)
public final UnaryCallable<GetServiceRequest,Service> getServiceCallable()
Deprecated. This method is deprecated and will be removed in the next major version update.
Returns the service configuration and enabled state for a given service.
Sample code:
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();
}
Type | Description |
UnaryCallable<GetServiceRequest,Service> |
getSettings()
public final ServiceUsageSettings getSettings()
Type | Description |
ServiceUsageSettings |
getStub()
public ServiceUsageStub getStub()
Type | Description |
ServiceUsageStub |
importAdminOverridesAsync(ImportAdminOverridesRequest request)
public final 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. The name field in the quota override message should not be set.
Sample code:
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();
}
Name | Description |
request | ImportAdminOverridesRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<ImportAdminOverridesResponse,ImportAdminOverridesMetadata> |
importAdminOverridesCallable()
public final UnaryCallable<ImportAdminOverridesRequest,Operation> importAdminOverridesCallable()
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.
Sample code:
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();
}
Type | Description |
UnaryCallable<ImportAdminOverridesRequest,Operation> |
importAdminOverridesOperationCallable()
public final OperationCallable<ImportAdminOverridesRequest,ImportAdminOverridesResponse,ImportAdminOverridesMetadata> importAdminOverridesOperationCallable()
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.
Sample code:
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();
}
Type | Description |
OperationCallable<ImportAdminOverridesRequest,ImportAdminOverridesResponse,ImportAdminOverridesMetadata> |
importConsumerOverridesAsync(ImportConsumerOverridesRequest request)
public final 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. The name field in the quota override message should not be set.
Sample code:
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();
}
Name | Description |
request | ImportConsumerOverridesRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<ImportConsumerOverridesResponse,ImportConsumerOverridesMetadata> |
importConsumerOverridesCallable()
public final UnaryCallable<ImportConsumerOverridesRequest,Operation> importConsumerOverridesCallable()
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.
Sample code:
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();
}
Type | Description |
UnaryCallable<ImportConsumerOverridesRequest,Operation> |
importConsumerOverridesOperationCallable()
public final OperationCallable<ImportConsumerOverridesRequest,ImportConsumerOverridesResponse,ImportConsumerOverridesMetadata> importConsumerOverridesOperationCallable()
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.
Sample code:
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();
}
Type | Description |
OperationCallable<ImportConsumerOverridesRequest,ImportConsumerOverridesResponse,ImportConsumerOverridesMetadata> |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
listAdminOverrides(ListAdminOverridesRequest request)
public final ServiceUsageClient.ListAdminOverridesPagedResponse listAdminOverrides(ListAdminOverridesRequest request)
Lists all admin overrides on this limit.
Sample code:
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);
}
}
Name | Description |
request | ListAdminOverridesRequest The request object containing all of the parameters for the API call. |
Type | Description |
ServiceUsageClient.ListAdminOverridesPagedResponse |
listAdminOverridesCallable()
public final UnaryCallable<ListAdminOverridesRequest,ListAdminOverridesResponse> listAdminOverridesCallable()
Lists all admin overrides on this limit.
Sample code:
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.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListAdminOverridesRequest,ListAdminOverridesResponse> |
listAdminOverridesPagedCallable()
public final UnaryCallable<ListAdminOverridesRequest,ServiceUsageClient.ListAdminOverridesPagedResponse> listAdminOverridesPagedCallable()
Lists all admin overrides on this limit.
Sample code:
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);
}
}
Type | Description |
UnaryCallable<ListAdminOverridesRequest,ListAdminOverridesPagedResponse> |
listConsumerOverrides(ListConsumerOverridesRequest request)
public final ServiceUsageClient.ListConsumerOverridesPagedResponse listConsumerOverrides(ListConsumerOverridesRequest request)
Lists all consumer overrides on this limit.
Sample code:
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);
}
}
Name | Description |
request | ListConsumerOverridesRequest The request object containing all of the parameters for the API call. |
Type | Description |
ServiceUsageClient.ListConsumerOverridesPagedResponse |
listConsumerOverridesCallable()
public final UnaryCallable<ListConsumerOverridesRequest,ListConsumerOverridesResponse> listConsumerOverridesCallable()
Lists all consumer overrides on this limit.
Sample code:
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.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListConsumerOverridesRequest,ListConsumerOverridesResponse> |
listConsumerOverridesPagedCallable()
public final UnaryCallable<ListConsumerOverridesRequest,ServiceUsageClient.ListConsumerOverridesPagedResponse> listConsumerOverridesPagedCallable()
Lists all consumer overrides on this limit.
Sample code:
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);
}
}
Type | Description |
UnaryCallable<ListConsumerOverridesRequest,ListConsumerOverridesPagedResponse> |
listConsumerQuotaMetrics(ListConsumerQuotaMetricsRequest request)
public final ServiceUsageClient.ListConsumerQuotaMetricsPagedResponse listConsumerQuotaMetrics(ListConsumerQuotaMetricsRequest request)
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.
Sample code:
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);
}
}
Name | Description |
request | ListConsumerQuotaMetricsRequest The request object containing all of the parameters for the API call. |
Type | Description |
ServiceUsageClient.ListConsumerQuotaMetricsPagedResponse |
listConsumerQuotaMetricsCallable()
public final UnaryCallable<ListConsumerQuotaMetricsRequest,ListConsumerQuotaMetricsResponse> listConsumerQuotaMetricsCallable()
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.
Sample code:
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.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListConsumerQuotaMetricsRequest,ListConsumerQuotaMetricsResponse> |
listConsumerQuotaMetricsPagedCallable()
public final UnaryCallable<ListConsumerQuotaMetricsRequest,ServiceUsageClient.ListConsumerQuotaMetricsPagedResponse> listConsumerQuotaMetricsPagedCallable()
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.
Sample code:
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);
}
}
Type | Description |
UnaryCallable<ListConsumerQuotaMetricsRequest,ListConsumerQuotaMetricsPagedResponse> |
listServices(ListServicesRequest request) (deprecated)
public final ServiceUsageClient.ListServicesPagedResponse listServices(ListServicesRequest request)
Deprecated. This method is deprecated and will be removed in the next major version update.
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.
Sample code:
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);
}
}
Name | Description |
request | ListServicesRequest The request object containing all of the parameters for the API call. |
Type | Description |
ServiceUsageClient.ListServicesPagedResponse |
listServicesCallable() (deprecated)
public final UnaryCallable<ListServicesRequest,ListServicesResponse> listServicesCallable()
Deprecated. This method is deprecated and will be removed in the next major version update.
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.
Sample code:
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.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListServicesRequest,ListServicesResponse> |
listServicesPagedCallable() (deprecated)
public final UnaryCallable<ListServicesRequest,ServiceUsageClient.ListServicesPagedResponse> listServicesPagedCallable()
Deprecated. This method is deprecated and will be removed in the next major version update.
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.
Sample code:
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);
}
}
Type | Description |
UnaryCallable<ListServicesRequest,ListServicesPagedResponse> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
updateAdminOverrideAsync(UpdateAdminOverrideRequest request)
public final OperationFuture<QuotaOverride,OperationMetadata> updateAdminOverrideAsync(UpdateAdminOverrideRequest request)
Updates an admin override.
Sample code:
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();
}
Name | Description |
request | UpdateAdminOverrideRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<QuotaOverride,OperationMetadata> |
updateAdminOverrideCallable()
public final UnaryCallable<UpdateAdminOverrideRequest,Operation> updateAdminOverrideCallable()
Updates an admin override.
Sample code:
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();
}
Type | Description |
UnaryCallable<UpdateAdminOverrideRequest,Operation> |
updateAdminOverrideOperationCallable()
public final OperationCallable<UpdateAdminOverrideRequest,QuotaOverride,OperationMetadata> updateAdminOverrideOperationCallable()
Updates an admin override.
Sample code:
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();
}
Type | Description |
OperationCallable<UpdateAdminOverrideRequest,QuotaOverride,OperationMetadata> |
updateConsumerOverrideAsync(UpdateConsumerOverrideRequest request)
public final OperationFuture<QuotaOverride,OperationMetadata> updateConsumerOverrideAsync(UpdateConsumerOverrideRequest request)
Updates a consumer override.
Sample code:
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();
}
Name | Description |
request | UpdateConsumerOverrideRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<QuotaOverride,OperationMetadata> |
updateConsumerOverrideCallable()
public final UnaryCallable<UpdateConsumerOverrideRequest,Operation> updateConsumerOverrideCallable()
Updates a consumer override.
Sample code:
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();
}
Type | Description |
UnaryCallable<UpdateConsumerOverrideRequest,Operation> |
updateConsumerOverrideOperationCallable()
public final OperationCallable<UpdateConsumerOverrideRequest,QuotaOverride,OperationMetadata> updateConsumerOverrideOperationCallable()
Updates a consumer override.
Sample code:
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();
}
Type | Description |
OperationCallable<UpdateConsumerOverrideRequest,QuotaOverride,OperationMetadata> |