| GitHub Repository | Product Reference |
Service Description: Service for managing license config related resources.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
LicenseConfig licenseConfig = LicenseConfig.newBuilder().build();
String licenseConfigId = "licenseConfigId-372057250";
LicenseConfig response =
licenseConfigServiceClient.createLicenseConfig(parent, licenseConfig, licenseConfigId);
}
Note: close() needs to be called on the LicenseConfigServiceClient 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 |
|---|---|---|
CreateLicenseConfig |
Creates a LicenseConfig This method should only be used for creating NotebookLm licenses or Gemini Enterprise free trial licenses. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateLicenseConfig |
Updates the LicenseConfig |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLicenseConfig |
Gets a LicenseConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLicenseConfigs |
Lists all the LicenseConfigs associated with the project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DistributeLicenseConfig |
Distributes a LicenseConfig from billing account level to project level. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RetractLicenseConfig |
This method is called from the billing account side to retract the LicenseConfig from the given project back to the billing account. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
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 LicenseConfigServiceSettings 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
LicenseConfigServiceSettings licenseConfigServiceSettings =
LicenseConfigServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create(licenseConfigServiceSettings);
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
LicenseConfigServiceSettings licenseConfigServiceSettings =
LicenseConfigServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create(licenseConfigServiceSettings);
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
LicenseConfigServiceSettings licenseConfigServiceSettings =
LicenseConfigServiceSettings.newHttpJsonBuilder().build();
LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create(licenseConfigServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final LicenseConfigServiceClient create()Constructs an instance of LicenseConfigServiceClient with default settings.
| Returns | |
|---|---|
| Type | Description |
LicenseConfigServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(LicenseConfigServiceSettings settings)
public static final LicenseConfigServiceClient create(LicenseConfigServiceSettings settings)Constructs an instance of LicenseConfigServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
| Parameter | |
|---|---|
| Name | Description |
settings |
LicenseConfigServiceSettings |
| Returns | |
|---|---|
| Type | Description |
LicenseConfigServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(LicenseConfigServiceStub stub)
public static final LicenseConfigServiceClient create(LicenseConfigServiceStub stub)Constructs an instance of LicenseConfigServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(LicenseConfigServiceSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
LicenseConfigServiceStub |
| Returns | |
|---|---|
| Type | Description |
LicenseConfigServiceClient |
|
Constructors
LicenseConfigServiceClient(LicenseConfigServiceSettings settings)
protected LicenseConfigServiceClient(LicenseConfigServiceSettings settings)Constructs an instance of LicenseConfigServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
| Parameter | |
|---|---|
| Name | Description |
settings |
LicenseConfigServiceSettings |
LicenseConfigServiceClient(LicenseConfigServiceStub stub)
protected LicenseConfigServiceClient(LicenseConfigServiceStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
LicenseConfigServiceStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)| Parameters | |
|---|---|
| Name | Description |
duration |
long |
unit |
TimeUnit |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
| Exceptions | |
|---|---|
| Type | Description |
InterruptedException |
|
close()
public final void close()createLicenseConfig(CreateLicenseConfigRequest request)
public final LicenseConfig createLicenseConfig(CreateLicenseConfigRequest request)Creates a LicenseConfig This method should only be used for creating NotebookLm licenses or Gemini Enterprise free trial licenses.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
CreateLicenseConfigRequest request =
CreateLicenseConfigRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setLicenseConfig(LicenseConfig.newBuilder().build())
.setLicenseConfigId("licenseConfigId-372057250")
.build();
LicenseConfig response = licenseConfigServiceClient.createLicenseConfig(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateLicenseConfigRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
LicenseConfig |
|
createLicenseConfig(LocationName parent, LicenseConfig licenseConfig, String licenseConfigId)
public final LicenseConfig createLicenseConfig(LocationName parent, LicenseConfig licenseConfig, String licenseConfigId)Creates a LicenseConfig This method should only be used for creating NotebookLm licenses or Gemini Enterprise free trial licenses.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
LicenseConfig licenseConfig = LicenseConfig.newBuilder().build();
String licenseConfigId = "licenseConfigId-372057250";
LicenseConfig response =
licenseConfigServiceClient.createLicenseConfig(parent, licenseConfig, licenseConfigId);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The parent resource name, such as
|
licenseConfig |
LicenseConfigRequired. The LicenseConfig to create. |
licenseConfigId |
StringOptional. The ID to use for the
LicenseConfig, which will become the
final component of the LicenseConfig's
resource name. We are using the tier (product edition) name as the license config id such
as |
| Returns | |
|---|---|
| Type | Description |
LicenseConfig |
|
createLicenseConfig(String parent, LicenseConfig licenseConfig, String licenseConfigId)
public final LicenseConfig createLicenseConfig(String parent, LicenseConfig licenseConfig, String licenseConfigId)Creates a LicenseConfig This method should only be used for creating NotebookLm licenses or Gemini Enterprise free trial licenses.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
LicenseConfig licenseConfig = LicenseConfig.newBuilder().build();
String licenseConfigId = "licenseConfigId-372057250";
LicenseConfig response =
licenseConfigServiceClient.createLicenseConfig(parent, licenseConfig, licenseConfigId);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource name, such as
|
licenseConfig |
LicenseConfigRequired. The LicenseConfig to create. |
licenseConfigId |
StringOptional. The ID to use for the
LicenseConfig, which will become the
final component of the LicenseConfig's
resource name. We are using the tier (product edition) name as the license config id such
as |
| Returns | |
|---|---|
| Type | Description |
LicenseConfig |
|
createLicenseConfigCallable()
public final UnaryCallable<CreateLicenseConfigRequest,LicenseConfig> createLicenseConfigCallable()Creates a LicenseConfig This method should only be used for creating NotebookLm licenses or Gemini Enterprise free trial licenses.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
CreateLicenseConfigRequest request =
CreateLicenseConfigRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setLicenseConfig(LicenseConfig.newBuilder().build())
.setLicenseConfigId("licenseConfigId-372057250")
.build();
ApiFuture<LicenseConfig> future =
licenseConfigServiceClient.createLicenseConfigCallable().futureCall(request);
// Do something.
LicenseConfig response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateLicenseConfigRequest,LicenseConfig> |
|
distributeLicenseConfig(BillingAccountLicenseConfigName billingAccountLicenseConfig, long projectNumber, String location, long licenseCount, String licenseConfigId)
public final DistributeLicenseConfigResponse distributeLicenseConfig(BillingAccountLicenseConfigName billingAccountLicenseConfig, long projectNumber, String location, long licenseCount, String licenseConfigId)Distributes a LicenseConfig from billing account level to project level.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
BillingAccountLicenseConfigName billingAccountLicenseConfig =
BillingAccountLicenseConfigName.of(
"[BILLING_ACCOUNT]", "[BILLING_ACCOUNT_LICENSE_CONFIG]");
long projectNumber = 828084015;
String location = "location1901043637";
long licenseCount = -1565113455;
String licenseConfigId = "licenseConfigId-372057250";
DistributeLicenseConfigResponse response =
licenseConfigServiceClient.distributeLicenseConfig(
billingAccountLicenseConfig, projectNumber, location, licenseCount, licenseConfigId);
}
| Parameters | |
|---|---|
| Name | Description |
billingAccountLicenseConfig |
BillingAccountLicenseConfigNameRequired. Full resource name of [BillingAccountLicenseConfig][]. Format:
|
projectNumber |
longRequired. The target GCP project number to distribute the license config to. |
location |
StringRequired. The target GCP project region to distribute the license config to. |
licenseCount |
longRequired. The number of licenses to distribute. |
licenseConfigId |
StringOptional. Distribute seats to this license config instead of creating a new one. If not specified, a new license config will be created from the billing account license config. |
| Returns | |
|---|---|
| Type | Description |
DistributeLicenseConfigResponse |
|
distributeLicenseConfig(DistributeLicenseConfigRequest request)
public final DistributeLicenseConfigResponse distributeLicenseConfig(DistributeLicenseConfigRequest request)Distributes a LicenseConfig from billing account level to project level.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
DistributeLicenseConfigRequest request =
DistributeLicenseConfigRequest.newBuilder()
.setBillingAccountLicenseConfig(
BillingAccountLicenseConfigName.of(
"[BILLING_ACCOUNT]", "[BILLING_ACCOUNT_LICENSE_CONFIG]")
.toString())
.setProjectNumber(828084015)
.setLocation("location1901043637")
.setLicenseCount(-1565113455)
.setLicenseConfigId("licenseConfigId-372057250")
.build();
DistributeLicenseConfigResponse response =
licenseConfigServiceClient.distributeLicenseConfig(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
DistributeLicenseConfigRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
DistributeLicenseConfigResponse |
|
distributeLicenseConfig(String billingAccountLicenseConfig, long projectNumber, String location, long licenseCount, String licenseConfigId)
public final DistributeLicenseConfigResponse distributeLicenseConfig(String billingAccountLicenseConfig, long projectNumber, String location, long licenseCount, String licenseConfigId)Distributes a LicenseConfig from billing account level to project level.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
String billingAccountLicenseConfig =
BillingAccountLicenseConfigName.of(
"[BILLING_ACCOUNT]", "[BILLING_ACCOUNT_LICENSE_CONFIG]")
.toString();
long projectNumber = 828084015;
String location = "location1901043637";
long licenseCount = -1565113455;
String licenseConfigId = "licenseConfigId-372057250";
DistributeLicenseConfigResponse response =
licenseConfigServiceClient.distributeLicenseConfig(
billingAccountLicenseConfig, projectNumber, location, licenseCount, licenseConfigId);
}
| Parameters | |
|---|---|
| Name | Description |
billingAccountLicenseConfig |
StringRequired. Full resource name of [BillingAccountLicenseConfig][]. Format:
|
projectNumber |
longRequired. The target GCP project number to distribute the license config to. |
location |
StringRequired. The target GCP project region to distribute the license config to. |
licenseCount |
longRequired. The number of licenses to distribute. |
licenseConfigId |
StringOptional. Distribute seats to this license config instead of creating a new one. If not specified, a new license config will be created from the billing account license config. |
| Returns | |
|---|---|
| Type | Description |
DistributeLicenseConfigResponse |
|
distributeLicenseConfigCallable()
public final UnaryCallable<DistributeLicenseConfigRequest,DistributeLicenseConfigResponse> distributeLicenseConfigCallable()Distributes a LicenseConfig from billing account level to project level.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
DistributeLicenseConfigRequest request =
DistributeLicenseConfigRequest.newBuilder()
.setBillingAccountLicenseConfig(
BillingAccountLicenseConfigName.of(
"[BILLING_ACCOUNT]", "[BILLING_ACCOUNT_LICENSE_CONFIG]")
.toString())
.setProjectNumber(828084015)
.setLocation("location1901043637")
.setLicenseCount(-1565113455)
.setLicenseConfigId("licenseConfigId-372057250")
.build();
ApiFuture<DistributeLicenseConfigResponse> future =
licenseConfigServiceClient.distributeLicenseConfigCallable().futureCall(request);
// Do something.
DistributeLicenseConfigResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DistributeLicenseConfigRequest,DistributeLicenseConfigResponse> |
|
getLicenseConfig(GetLicenseConfigRequest request)
public final LicenseConfig getLicenseConfig(GetLicenseConfigRequest request)Gets a LicenseConfig.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
GetLicenseConfigRequest request =
GetLicenseConfigRequest.newBuilder()
.setName(
LicenseConfigName.of("[PROJECT]", "[LOCATION]", "[LICENSE_CONFIG]").toString())
.build();
LicenseConfig response = licenseConfigServiceClient.getLicenseConfig(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetLicenseConfigRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
LicenseConfig |
|
getLicenseConfig(LicenseConfigName name)
public final LicenseConfig getLicenseConfig(LicenseConfigName name)Gets a LicenseConfig.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
LicenseConfigName name = LicenseConfigName.of("[PROJECT]", "[LOCATION]", "[LICENSE_CONFIG]");
LicenseConfig response = licenseConfigServiceClient.getLicenseConfig(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
LicenseConfigNameRequired. Full resource name of
LicenseConfig, such as
If the caller does not have permission to access the LicenseConfig, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested LicenseConfig does not exist, a NOT_FOUND error is returned. |
| Returns | |
|---|---|
| Type | Description |
LicenseConfig |
|
getLicenseConfig(String name)
public final LicenseConfig getLicenseConfig(String name)Gets a LicenseConfig.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
String name = LicenseConfigName.of("[PROJECT]", "[LOCATION]", "[LICENSE_CONFIG]").toString();
LicenseConfig response = licenseConfigServiceClient.getLicenseConfig(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Full resource name of
LicenseConfig, such as
If the caller does not have permission to access the LicenseConfig, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested LicenseConfig does not exist, a NOT_FOUND error is returned. |
| Returns | |
|---|---|
| Type | Description |
LicenseConfig |
|
getLicenseConfigCallable()
public final UnaryCallable<GetLicenseConfigRequest,LicenseConfig> getLicenseConfigCallable()Gets a LicenseConfig.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
GetLicenseConfigRequest request =
GetLicenseConfigRequest.newBuilder()
.setName(
LicenseConfigName.of("[PROJECT]", "[LOCATION]", "[LICENSE_CONFIG]").toString())
.build();
ApiFuture<LicenseConfig> future =
licenseConfigServiceClient.getLicenseConfigCallable().futureCall(request);
// Do something.
LicenseConfig response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetLicenseConfigRequest,LicenseConfig> |
|
getSettings()
public final LicenseConfigServiceSettings getSettings()| Returns | |
|---|---|
| Type | Description |
LicenseConfigServiceSettings |
|
getStub()
public LicenseConfigServiceStub getStub()| Returns | |
|---|---|
| Type | Description |
LicenseConfigServiceStub |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listLicenseConfigs(ListLicenseConfigsRequest request)
public final LicenseConfigServiceClient.ListLicenseConfigsPagedResponse listLicenseConfigs(ListLicenseConfigsRequest request)Lists all the LicenseConfigs associated with the project.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
ListLicenseConfigsRequest request =
ListLicenseConfigsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
for (LicenseConfig element :
licenseConfigServiceClient.listLicenseConfigs(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListLicenseConfigsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
LicenseConfigServiceClient.ListLicenseConfigsPagedResponse |
|
listLicenseConfigs(LocationName parent)
public final LicenseConfigServiceClient.ListLicenseConfigsPagedResponse listLicenseConfigs(LocationName parent)Lists all the LicenseConfigs associated with the project.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (LicenseConfig element :
licenseConfigServiceClient.listLicenseConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The parent branch resource name, such as
|
| Returns | |
|---|---|
| Type | Description |
LicenseConfigServiceClient.ListLicenseConfigsPagedResponse |
|
listLicenseConfigs(String parent)
public final LicenseConfigServiceClient.ListLicenseConfigsPagedResponse listLicenseConfigs(String parent)Lists all the LicenseConfigs associated with the project.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (LicenseConfig element :
licenseConfigServiceClient.listLicenseConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent branch resource name, such as
|
| Returns | |
|---|---|
| Type | Description |
LicenseConfigServiceClient.ListLicenseConfigsPagedResponse |
|
listLicenseConfigsCallable()
public final UnaryCallable<ListLicenseConfigsRequest,ListLicenseConfigsResponse> listLicenseConfigsCallable()Lists all the LicenseConfigs associated with the project.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
ListLicenseConfigsRequest request =
ListLicenseConfigsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
while (true) {
ListLicenseConfigsResponse response =
licenseConfigServiceClient.listLicenseConfigsCallable().call(request);
for (LicenseConfig element : response.getLicenseConfigsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListLicenseConfigsRequest,ListLicenseConfigsResponse> |
|
listLicenseConfigsPagedCallable()
public final UnaryCallable<ListLicenseConfigsRequest,LicenseConfigServiceClient.ListLicenseConfigsPagedResponse> listLicenseConfigsPagedCallable()Lists all the LicenseConfigs associated with the project.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
ListLicenseConfigsRequest request =
ListLicenseConfigsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
ApiFuture<LicenseConfig> future =
licenseConfigServiceClient.listLicenseConfigsPagedCallable().futureCall(request);
// Do something.
for (LicenseConfig element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListLicenseConfigsRequest,ListLicenseConfigsPagedResponse> |
|
retractLicenseConfig(BillingAccountLicenseConfigName billingAccountLicenseConfig, LicenseConfigName licenseConfig, boolean fullRetract, long licenseCount)
public final RetractLicenseConfigResponse retractLicenseConfig(BillingAccountLicenseConfigName billingAccountLicenseConfig, LicenseConfigName licenseConfig, boolean fullRetract, long licenseCount)This method is called from the billing account side to retract the LicenseConfig from the given project back to the billing account.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
BillingAccountLicenseConfigName billingAccountLicenseConfig =
BillingAccountLicenseConfigName.of(
"[BILLING_ACCOUNT]", "[BILLING_ACCOUNT_LICENSE_CONFIG]");
LicenseConfigName licenseConfig =
LicenseConfigName.of("[PROJECT]", "[LOCATION]", "[LICENSE_CONFIG]");
boolean fullRetract = true;
long licenseCount = -1565113455;
RetractLicenseConfigResponse response =
licenseConfigServiceClient.retractLicenseConfig(
billingAccountLicenseConfig, licenseConfig, fullRetract, licenseCount);
}
| Parameters | |
|---|---|
| Name | Description |
billingAccountLicenseConfig |
BillingAccountLicenseConfigNameRequired. Full resource name of [BillingAccountLicenseConfig][]. Format:
|
licenseConfig |
LicenseConfigNameRequired. Full resource name of LicenseConfig. Format: |
fullRetract |
booleanOptional. If set to true, retract the entire license config. Otherwise, retract the specified license count. |
licenseCount |
longOptional. The number of licenses to retract. Only used when full_retract is false. |
| Returns | |
|---|---|
| Type | Description |
RetractLicenseConfigResponse |
|
retractLicenseConfig(BillingAccountLicenseConfigName billingAccountLicenseConfig, String licenseConfig, boolean fullRetract, long licenseCount)
public final RetractLicenseConfigResponse retractLicenseConfig(BillingAccountLicenseConfigName billingAccountLicenseConfig, String licenseConfig, boolean fullRetract, long licenseCount)This method is called from the billing account side to retract the LicenseConfig from the given project back to the billing account.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
BillingAccountLicenseConfigName billingAccountLicenseConfig =
BillingAccountLicenseConfigName.of(
"[BILLING_ACCOUNT]", "[BILLING_ACCOUNT_LICENSE_CONFIG]");
String licenseConfig =
LicenseConfigName.of("[PROJECT]", "[LOCATION]", "[LICENSE_CONFIG]").toString();
boolean fullRetract = true;
long licenseCount = -1565113455;
RetractLicenseConfigResponse response =
licenseConfigServiceClient.retractLicenseConfig(
billingAccountLicenseConfig, licenseConfig, fullRetract, licenseCount);
}
| Parameters | |
|---|---|
| Name | Description |
billingAccountLicenseConfig |
BillingAccountLicenseConfigNameRequired. Full resource name of [BillingAccountLicenseConfig][]. Format:
|
licenseConfig |
StringRequired. Full resource name of LicenseConfig. Format: |
fullRetract |
booleanOptional. If set to true, retract the entire license config. Otherwise, retract the specified license count. |
licenseCount |
longOptional. The number of licenses to retract. Only used when full_retract is false. |
| Returns | |
|---|---|
| Type | Description |
RetractLicenseConfigResponse |
|
retractLicenseConfig(RetractLicenseConfigRequest request)
public final RetractLicenseConfigResponse retractLicenseConfig(RetractLicenseConfigRequest request)This method is called from the billing account side to retract the LicenseConfig from the given project back to the billing account.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
RetractLicenseConfigRequest request =
RetractLicenseConfigRequest.newBuilder()
.setBillingAccountLicenseConfig(
BillingAccountLicenseConfigName.of(
"[BILLING_ACCOUNT]", "[BILLING_ACCOUNT_LICENSE_CONFIG]")
.toString())
.setLicenseConfig(
LicenseConfigName.of("[PROJECT]", "[LOCATION]", "[LICENSE_CONFIG]").toString())
.setFullRetract(true)
.setLicenseCount(-1565113455)
.build();
RetractLicenseConfigResponse response =
licenseConfigServiceClient.retractLicenseConfig(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
RetractLicenseConfigRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
RetractLicenseConfigResponse |
|
retractLicenseConfig(String billingAccountLicenseConfig, LicenseConfigName licenseConfig, boolean fullRetract, long licenseCount)
public final RetractLicenseConfigResponse retractLicenseConfig(String billingAccountLicenseConfig, LicenseConfigName licenseConfig, boolean fullRetract, long licenseCount)This method is called from the billing account side to retract the LicenseConfig from the given project back to the billing account.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
String billingAccountLicenseConfig =
BillingAccountLicenseConfigName.of(
"[BILLING_ACCOUNT]", "[BILLING_ACCOUNT_LICENSE_CONFIG]")
.toString();
LicenseConfigName licenseConfig =
LicenseConfigName.of("[PROJECT]", "[LOCATION]", "[LICENSE_CONFIG]");
boolean fullRetract = true;
long licenseCount = -1565113455;
RetractLicenseConfigResponse response =
licenseConfigServiceClient.retractLicenseConfig(
billingAccountLicenseConfig, licenseConfig, fullRetract, licenseCount);
}
| Parameters | |
|---|---|
| Name | Description |
billingAccountLicenseConfig |
StringRequired. Full resource name of [BillingAccountLicenseConfig][]. Format:
|
licenseConfig |
LicenseConfigNameRequired. Full resource name of LicenseConfig. Format: |
fullRetract |
booleanOptional. If set to true, retract the entire license config. Otherwise, retract the specified license count. |
licenseCount |
longOptional. The number of licenses to retract. Only used when full_retract is false. |
| Returns | |
|---|---|
| Type | Description |
RetractLicenseConfigResponse |
|
retractLicenseConfig(String billingAccountLicenseConfig, String licenseConfig, boolean fullRetract, long licenseCount)
public final RetractLicenseConfigResponse retractLicenseConfig(String billingAccountLicenseConfig, String licenseConfig, boolean fullRetract, long licenseCount)This method is called from the billing account side to retract the LicenseConfig from the given project back to the billing account.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
String billingAccountLicenseConfig =
BillingAccountLicenseConfigName.of(
"[BILLING_ACCOUNT]", "[BILLING_ACCOUNT_LICENSE_CONFIG]")
.toString();
String licenseConfig =
LicenseConfigName.of("[PROJECT]", "[LOCATION]", "[LICENSE_CONFIG]").toString();
boolean fullRetract = true;
long licenseCount = -1565113455;
RetractLicenseConfigResponse response =
licenseConfigServiceClient.retractLicenseConfig(
billingAccountLicenseConfig, licenseConfig, fullRetract, licenseCount);
}
| Parameters | |
|---|---|
| Name | Description |
billingAccountLicenseConfig |
StringRequired. Full resource name of [BillingAccountLicenseConfig][]. Format:
|
licenseConfig |
StringRequired. Full resource name of LicenseConfig. Format: |
fullRetract |
booleanOptional. If set to true, retract the entire license config. Otherwise, retract the specified license count. |
licenseCount |
longOptional. The number of licenses to retract. Only used when full_retract is false. |
| Returns | |
|---|---|
| Type | Description |
RetractLicenseConfigResponse |
|
retractLicenseConfigCallable()
public final UnaryCallable<RetractLicenseConfigRequest,RetractLicenseConfigResponse> retractLicenseConfigCallable()This method is called from the billing account side to retract the LicenseConfig from the given project back to the billing account.
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
RetractLicenseConfigRequest request =
RetractLicenseConfigRequest.newBuilder()
.setBillingAccountLicenseConfig(
BillingAccountLicenseConfigName.of(
"[BILLING_ACCOUNT]", "[BILLING_ACCOUNT_LICENSE_CONFIG]")
.toString())
.setLicenseConfig(
LicenseConfigName.of("[PROJECT]", "[LOCATION]", "[LICENSE_CONFIG]").toString())
.setFullRetract(true)
.setLicenseCount(-1565113455)
.build();
ApiFuture<RetractLicenseConfigResponse> future =
licenseConfigServiceClient.retractLicenseConfigCallable().futureCall(request);
// Do something.
RetractLicenseConfigResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<RetractLicenseConfigRequest,RetractLicenseConfigResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()updateLicenseConfig(LicenseConfig licenseConfig, FieldMask updateMask)
public final LicenseConfig updateLicenseConfig(LicenseConfig licenseConfig, FieldMask updateMask)Updates the LicenseConfig
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
LicenseConfig licenseConfig = LicenseConfig.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
LicenseConfig response =
licenseConfigServiceClient.updateLicenseConfig(licenseConfig, updateMask);
}
| Parameters | |
|---|---|
| Name | Description |
licenseConfig |
LicenseConfigRequired. The LicenseConfig to update. |
updateMask |
FieldMaskOptional. Indicates which fields in the provided LicenseConfig to update. If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned. |
| Returns | |
|---|---|
| Type | Description |
LicenseConfig |
|
updateLicenseConfig(UpdateLicenseConfigRequest request)
public final LicenseConfig updateLicenseConfig(UpdateLicenseConfigRequest request)Updates the LicenseConfig
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
UpdateLicenseConfigRequest request =
UpdateLicenseConfigRequest.newBuilder()
.setLicenseConfig(LicenseConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
LicenseConfig response = licenseConfigServiceClient.updateLicenseConfig(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateLicenseConfigRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
LicenseConfig |
|
updateLicenseConfigCallable()
public final UnaryCallable<UpdateLicenseConfigRequest,LicenseConfig> updateLicenseConfigCallable()Updates the LicenseConfig
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 (LicenseConfigServiceClient licenseConfigServiceClient =
LicenseConfigServiceClient.create()) {
UpdateLicenseConfigRequest request =
UpdateLicenseConfigRequest.newBuilder()
.setLicenseConfig(LicenseConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<LicenseConfig> future =
licenseConfigServiceClient.updateLicenseConfigCallable().futureCall(request);
// Do something.
LicenseConfig response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateLicenseConfigRequest,LicenseConfig> |
|