Class AppOptimizeClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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().
| 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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteReport |
Deletes the specified report. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAppOptimizeClient(AppOptimizeSettings settings) Constructs an instance of AppOptimizeClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final AppOptimizeClientcreate()Constructs an instance of AppOptimizeClient with default settings.static final AppOptimizeClientcreate(AppOptimizeSettings settings) Constructs an instance of AppOptimizeClient, using the given settings.static final AppOptimizeClientcreate(AppOptimizeStub stub) Constructs an instance of AppOptimizeClient, using the given stub for making calls.createReportAsync(CreateReportRequest request) Creates a new report.createReportAsync(LocationName parent, Report report, String reportId) Creates a new report.createReportAsync(String parent, Report report, String reportId) Creates a new report.Creates a new report.Creates a new report.final voiddeleteReport(DeleteReportRequest request) Deletes the specified report.final voiddeleteReport(ReportName name) Deletes the specified report.final voiddeleteReport(String name) Deletes the specified report.final UnaryCallable<DeleteReportRequest,com.google.protobuf.Empty> Deletes the specified report.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final ReportgetReport(GetReportRequest request) Retrieves the details of a report configuration.final ReportgetReport(ReportName name) Retrieves the details of a report configuration.final ReportRetrieves the details of a report configuration.final UnaryCallable<GetReportRequest,Report> Retrieves the details of a report configuration.final AppOptimizeSettingsgetStub()booleanbooleanlistLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.listReports(ListReportsRequest request) Lists reports within a given project.listReports(LocationName parent) Lists reports within a given project.listReports(String parent) Lists reports within a given project.Lists reports within a given project.Lists reports within a given project.readReport(ReadReportRequest request) Reads data within a specified report.readReport(ReportName name) Reads data within a specified report.readReport(String name) Reads data within a specified report.Reads data within a specified report.Reads data within a specified report.voidshutdown()void
-
Constructor Details
-
AppOptimizeClient
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
-
-
Method Details
-
create
Constructs an instance of AppOptimizeClient with default settings.- Throws:
IOException
-
create
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
Constructs an instance of AppOptimizeClient, using the given stub for making calls. This is for advanced usage - prefer using create(AppOptimizeSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
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, createReportOperationCallable()OperationMetadata> 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
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
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
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
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
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
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
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
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); } } -
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
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
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
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
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
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
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
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); } } -
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
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 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
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 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
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
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
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:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-