- 0.53.0 (latest)
- 0.52.0
- 0.51.0
- 0.50.0
- 0.49.0
- 0.47.0
- 0.46.0
- 0.45.0
- 0.44.0
- 0.43.0
- 0.42.0
- 0.41.0
- 0.40.0
- 0.39.0
- 0.38.0
- 0.37.0
- 0.35.0
- 0.34.0
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.29.0
- 0.28.0
- 0.27.0
- 0.26.0
- 0.25.0
- 0.22.0
- 0.21.0
- 0.20.0
- 0.19.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.0
- 0.13.0
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.5
GitHub Repository | Product Reference |
Service Description: Service for managing licenses.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
String name = "name3373707";
LicensePool response = licenseManagementServiceClient.getLicensePool(name);
}
Note: close() needs to be called on the LicenseManagementServiceClient 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 |
---|---|---|
GetLicensePool |
Gets the license pool. |
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.
|
UpdateLicensePool |
Updates the license pool if one exists for this Order. |
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.
|
Assign |
Assigns a license to a user. |
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.
|
Unassign |
Unassigns a license from a user. |
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.
|
EnumerateLicensedUsers |
Enumerates all users assigned a license. |
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 LicenseManagementServiceSettings 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
LicenseManagementServiceSettings licenseManagementServiceSettings =
LicenseManagementServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create(licenseManagementServiceSettings);
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
LicenseManagementServiceSettings licenseManagementServiceSettings =
LicenseManagementServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create(licenseManagementServiceSettings);
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
LicenseManagementServiceSettings licenseManagementServiceSettings =
LicenseManagementServiceSettings.newHttpJsonBuilder().build();
LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create(licenseManagementServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final LicenseManagementServiceClient create()
Constructs an instance of LicenseManagementServiceClient with default settings.
Returns | |
---|---|
Type | Description |
LicenseManagementServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(LicenseManagementServiceSettings settings)
public static final LicenseManagementServiceClient create(LicenseManagementServiceSettings settings)
Constructs an instance of LicenseManagementServiceClient, 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 |
LicenseManagementServiceSettings |
Returns | |
---|---|
Type | Description |
LicenseManagementServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(LicenseManagementServiceStub stub)
public static final LicenseManagementServiceClient create(LicenseManagementServiceStub stub)
Constructs an instance of LicenseManagementServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(LicenseManagementServiceSettings).
Parameter | |
---|---|
Name | Description |
stub |
LicenseManagementServiceStub |
Returns | |
---|---|
Type | Description |
LicenseManagementServiceClient |
Constructors
LicenseManagementServiceClient(LicenseManagementServiceSettings settings)
protected LicenseManagementServiceClient(LicenseManagementServiceSettings settings)
Constructs an instance of LicenseManagementServiceClient, 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 |
LicenseManagementServiceSettings |
LicenseManagementServiceClient(LicenseManagementServiceStub stub)
protected LicenseManagementServiceClient(LicenseManagementServiceStub stub)
Parameter | |
---|---|
Name | Description |
stub |
LicenseManagementServiceStub |
Methods
assign(AssignRequest request)
public final AssignResponse assign(AssignRequest request)
Assigns a license to a user.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
AssignRequest request =
AssignRequest.newBuilder()
.setParent("parent-995424086")
.addAllUsernames(new ArrayList<String>())
.build();
AssignResponse response = licenseManagementServiceClient.assign(request);
}
Parameter | |
---|---|
Name | Description |
request |
AssignRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
AssignResponse |
assign(String parent, List<String> usernames)
public final AssignResponse assign(String parent, List<String> usernames)
Assigns a license to a user.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
String parent = "parent-995424086";
List<String> usernames = new ArrayList<>();
AssignResponse response = licenseManagementServiceClient.assign(parent, usernames);
}
Parameters | |
---|---|
Name | Description |
parent |
String Required. License pool name. |
usernames |
List<String> Required. Username. Format: |
Returns | |
---|---|
Type | Description |
AssignResponse |
assignCallable()
public final UnaryCallable<AssignRequest,AssignResponse> assignCallable()
Assigns a license to a user.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
AssignRequest request =
AssignRequest.newBuilder()
.setParent("parent-995424086")
.addAllUsernames(new ArrayList<String>())
.build();
ApiFuture<AssignResponse> future =
licenseManagementServiceClient.assignCallable().futureCall(request);
// Do something.
AssignResponse response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<AssignRequest,AssignResponse> |
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()
enumerateLicensedUsers(EnumerateLicensedUsersRequest request)
public final LicenseManagementServiceClient.EnumerateLicensedUsersPagedResponse enumerateLicensedUsers(EnumerateLicensedUsersRequest request)
Enumerates all users assigned a license.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
EnumerateLicensedUsersRequest request =
EnumerateLicensedUsersRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (LicensedUser element :
licenseManagementServiceClient.enumerateLicensedUsers(request).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
request |
EnumerateLicensedUsersRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
LicenseManagementServiceClient.EnumerateLicensedUsersPagedResponse |
enumerateLicensedUsers(String parent)
public final LicenseManagementServiceClient.EnumerateLicensedUsersPagedResponse enumerateLicensedUsers(String parent)
Enumerates all users assigned a license.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
String parent = "parent-995424086";
for (LicensedUser element :
licenseManagementServiceClient.enumerateLicensedUsers(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
String Required. License pool name. |
Returns | |
---|---|
Type | Description |
LicenseManagementServiceClient.EnumerateLicensedUsersPagedResponse |
enumerateLicensedUsersCallable()
public final UnaryCallable<EnumerateLicensedUsersRequest,EnumerateLicensedUsersResponse> enumerateLicensedUsersCallable()
Enumerates all users assigned a license.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
EnumerateLicensedUsersRequest request =
EnumerateLicensedUsersRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
EnumerateLicensedUsersResponse response =
licenseManagementServiceClient.enumerateLicensedUsersCallable().call(request);
for (LicensedUser element : response.getLicensedUsersList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<EnumerateLicensedUsersRequest,EnumerateLicensedUsersResponse> |
enumerateLicensedUsersPagedCallable()
public final UnaryCallable<EnumerateLicensedUsersRequest,LicenseManagementServiceClient.EnumerateLicensedUsersPagedResponse> enumerateLicensedUsersPagedCallable()
Enumerates all users assigned a license.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
EnumerateLicensedUsersRequest request =
EnumerateLicensedUsersRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<LicensedUser> future =
licenseManagementServiceClient.enumerateLicensedUsersPagedCallable().futureCall(request);
// Do something.
for (LicensedUser element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<EnumerateLicensedUsersRequest,EnumerateLicensedUsersPagedResponse> |
getLicensePool(GetLicensePoolRequest request)
public final LicensePool getLicensePool(GetLicensePoolRequest request)
Gets the license pool.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
GetLicensePoolRequest request =
GetLicensePoolRequest.newBuilder().setName("name3373707").build();
LicensePool response = licenseManagementServiceClient.getLicensePool(request);
}
Parameter | |
---|---|
Name | Description |
request |
GetLicensePoolRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
LicensePool |
getLicensePool(String name)
public final LicensePool getLicensePool(String name)
Gets the license pool.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
String name = "name3373707";
LicensePool response = licenseManagementServiceClient.getLicensePool(name);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. The name of the license pool to get. Format:
|
Returns | |
---|---|
Type | Description |
LicensePool |
getLicensePoolCallable()
public final UnaryCallable<GetLicensePoolRequest,LicensePool> getLicensePoolCallable()
Gets the license pool.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
GetLicensePoolRequest request =
GetLicensePoolRequest.newBuilder().setName("name3373707").build();
ApiFuture<LicensePool> future =
licenseManagementServiceClient.getLicensePoolCallable().futureCall(request);
// Do something.
LicensePool response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetLicensePoolRequest,LicensePool> |
getSettings()
public final LicenseManagementServiceSettings getSettings()
Returns | |
---|---|
Type | Description |
LicenseManagementServiceSettings |
getStub()
public LicenseManagementServiceStub getStub()
Returns | |
---|---|
Type | Description |
LicenseManagementServiceStub |
isShutdown()
public boolean isShutdown()
Returns | |
---|---|
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Returns | |
---|---|
Type | Description |
boolean |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
unassign(UnassignRequest request)
public final UnassignResponse unassign(UnassignRequest request)
Unassigns a license from a user.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
UnassignRequest request =
UnassignRequest.newBuilder()
.setParent("parent-995424086")
.addAllUsernames(new ArrayList<String>())
.build();
UnassignResponse response = licenseManagementServiceClient.unassign(request);
}
Parameter | |
---|---|
Name | Description |
request |
UnassignRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
UnassignResponse |
unassign(String parent, List<String> usernames)
public final UnassignResponse unassign(String parent, List<String> usernames)
Unassigns a license from a user.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
String parent = "parent-995424086";
List<String> usernames = new ArrayList<>();
UnassignResponse response = licenseManagementServiceClient.unassign(parent, usernames);
}
Parameters | |
---|---|
Name | Description |
parent |
String Required. License pool name. |
usernames |
List<String> Required. Username. Format: |
Returns | |
---|---|
Type | Description |
UnassignResponse |
unassignCallable()
public final UnaryCallable<UnassignRequest,UnassignResponse> unassignCallable()
Unassigns a license from a user.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
UnassignRequest request =
UnassignRequest.newBuilder()
.setParent("parent-995424086")
.addAllUsernames(new ArrayList<String>())
.build();
ApiFuture<UnassignResponse> future =
licenseManagementServiceClient.unassignCallable().futureCall(request);
// Do something.
UnassignResponse response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<UnassignRequest,UnassignResponse> |
updateLicensePool(LicensePool licensePool, FieldMask updateMask)
public final LicensePool updateLicensePool(LicensePool licensePool, FieldMask updateMask)
Updates the license pool if one exists for this Order.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
LicensePool licensePool = LicensePool.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
LicensePool response =
licenseManagementServiceClient.updateLicensePool(licensePool, updateMask);
}
Parameters | |
---|---|
Name | Description |
licensePool |
LicensePool Required. The license pool to update. The license pool's name field is used to identify the license pool to update. Format:
|
updateMask |
FieldMask Required. The list of fields to update. |
Returns | |
---|---|
Type | Description |
LicensePool |
updateLicensePool(UpdateLicensePoolRequest request)
public final LicensePool updateLicensePool(UpdateLicensePoolRequest request)
Updates the license pool if one exists for this Order.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
UpdateLicensePoolRequest request =
UpdateLicensePoolRequest.newBuilder()
.setLicensePool(LicensePool.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
LicensePool response = licenseManagementServiceClient.updateLicensePool(request);
}
Parameter | |
---|---|
Name | Description |
request |
UpdateLicensePoolRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
LicensePool |
updateLicensePoolCallable()
public final UnaryCallable<UpdateLicensePoolRequest,LicensePool> updateLicensePoolCallable()
Updates the license pool if one exists for this Order.
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 (LicenseManagementServiceClient licenseManagementServiceClient =
LicenseManagementServiceClient.create()) {
UpdateLicensePoolRequest request =
UpdateLicensePoolRequest.newBuilder()
.setLicensePool(LicensePool.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<LicensePool> future =
licenseManagementServiceClient.updateLicensePoolCallable().futureCall(request);
// Do something.
LicensePool response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<UpdateLicensePoolRequest,LicensePool> |