Class LicenseManagerClient

java.lang.Object
com.google.cloud.licensemanager.v1.LicenseManagerClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class LicenseManagerClient extends Object implements BackgroundResource
Service Description: Service describing handlers for 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
   ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]");
   Configuration response = licenseManagerClient.getConfiguration(name);
 }
 

Note: close() needs to be called on the LicenseManagerClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

ListConfigurations

Lists Configurations in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listConfigurations(ListConfigurationsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listConfigurations(LocationName parent)

  • listConfigurations(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listConfigurationsPagedCallable()

  • listConfigurationsCallable()

GetConfiguration

Gets details of a single Configuration.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getConfiguration(GetConfigurationRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getConfiguration(ConfigurationName name)

  • getConfiguration(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getConfigurationCallable()

CreateConfiguration

Creates a new Configuration in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createConfigurationAsync(CreateConfigurationRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createConfigurationAsync(LocationName parent, Configuration configuration, String configurationId)

  • createConfigurationAsync(String parent, Configuration configuration, String configurationId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createConfigurationOperationCallable()

  • createConfigurationCallable()

UpdateConfiguration

Updates the parameters of a single Configuration.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateConfigurationAsync(UpdateConfigurationRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateConfigurationAsync(Configuration configuration, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateConfigurationOperationCallable()

  • updateConfigurationCallable()

DeleteConfiguration

Deletes a single Configuration.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteConfigurationAsync(DeleteConfigurationRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteConfigurationAsync(ConfigurationName name)

  • deleteConfigurationAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteConfigurationOperationCallable()

  • deleteConfigurationCallable()

ListInstances

Lists Instances in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listInstances(ListInstancesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listInstances(LocationName parent)

  • listInstances(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listInstancesPagedCallable()

  • listInstancesCallable()

GetInstance

Gets details of a single Instance.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getInstance(GetInstanceRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getInstance(InstanceName name)

  • getInstance(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getInstanceCallable()

DeactivateConfiguration

Deactivates the given configuration.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deactivateConfigurationAsync(DeactivateConfigurationRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deactivateConfigurationAsync(ConfigurationName name)

  • deactivateConfigurationAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deactivateConfigurationOperationCallable()

  • deactivateConfigurationCallable()

ReactivateConfiguration

Reactivates the given configuration.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • reactivateConfigurationAsync(ReactivateConfigurationRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • reactivateConfigurationAsync(ConfigurationName name)

  • reactivateConfigurationAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • reactivateConfigurationOperationCallable()

  • reactivateConfigurationCallable()

QueryConfigurationLicenseUsage

License Usage information for a Configuration.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • queryConfigurationLicenseUsage(QueryConfigurationLicenseUsageRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • queryConfigurationLicenseUsage(ConfigurationName name, Timestamp startTime, Timestamp endTime)

  • queryConfigurationLicenseUsage(String name, Timestamp startTime, Timestamp endTime)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • queryConfigurationLicenseUsageCallable()

AggregateUsage

Aggregates Usage per Instance for a Configuration.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • aggregateUsage(AggregateUsageRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • aggregateUsage(ConfigurationName name, Timestamp startTime, Timestamp endTime)

  • aggregateUsage(String name, Timestamp startTime, Timestamp endTime)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • aggregateUsagePagedCallable()

  • aggregateUsageCallable()

ListProducts

Lists Products in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listProducts(ListProductsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listProducts(LocationName parent)

  • listProducts(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listProductsPagedCallable()

  • listProductsCallable()

GetProduct

Gets details of a single Product.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getProduct(GetProductRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getProduct(ProductName name)

  • getProduct(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getProductCallable()

ListLocations

Lists information about the supported locations for this service.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

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 LicenseManagerSettings 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
 LicenseManagerSettings licenseManagerSettings =
     LicenseManagerSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 LicenseManagerClient licenseManagerClient = LicenseManagerClient.create(licenseManagerSettings);
 

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
 LicenseManagerSettings licenseManagerSettings =
     LicenseManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
 LicenseManagerClient licenseManagerClient = LicenseManagerClient.create(licenseManagerSettings);
 

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
 LicenseManagerSettings licenseManagerSettings =
     LicenseManagerSettings.newHttpJsonBuilder().build();
 LicenseManagerClient licenseManagerClient = LicenseManagerClient.create(licenseManagerSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

  • Constructor Details

    • LicenseManagerClient

      protected LicenseManagerClient(LicenseManagerSettings settings) throws IOException
      Constructs an instance of LicenseManagerClient, 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.
      Throws:
      IOException
    • LicenseManagerClient

      protected LicenseManagerClient(LicenseManagerStub stub)
  • Method Details

    • create

      public static final LicenseManagerClient create() throws IOException
      Constructs an instance of LicenseManagerClient with default settings.
      Throws:
      IOException
    • create

      public static final LicenseManagerClient create(LicenseManagerSettings settings) throws IOException
      Constructs an instance of LicenseManagerClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
      Throws:
      IOException
    • create

      public static final LicenseManagerClient create(LicenseManagerStub stub)
      Constructs an instance of LicenseManagerClient, using the given stub for making calls. This is for advanced usage - prefer using create(LicenseManagerSettings).
    • getSettings

      public final LicenseManagerSettings getSettings()
    • getStub

      public LicenseManagerStub getStub()
    • 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.
    • getHttpJsonOperationsClient

      @BetaApi public final OperationsClient getHttpJsonOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • listConfigurations

      public final LicenseManagerClient.ListConfigurationsPagedResponse listConfigurations(LocationName parent)
      Lists Configurations in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (Configuration element : licenseManagerClient.listConfigurations(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListConfigurationsRequest
      Throws:
      ApiException - if the remote call fails
    • listConfigurations

      public final LicenseManagerClient.ListConfigurationsPagedResponse listConfigurations(String parent)
      Lists Configurations in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (Configuration element : licenseManagerClient.listConfigurations(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListConfigurationsRequest
      Throws:
      ApiException - if the remote call fails
    • listConfigurations

      Lists Configurations in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ListConfigurationsRequest request =
             ListConfigurationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (Configuration element : licenseManagerClient.listConfigurations(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listConfigurationsPagedCallable

      Lists Configurations in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ListConfigurationsRequest request =
             ListConfigurationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<Configuration> future =
             licenseManagerClient.listConfigurationsPagedCallable().futureCall(request);
         // Do something.
         for (Configuration element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listConfigurationsCallable

      public final UnaryCallable<ListConfigurationsRequest,ListConfigurationsResponse> listConfigurationsCallable()
      Lists Configurations in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ListConfigurationsRequest request =
             ListConfigurationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListConfigurationsResponse response =
               licenseManagerClient.listConfigurationsCallable().call(request);
           for (Configuration element : response.getConfigurationsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getConfiguration

      public final Configuration getConfiguration(ConfigurationName name)
      Gets details of a single Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]");
         Configuration response = licenseManagerClient.getConfiguration(name);
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • getConfiguration

      public final Configuration getConfiguration(String name)
      Gets details of a single Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         String name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString();
         Configuration response = licenseManagerClient.getConfiguration(name);
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • getConfiguration

      public final Configuration getConfiguration(GetConfigurationRequest request)
      Gets details of a single Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         GetConfigurationRequest request =
             GetConfigurationRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .build();
         Configuration response = licenseManagerClient.getConfiguration(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getConfigurationCallable

      public final UnaryCallable<GetConfigurationRequest,Configuration> getConfigurationCallable()
      Gets details of a single Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         GetConfigurationRequest request =
             GetConfigurationRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .build();
         ApiFuture<Configuration> future =
             licenseManagerClient.getConfigurationCallable().futureCall(request);
         // Do something.
         Configuration response = future.get();
       }
       
    • createConfigurationAsync

      public final OperationFuture<Configuration,OperationMetadata> createConfigurationAsync(LocationName parent, Configuration configuration, String configurationId)
      Creates a new Configuration in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         Configuration configuration = Configuration.newBuilder().build();
         String configurationId = "configurationId1948915889";
         Configuration response =
             licenseManagerClient
                 .createConfigurationAsync(parent, configuration, configurationId)
                 .get();
       }
       
      Parameters:
      parent - Required. Value for parent.
      configuration - Required. The resource being created
      configurationId - Required. Id of the requesting object
      Throws:
      ApiException - if the remote call fails
    • createConfigurationAsync

      public final OperationFuture<Configuration,OperationMetadata> createConfigurationAsync(String parent, Configuration configuration, String configurationId)
      Creates a new Configuration in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         Configuration configuration = Configuration.newBuilder().build();
         String configurationId = "configurationId1948915889";
         Configuration response =
             licenseManagerClient
                 .createConfigurationAsync(parent, configuration, configurationId)
                 .get();
       }
       
      Parameters:
      parent - Required. Value for parent.
      configuration - Required. The resource being created
      configurationId - Required. Id of the requesting object
      Throws:
      ApiException - if the remote call fails
    • createConfigurationAsync

      public final OperationFuture<Configuration,OperationMetadata> createConfigurationAsync(CreateConfigurationRequest request)
      Creates a new Configuration in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         CreateConfigurationRequest request =
             CreateConfigurationRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setConfigurationId("configurationId1948915889")
                 .setConfiguration(Configuration.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Configuration response = licenseManagerClient.createConfigurationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createConfigurationOperationCallable

      public final OperationCallable<CreateConfigurationRequest,Configuration,OperationMetadata> createConfigurationOperationCallable()
      Creates a new Configuration in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         CreateConfigurationRequest request =
             CreateConfigurationRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setConfigurationId("configurationId1948915889")
                 .setConfiguration(Configuration.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Configuration, OperationMetadata> future =
             licenseManagerClient.createConfigurationOperationCallable().futureCall(request);
         // Do something.
         Configuration response = future.get();
       }
       
    • createConfigurationCallable

      public final UnaryCallable<CreateConfigurationRequest,Operation> createConfigurationCallable()
      Creates a new Configuration in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         CreateConfigurationRequest request =
             CreateConfigurationRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setConfigurationId("configurationId1948915889")
                 .setConfiguration(Configuration.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             licenseManagerClient.createConfigurationCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateConfigurationAsync

      public final OperationFuture<Configuration,OperationMetadata> updateConfigurationAsync(Configuration configuration, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         Configuration configuration = Configuration.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         Configuration response =
             licenseManagerClient.updateConfigurationAsync(configuration, updateMask).get();
       }
       
      Parameters:
      configuration - Required. The resource being updated
      updateMask - Optional. Field mask is used to specify the fields to be overwritten in the Configuration resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
      Throws:
      ApiException - if the remote call fails
    • updateConfigurationAsync

      public final OperationFuture<Configuration,OperationMetadata> updateConfigurationAsync(UpdateConfigurationRequest request)
      Updates the parameters of a single Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         UpdateConfigurationRequest request =
             UpdateConfigurationRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setConfiguration(Configuration.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Configuration response = licenseManagerClient.updateConfigurationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateConfigurationOperationCallable

      public final OperationCallable<UpdateConfigurationRequest,Configuration,OperationMetadata> updateConfigurationOperationCallable()
      Updates the parameters of a single Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         UpdateConfigurationRequest request =
             UpdateConfigurationRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setConfiguration(Configuration.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Configuration, OperationMetadata> future =
             licenseManagerClient.updateConfigurationOperationCallable().futureCall(request);
         // Do something.
         Configuration response = future.get();
       }
       
    • updateConfigurationCallable

      public final UnaryCallable<UpdateConfigurationRequest,Operation> updateConfigurationCallable()
      Updates the parameters of a single Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         UpdateConfigurationRequest request =
             UpdateConfigurationRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setConfiguration(Configuration.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             licenseManagerClient.updateConfigurationCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteConfigurationAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConfigurationAsync(ConfigurationName name)
      Deletes a single Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]");
         licenseManagerClient.deleteConfigurationAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • deleteConfigurationAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConfigurationAsync(String name)
      Deletes a single Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         String name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString();
         licenseManagerClient.deleteConfigurationAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • deleteConfigurationAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConfigurationAsync(DeleteConfigurationRequest request)
      Deletes a single Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         DeleteConfigurationRequest request =
             DeleteConfigurationRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         licenseManagerClient.deleteConfigurationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteConfigurationOperationCallable

      public final OperationCallable<DeleteConfigurationRequest,com.google.protobuf.Empty,OperationMetadata> deleteConfigurationOperationCallable()
      Deletes a single Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         DeleteConfigurationRequest request =
             DeleteConfigurationRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             licenseManagerClient.deleteConfigurationOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteConfigurationCallable

      public final UnaryCallable<DeleteConfigurationRequest,Operation> deleteConfigurationCallable()
      Deletes a single Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         DeleteConfigurationRequest request =
             DeleteConfigurationRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             licenseManagerClient.deleteConfigurationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listInstances

      Lists Instances in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (Instance element : licenseManagerClient.listInstances(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListInstancesRequest
      Throws:
      ApiException - if the remote call fails
    • listInstances

      public final LicenseManagerClient.ListInstancesPagedResponse listInstances(String parent)
      Lists Instances in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (Instance element : licenseManagerClient.listInstances(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListInstancesRequest
      Throws:
      ApiException - if the remote call fails
    • listInstances

      Lists Instances in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ListInstancesRequest request =
             ListInstancesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (Instance element : licenseManagerClient.listInstances(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listInstancesPagedCallable

      Lists Instances in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ListInstancesRequest request =
             ListInstancesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<Instance> future =
             licenseManagerClient.listInstancesPagedCallable().futureCall(request);
         // Do something.
         for (Instance element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listInstancesCallable

      public final UnaryCallable<ListInstancesRequest,ListInstancesResponse> listInstancesCallable()
      Lists Instances in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ListInstancesRequest request =
             ListInstancesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListInstancesResponse response = licenseManagerClient.listInstancesCallable().call(request);
           for (Instance element : response.getInstancesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getInstance

      public final Instance getInstance(InstanceName name)
      Gets details of a single Instance.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
         Instance response = licenseManagerClient.getInstance(name);
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • getInstance

      public final Instance getInstance(String name)
      Gets details of a single Instance.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
         Instance response = licenseManagerClient.getInstance(name);
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • getInstance

      public final Instance getInstance(GetInstanceRequest request)
      Gets details of a single Instance.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         GetInstanceRequest request =
             GetInstanceRequest.newBuilder()
                 .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
                 .build();
         Instance response = licenseManagerClient.getInstance(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getInstanceCallable

      public final UnaryCallable<GetInstanceRequest,Instance> getInstanceCallable()
      Gets details of a single Instance.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         GetInstanceRequest request =
             GetInstanceRequest.newBuilder()
                 .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
                 .build();
         ApiFuture<Instance> future = licenseManagerClient.getInstanceCallable().futureCall(request);
         // Do something.
         Instance response = future.get();
       }
       
    • deactivateConfigurationAsync

      public final OperationFuture<Configuration,OperationMetadata> deactivateConfigurationAsync(ConfigurationName name)
      Deactivates the given configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]");
         Configuration response = licenseManagerClient.deactivateConfigurationAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deactivateConfigurationAsync

      public final OperationFuture<Configuration,OperationMetadata> deactivateConfigurationAsync(String name)
      Deactivates the given configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         String name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString();
         Configuration response = licenseManagerClient.deactivateConfigurationAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deactivateConfigurationAsync

      public final OperationFuture<Configuration,OperationMetadata> deactivateConfigurationAsync(DeactivateConfigurationRequest request)
      Deactivates the given configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         DeactivateConfigurationRequest request =
             DeactivateConfigurationRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         Configuration response = licenseManagerClient.deactivateConfigurationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deactivateConfigurationOperationCallable

      public final OperationCallable<DeactivateConfigurationRequest,Configuration,OperationMetadata> deactivateConfigurationOperationCallable()
      Deactivates the given configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         DeactivateConfigurationRequest request =
             DeactivateConfigurationRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Configuration, OperationMetadata> future =
             licenseManagerClient.deactivateConfigurationOperationCallable().futureCall(request);
         // Do something.
         Configuration response = future.get();
       }
       
    • deactivateConfigurationCallable

      public final UnaryCallable<DeactivateConfigurationRequest,Operation> deactivateConfigurationCallable()
      Deactivates the given configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         DeactivateConfigurationRequest request =
             DeactivateConfigurationRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             licenseManagerClient.deactivateConfigurationCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • reactivateConfigurationAsync

      public final OperationFuture<Configuration,OperationMetadata> reactivateConfigurationAsync(ConfigurationName name)
      Reactivates the given configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]");
         Configuration response = licenseManagerClient.reactivateConfigurationAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • reactivateConfigurationAsync

      public final OperationFuture<Configuration,OperationMetadata> reactivateConfigurationAsync(String name)
      Reactivates the given configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         String name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString();
         Configuration response = licenseManagerClient.reactivateConfigurationAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • reactivateConfigurationAsync

      public final OperationFuture<Configuration,OperationMetadata> reactivateConfigurationAsync(ReactivateConfigurationRequest request)
      Reactivates the given configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ReactivateConfigurationRequest request =
             ReactivateConfigurationRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         Configuration response = licenseManagerClient.reactivateConfigurationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • reactivateConfigurationOperationCallable

      public final OperationCallable<ReactivateConfigurationRequest,Configuration,OperationMetadata> reactivateConfigurationOperationCallable()
      Reactivates the given configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ReactivateConfigurationRequest request =
             ReactivateConfigurationRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Configuration, OperationMetadata> future =
             licenseManagerClient.reactivateConfigurationOperationCallable().futureCall(request);
         // Do something.
         Configuration response = future.get();
       }
       
    • reactivateConfigurationCallable

      public final UnaryCallable<ReactivateConfigurationRequest,Operation> reactivateConfigurationCallable()
      Reactivates the given configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ReactivateConfigurationRequest request =
             ReactivateConfigurationRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             licenseManagerClient.reactivateConfigurationCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • queryConfigurationLicenseUsage

      public final QueryConfigurationLicenseUsageResponse queryConfigurationLicenseUsage(ConfigurationName name, com.google.protobuf.Timestamp startTime, com.google.protobuf.Timestamp endTime)
      License Usage information for a Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]");
         Timestamp startTime = Timestamp.newBuilder().build();
         Timestamp endTime = Timestamp.newBuilder().build();
         QueryConfigurationLicenseUsageResponse response =
             licenseManagerClient.queryConfigurationLicenseUsage(name, startTime, endTime);
       }
       
      Parameters:
      name - Required. The resource path of the Configuration.
      startTime - Required. The start time for retrieving the usage. If not specified, we will use the first day of the current billing period.
      endTime - Required. The end time for retrieving the usage. If not specified, we will use the last day of the current billing period.
      Throws:
      ApiException - if the remote call fails
    • queryConfigurationLicenseUsage

      public final QueryConfigurationLicenseUsageResponse queryConfigurationLicenseUsage(String name, com.google.protobuf.Timestamp startTime, com.google.protobuf.Timestamp endTime)
      License Usage information for a Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         String name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString();
         Timestamp startTime = Timestamp.newBuilder().build();
         Timestamp endTime = Timestamp.newBuilder().build();
         QueryConfigurationLicenseUsageResponse response =
             licenseManagerClient.queryConfigurationLicenseUsage(name, startTime, endTime);
       }
       
      Parameters:
      name - Required. The resource path of the Configuration.
      startTime - Required. The start time for retrieving the usage. If not specified, we will use the first day of the current billing period.
      endTime - Required. The end time for retrieving the usage. If not specified, we will use the last day of the current billing period.
      Throws:
      ApiException - if the remote call fails
    • queryConfigurationLicenseUsage

      public final QueryConfigurationLicenseUsageResponse queryConfigurationLicenseUsage(QueryConfigurationLicenseUsageRequest request)
      License Usage information for a Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         QueryConfigurationLicenseUsageRequest request =
             QueryConfigurationLicenseUsageRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setStartTime(Timestamp.newBuilder().build())
                 .setEndTime(Timestamp.newBuilder().build())
                 .build();
         QueryConfigurationLicenseUsageResponse response =
             licenseManagerClient.queryConfigurationLicenseUsage(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • queryConfigurationLicenseUsageCallable

      public final UnaryCallable<QueryConfigurationLicenseUsageRequest,QueryConfigurationLicenseUsageResponse> queryConfigurationLicenseUsageCallable()
      License Usage information for a Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         QueryConfigurationLicenseUsageRequest request =
             QueryConfigurationLicenseUsageRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setStartTime(Timestamp.newBuilder().build())
                 .setEndTime(Timestamp.newBuilder().build())
                 .build();
         ApiFuture<QueryConfigurationLicenseUsageResponse> future =
             licenseManagerClient.queryConfigurationLicenseUsageCallable().futureCall(request);
         // Do something.
         QueryConfigurationLicenseUsageResponse response = future.get();
       }
       
    • aggregateUsage

      public final LicenseManagerClient.AggregateUsagePagedResponse aggregateUsage(ConfigurationName name, com.google.protobuf.Timestamp startTime, com.google.protobuf.Timestamp endTime)
      Aggregates Usage per Instance for a Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]");
         Timestamp startTime = Timestamp.newBuilder().build();
         Timestamp endTime = Timestamp.newBuilder().build();
         for (Usage element :
             licenseManagerClient.aggregateUsage(name, startTime, endTime).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      name - Required. Parent value for AggregateUsageRequest
      startTime - Required. Licenses are purchased per month - so usage track needs start time of a month.
      endTime - Required. Usage track is always for a month. This parameter is for the end time of the month.
      Throws:
      ApiException - if the remote call fails
    • aggregateUsage

      public final LicenseManagerClient.AggregateUsagePagedResponse aggregateUsage(String name, com.google.protobuf.Timestamp startTime, com.google.protobuf.Timestamp endTime)
      Aggregates Usage per Instance for a Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         String name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString();
         Timestamp startTime = Timestamp.newBuilder().build();
         Timestamp endTime = Timestamp.newBuilder().build();
         for (Usage element :
             licenseManagerClient.aggregateUsage(name, startTime, endTime).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      name - Required. Parent value for AggregateUsageRequest
      startTime - Required. Licenses are purchased per month - so usage track needs start time of a month.
      endTime - Required. Usage track is always for a month. This parameter is for the end time of the month.
      Throws:
      ApiException - if the remote call fails
    • aggregateUsage

      Aggregates Usage per Instance for a Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         AggregateUsageRequest request =
             AggregateUsageRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .setStartTime(Timestamp.newBuilder().build())
                 .setEndTime(Timestamp.newBuilder().build())
                 .build();
         for (Usage element : licenseManagerClient.aggregateUsage(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • aggregateUsagePagedCallable

      Aggregates Usage per Instance for a Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         AggregateUsageRequest request =
             AggregateUsageRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .setStartTime(Timestamp.newBuilder().build())
                 .setEndTime(Timestamp.newBuilder().build())
                 .build();
         ApiFuture<Usage> future =
             licenseManagerClient.aggregateUsagePagedCallable().futureCall(request);
         // Do something.
         for (Usage element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • aggregateUsageCallable

      public final UnaryCallable<AggregateUsageRequest,AggregateUsageResponse> aggregateUsageCallable()
      Aggregates Usage per Instance for a Configuration.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         AggregateUsageRequest request =
             AggregateUsageRequest.newBuilder()
                 .setName(
                     ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .setStartTime(Timestamp.newBuilder().build())
                 .setEndTime(Timestamp.newBuilder().build())
                 .build();
         while (true) {
           AggregateUsageResponse response =
               licenseManagerClient.aggregateUsageCallable().call(request);
           for (Usage element : response.getUsagesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • listProducts

      Lists Products in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (Product element : licenseManagerClient.listProducts(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListProductsRequest
      Throws:
      ApiException - if the remote call fails
    • listProducts

      public final LicenseManagerClient.ListProductsPagedResponse listProducts(String parent)
      Lists Products in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (Product element : licenseManagerClient.listProducts(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListProductsRequest
      Throws:
      ApiException - if the remote call fails
    • listProducts

      Lists Products in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ListProductsRequest request =
             ListProductsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (Product element : licenseManagerClient.listProducts(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listProductsPagedCallable

      Lists Products in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ListProductsRequest request =
             ListProductsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<Product> future =
             licenseManagerClient.listProductsPagedCallable().futureCall(request);
         // Do something.
         for (Product element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listProductsCallable

      public final UnaryCallable<ListProductsRequest,ListProductsResponse> listProductsCallable()
      Lists Products in a given project and location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ListProductsRequest request =
             ListProductsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListProductsResponse response = licenseManagerClient.listProductsCallable().call(request);
           for (Product element : response.getProductsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getProduct

      public final Product getProduct(ProductName name)
      Gets details of a single Product.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
         Product response = licenseManagerClient.getProduct(name);
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • getProduct

      public final Product getProduct(String name)
      Gets details of a single Product.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         String name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]").toString();
         Product response = licenseManagerClient.getProduct(name);
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • getProduct

      public final Product getProduct(GetProductRequest request)
      Gets details of a single Product.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         GetProductRequest request =
             GetProductRequest.newBuilder()
                 .setName(ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]").toString())
                 .build();
         Product response = licenseManagerClient.getProduct(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getProductCallable

      public final UnaryCallable<GetProductRequest,Product> getProductCallable()
      Gets details of a single Product.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         GetProductRequest request =
             GetProductRequest.newBuilder()
                 .setName(ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]").toString())
                 .build();
         ApiFuture<Product> future = licenseManagerClient.getProductCallable().futureCall(request);
         // Do something.
         Product response = future.get();
       }
       
    • listLocations

      Lists information about the supported locations for this service.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Location element : licenseManagerClient.listLocations(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listLocationsPagedCallable

      Lists information about the supported locations for this service.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Location> future =
             licenseManagerClient.listLocationsPagedCallable().futureCall(request);
         // Do something.
         for (Location element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listLocationsCallable

      public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()
      Lists information about the supported locations for this service.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListLocationsResponse response = licenseManagerClient.listLocationsCallable().call(request);
           for (Location element : response.getLocationsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getLocation

      public final Location getLocation(GetLocationRequest request)
      Gets information about a location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         Location response = licenseManagerClient.getLocation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getLocationCallable

      public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
      Gets information about a location.

      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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Location> future = licenseManagerClient.getLocationCallable().futureCall(request);
         // Do something.
         Location response = future.get();
       }
       
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface BackgroundResource
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface BackgroundResource
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface BackgroundResource
    • shutdownNow

      public void shutdownNow()
      Specified by:
      shutdownNow in interface BackgroundResource
    • awaitTermination

      public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface BackgroundResource
      Throws:
      InterruptedException