Class AppOptimizeClient (0.1.0)

GitHub RepositoryProduct Reference

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 formatprojects/{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.

Inheritance

java.lang.Object > AppOptimizeClient

Static Methods

create()

public static final AppOptimizeClient create()

Constructs an instance of AppOptimizeClient with default settings.

Returns
Type Description
AppOptimizeClient
Exceptions
Type Description
IOException

create(AppOptimizeSettings settings)

public static final AppOptimizeClient create(AppOptimizeSettings settings)

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.

Parameter
Name Description
settings AppOptimizeSettings
Returns
Type Description
AppOptimizeClient
Exceptions
Type Description
IOException

create(AppOptimizeStub stub)

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).

Parameter
Name Description
stub AppOptimizeStub
Returns
Type Description
AppOptimizeClient

Constructors

AppOptimizeClient(AppOptimizeSettings settings)

protected AppOptimizeClient(AppOptimizeSettings settings)

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.

Parameter
Name Description
settings AppOptimizeSettings

AppOptimizeClient(AppOptimizeStub stub)

protected AppOptimizeClient(AppOptimizeStub stub)
Parameter
Name Description
stub AppOptimizeStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

createReportAsync(CreateReportRequest request)

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();
 }
 
Parameter
Name Description
request CreateReportRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Report,OperationMetadata>

createReportAsync(LocationName parent, Report report, String reportId)

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
Name Description
parent LocationName

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 Report

Required. The report resource to create.

reportId String

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).

Returns
Type Description
OperationFuture<Report,OperationMetadata>

createReportAsync(String parent, Report report, String reportId)

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
Name Description
parent String

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 Report

Required. The report resource to create.

reportId String

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).

Returns
Type Description
OperationFuture<Report,OperationMetadata>

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();
 }
 
Returns
Type Description
UnaryCallable<CreateReportRequest,Operation>

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();
 }
 
Returns
Type Description
OperationCallable<CreateReportRequest,Report,OperationMetadata>

deleteReport(DeleteReportRequest request)

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);
 }
 
Parameter
Name Description
request DeleteReportRequest

The request object containing all of the parameters for the API call.

deleteReport(ReportName name)

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);
 }
 
Parameter
Name Description
name ReportName

Required. The name of the report to delete.

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

deleteReport(String name)

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);
 }
 
Parameter
Name Description
name String

Required. The name of the report to delete.

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

deleteReportCallable()

public final UnaryCallable<DeleteReportRequest,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();
 }
 
Returns
Type Description
UnaryCallable<DeleteReportRequest,Empty>

getHttpJsonOperationsClient()

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.

Returns
Type Description
OperationsClient

getLocation(GetLocationRequest request)

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);
 }
 
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.cloud.location.Location

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();
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

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.

Returns
Type Description
OperationsClient

getReport(GetReportRequest request)

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);
 }
 
Parameter
Name Description
request GetReportRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Report

getReport(ReportName name)

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);
 }
 
Parameter
Name Description
name ReportName

Required. The name of the report to retrieve.

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

Returns
Type Description
Report

getReport(String name)

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);
 }
 
Parameter
Name Description
name String

Required. The name of the report to retrieve.

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

Returns
Type Description
Report

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();
 }
 
Returns
Type Description
UnaryCallable<GetReportRequest,Report>

getSettings()

public final AppOptimizeSettings getSettings()
Returns
Type Description
AppOptimizeSettings

getStub()

public AppOptimizeStub getStub()
Returns
Type Description
AppOptimizeStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listLocations(ListLocationsRequest request)

public final AppOptimizeClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

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 formatprojects/{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);
   }
 }
 
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AppOptimizeClient.ListLocationsPagedResponse

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 formatprojects/{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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,AppOptimizeClient.ListLocationsPagedResponse> 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 formatprojects/{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);
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

listReports(ListReportsRequest request)

public final AppOptimizeClient.ListReportsPagedResponse listReports(ListReportsRequest request)

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);
   }
 }
 
Parameter
Name Description
request ListReportsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AppOptimizeClient.ListReportsPagedResponse

listReports(LocationName parent)

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);
   }
 }
 
Parameter
Name Description
parent LocationName

Required. The parent project whose reports are to be listed.

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

Returns
Type Description
AppOptimizeClient.ListReportsPagedResponse

listReports(String parent)

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);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent project whose reports are to be listed.

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

Returns
Type Description
AppOptimizeClient.ListReportsPagedResponse

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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListReportsRequest,ListReportsResponse>

listReportsPagedCallable()

public final UnaryCallable<ListReportsRequest,AppOptimizeClient.ListReportsPagedResponse> 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);
   }
 }
 
Returns
Type Description
UnaryCallable<ListReportsRequest,ListReportsPagedResponse>

readReport(ReadReportRequest request)

public final AppOptimizeClient.ReadReportPagedResponse readReport(ReadReportRequest request)

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);
   }
 }
 
Parameter
Name Description
request ReadReportRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AppOptimizeClient.ReadReportPagedResponse

readReport(ReportName name)

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);
   }
 }
 
Parameter
Name Description
name ReportName

Required. The resource name of the report to query.

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

Returns
Type Description
AppOptimizeClient.ReadReportPagedResponse

readReport(String name)

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);
   }
 }
 
Parameter
Name Description
name String

Required. The resource name of the report to query.

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

Returns
Type Description
AppOptimizeClient.ReadReportPagedResponse

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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ReadReportRequest,ReadReportResponse>

readReportPagedCallable()

public final UnaryCallable<ReadReportRequest,AppOptimizeClient.ReadReportPagedResponse> 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);
   }
 }
 
Returns
Type Description
UnaryCallable<ReadReportRequest,ReadReportPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()