Class AppOptimizeClient

java.lang.Object
com.google.cloud.appoptimize.v1beta.AppOptimizeClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@BetaApi @Generated("by gapic-generator-java") public class AppOptimizeClient extends Object implements BackgroundResource
Service Description: Service for managing and querying optimization reports.

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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
   ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]");
   Report response = appOptimizeClient.getReport(name);
 }
 

Note: close() needs to be called on the AppOptimizeClient 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

CreateReport

Creates a new report.

This initiates a long-running operation that, upon completion, results in a report resource. Once the report is created, its results can be read via `ReadReport`.

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

  • createReportAsync(CreateReportRequest request)

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

  • createReportAsync(LocationName parent, Report report, String reportId)

  • createReportAsync(String parent, Report report, String reportId)

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

  • createReportOperationCallable()

  • createReportCallable()

GetReport

Retrieves the details of a report configuration.

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

  • getReport(GetReportRequest request)

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

  • getReport(ReportName name)

  • getReport(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.

  • getReportCallable()

ListReports

Lists reports within a given project.

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

  • listReports(ListReportsRequest request)

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

  • listReports(LocationName parent)

  • listReports(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.

  • listReportsPagedCallable()

  • listReportsCallable()

DeleteReport

Deletes the specified report.

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

  • deleteReport(DeleteReportRequest request)

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

  • deleteReport(ReportName name)

  • deleteReport(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.

  • deleteReportCallable()

ReadReport

Reads data within a specified report.

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

  • readReport(ReadReportRequest request)

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

  • readReport(ReportName name)

  • readReport(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.

  • readReportPagedCallable()

  • readReportCallable()

ListLocations

Lists information about the supported locations for this service.

This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:

* **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

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 AppOptimizeSettings 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
 AppOptimizeSettings appOptimizeSettings =
     AppOptimizeSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 AppOptimizeClient appOptimizeClient = AppOptimizeClient.create(appOptimizeSettings);
 

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
 AppOptimizeSettings appOptimizeSettings =
     AppOptimizeSettings.newBuilder().setEndpoint(myEndpoint).build();
 AppOptimizeClient appOptimizeClient = AppOptimizeClient.create(appOptimizeSettings);
 

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
 AppOptimizeSettings appOptimizeSettings = AppOptimizeSettings.newHttpJsonBuilder().build();
 AppOptimizeClient appOptimizeClient = AppOptimizeClient.create(appOptimizeSettings);
 

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

  • Constructor Details

    • AppOptimizeClient

      protected AppOptimizeClient(AppOptimizeSettings settings) throws IOException
      Constructs an instance of AppOptimizeClient, 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
    • AppOptimizeClient

      protected AppOptimizeClient(AppOptimizeStub stub)
  • Method Details

    • create

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

      public static final AppOptimizeClient create(AppOptimizeSettings settings) throws IOException
      Constructs an instance of AppOptimizeClient, 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 AppOptimizeClient create(AppOptimizeStub stub)
      Constructs an instance of AppOptimizeClient, using the given stub for making calls. This is for advanced usage - prefer using create(AppOptimizeSettings).
    • getSettings

      public final AppOptimizeSettings getSettings()
    • getStub

      public AppOptimizeStub 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.
    • createReportAsync

      public final OperationFuture<Report,OperationMetadata> createReportAsync(LocationName parent, Report report, String reportId)
      Creates a new report.

      This initiates a long-running operation that, upon completion, results in a report resource. Once the report is created, its results can be read via `ReadReport`.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         Report report = Report.newBuilder().build();
         String reportId = "reportId-427040401";
         Report response = appOptimizeClient.createReportAsync(parent, report, reportId).get();
       }
       
      Parameters:
      parent - Required. The parent Google Cloud project that will own the report.

      This value does not define the scope of the report data. See `Report.scope` for setting the data scope.

      Format: `projects/{project}/locations/{location}`.

      report - Required. The report resource to create.
      reportId - Required. The ID to use for this report. This ID must be unique within the parent project and should comply with RFC 1034 restrictions (letters, numbers, and hyphen, with the first character a letter, the last a letter or a number, and a 63 character maximum).
      Throws:
      ApiException - if the remote call fails
    • createReportAsync

      public final OperationFuture<Report,OperationMetadata> createReportAsync(String parent, Report report, String reportId)
      Creates a new report.

      This initiates a long-running operation that, upon completion, results in a report resource. Once the report is created, its results can be read via `ReadReport`.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         Report report = Report.newBuilder().build();
         String reportId = "reportId-427040401";
         Report response = appOptimizeClient.createReportAsync(parent, report, reportId).get();
       }
       
      Parameters:
      parent - Required. The parent Google Cloud project that will own the report.

      This value does not define the scope of the report data. See `Report.scope` for setting the data scope.

      Format: `projects/{project}/locations/{location}`.

      report - Required. The report resource to create.
      reportId - Required. The ID to use for this report. This ID must be unique within the parent project and should comply with RFC 1034 restrictions (letters, numbers, and hyphen, with the first character a letter, the last a letter or a number, and a 63 character maximum).
      Throws:
      ApiException - if the remote call fails
    • createReportAsync

      public final OperationFuture<Report,OperationMetadata> createReportAsync(CreateReportRequest request)
      Creates a new report.

      This initiates a long-running operation that, upon completion, results in a report resource. Once the report is created, its results can be read via `ReadReport`.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         CreateReportRequest request =
             CreateReportRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setReportId("reportId-427040401")
                 .setReport(Report.newBuilder().build())
                 .build();
         Report response = appOptimizeClient.createReportAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createReportOperationCallable

      public final OperationCallable<CreateReportRequest,Report,OperationMetadata> createReportOperationCallable()
      Creates a new report.

      This initiates a long-running operation that, upon completion, results in a report resource. Once the report is created, its results can be read via `ReadReport`.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         CreateReportRequest request =
             CreateReportRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setReportId("reportId-427040401")
                 .setReport(Report.newBuilder().build())
                 .build();
         OperationFuture<Report, OperationMetadata> future =
             appOptimizeClient.createReportOperationCallable().futureCall(request);
         // Do something.
         Report response = future.get();
       }
       
    • createReportCallable

      public final UnaryCallable<CreateReportRequest,Operation> createReportCallable()
      Creates a new report.

      This initiates a long-running operation that, upon completion, results in a report resource. Once the report is created, its results can be read via `ReadReport`.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         CreateReportRequest request =
             CreateReportRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setReportId("reportId-427040401")
                 .setReport(Report.newBuilder().build())
                 .build();
         ApiFuture<Operation> future = appOptimizeClient.createReportCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • getReport

      public final Report getReport(ReportName name)
      Retrieves the details of a report 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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]");
         Report response = appOptimizeClient.getReport(name);
       }
       
      Parameters:
      name - Required. The name of the report to retrieve.

      Format: `projects/{project}/locations/{location}/reports/{report_id}`.

      Throws:
      ApiException - if the remote call fails
    • getReport

      public final Report getReport(String name)
      Retrieves the details of a report 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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         String name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString();
         Report response = appOptimizeClient.getReport(name);
       }
       
      Parameters:
      name - Required. The name of the report to retrieve.

      Format: `projects/{project}/locations/{location}/reports/{report_id}`.

      Throws:
      ApiException - if the remote call fails
    • getReport

      public final Report getReport(GetReportRequest request)
      Retrieves the details of a report 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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         GetReportRequest request =
             GetReportRequest.newBuilder()
                 .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
                 .build();
         Report response = appOptimizeClient.getReport(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getReportCallable

      public final UnaryCallable<GetReportRequest,Report> getReportCallable()
      Retrieves the details of a report 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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         GetReportRequest request =
             GetReportRequest.newBuilder()
                 .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
                 .build();
         ApiFuture<Report> future = appOptimizeClient.getReportCallable().futureCall(request);
         // Do something.
         Report response = future.get();
       }
       
    • listReports

      public final AppOptimizeClient.ListReportsPagedResponse listReports(LocationName parent)
      Lists reports within a given project.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (Report element : appOptimizeClient.listReports(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent project whose reports are to be listed.

      Format: `projects/{project}/locations/{location}`.

      Throws:
      ApiException - if the remote call fails
    • listReports

      public final AppOptimizeClient.ListReportsPagedResponse listReports(String parent)
      Lists reports within a given project.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (Report element : appOptimizeClient.listReports(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent project whose reports are to be listed.

      Format: `projects/{project}/locations/{location}`.

      Throws:
      ApiException - if the remote call fails
    • listReports

      Lists reports within a given project.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         ListReportsRequest request =
             ListReportsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Report element : appOptimizeClient.listReports(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
    • listReportsPagedCallable

      Lists reports within a given project.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         ListReportsRequest request =
             ListReportsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Report> future = appOptimizeClient.listReportsPagedCallable().futureCall(request);
         // Do something.
         for (Report element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listReportsCallable

      public final UnaryCallable<ListReportsRequest,ListReportsResponse> listReportsCallable()
      Lists reports within a given project.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         ListReportsRequest request =
             ListReportsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListReportsResponse response = appOptimizeClient.listReportsCallable().call(request);
           for (Report element : response.getReportsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • deleteReport

      public final void deleteReport(ReportName name)
      Deletes the specified report.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]");
         appOptimizeClient.deleteReport(name);
       }
       
      Parameters:
      name - Required. The name of the report to delete.

      Format: `projects/{project}/locations/{location}/reports/{report_id}`.

      Throws:
      ApiException - if the remote call fails
    • deleteReport

      public final void deleteReport(String name)
      Deletes the specified report.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         String name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString();
         appOptimizeClient.deleteReport(name);
       }
       
      Parameters:
      name - Required. The name of the report to delete.

      Format: `projects/{project}/locations/{location}/reports/{report_id}`.

      Throws:
      ApiException - if the remote call fails
    • deleteReport

      public final void deleteReport(DeleteReportRequest request)
      Deletes the specified report.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         DeleteReportRequest request =
             DeleteReportRequest.newBuilder()
                 .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
                 .setAllowMissing(true)
                 .build();
         appOptimizeClient.deleteReport(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteReportCallable

      public final UnaryCallable<DeleteReportRequest,com.google.protobuf.Empty> deleteReportCallable()
      Deletes the specified report.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         DeleteReportRequest request =
             DeleteReportRequest.newBuilder()
                 .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
                 .setAllowMissing(true)
                 .build();
         ApiFuture<Empty> future = appOptimizeClient.deleteReportCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • readReport

      public final AppOptimizeClient.ReadReportPagedResponse readReport(ReportName name)
      Reads data within a specified report.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]");
         for (ListValue element : appOptimizeClient.readReport(name).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      name - Required. The resource name of the report to query.

      Format: `projects/{project}/locations/{location}/reports/{report_id}`.

      Throws:
      ApiException - if the remote call fails
    • readReport

      public final AppOptimizeClient.ReadReportPagedResponse readReport(String name)
      Reads data within a specified report.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         String name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString();
         for (ListValue element : appOptimizeClient.readReport(name).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      name - Required. The resource name of the report to query.

      Format: `projects/{project}/locations/{location}/reports/{report_id}`.

      Throws:
      ApiException - if the remote call fails
    • readReport

      Reads data within a specified report.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         ReadReportRequest request =
             ReadReportRequest.newBuilder()
                 .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (ListValue element : appOptimizeClient.readReport(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
    • readReportPagedCallable

      Reads data within a specified report.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         ReadReportRequest request =
             ReadReportRequest.newBuilder()
                 .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<ListValue> future = appOptimizeClient.readReportPagedCallable().futureCall(request);
         // Do something.
         for (ListValue element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • readReportCallable

      public final UnaryCallable<ReadReportRequest,ReadReportResponse> readReportCallable()
      Reads data within a specified report.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         ReadReportRequest request =
             ReadReportRequest.newBuilder()
                 .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ReadReportResponse response = appOptimizeClient.readReportCallable().call(request);
           for (ListValue element : response.getRowsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • listLocations

      Lists information about the supported locations for this service.

      This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:

      * **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

      For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Location element : appOptimizeClient.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.

      This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:

      * **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

      For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Location> future =
             appOptimizeClient.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.

      This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:

      * **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

      For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

      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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListLocationsResponse response = appOptimizeClient.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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         Location response = appOptimizeClient.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 (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Location> future = appOptimizeClient.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