Class ReportServiceClient (0.13.0)

GitHub RepositoryProduct Reference

Service Description: Provides methods for interacting with 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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   ReportName name = ReportName.of("[NETWORK_CODE]", "[REPORT]");
   Report response = reportServiceClient.getReport(name);
 }
 

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

GetReport

API to retrieve a Report object.

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

API to retrieve a list of Report objects.

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(NetworkName 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()

CreateReport

API to create a Report object.

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

  • createReport(CreateReportRequest request)

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

  • createReport(NetworkName parent, Report report)

  • createReport(String parent, Report report)

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

  • createReportCallable()

UpdateReport

API to update a Report object.

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

  • updateReport(UpdateReportRequest request)

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

  • updateReport(Report report, FieldMask updateMask)

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

  • updateReportCallable()

RunReport

Initiates the execution of an existing report asynchronously. Users can get the report by polling this operation via OperationsService.GetOperation. Poll every 5 seconds initially, with an exponential backoff. Once a report is complete, the operation will contain a RunReportResponse in its response field containing a report_result that can be passed to the FetchReportResultRows method to retrieve the report data.

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

  • runReportAsync(RunReportRequest request)

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

  • runReportAsync(ReportName name)

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

  • runReportOperationCallable()

  • runReportCallable()

FetchReportResultRows

Returns the result rows from a completed report. The caller must have previously called RunReport and waited for that operation to complete. The rows will be returned according to the order specified by the sorts member of the report definition.

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

  • fetchReportResultRows(FetchReportResultRowsRequest request)

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

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

  • fetchReportResultRowsPagedCallable()

  • fetchReportResultRowsCallable()

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 ReportServiceSettings 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
 ReportServiceSettings reportServiceSettings =
     ReportServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ReportServiceClient reportServiceClient = ReportServiceClient.create(reportServiceSettings);
 

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
 ReportServiceSettings reportServiceSettings =
     ReportServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 ReportServiceClient reportServiceClient = ReportServiceClient.create(reportServiceSettings);
 

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

Inheritance

java.lang.Object > ReportServiceClient

Static Methods

create()

public static final ReportServiceClient create()

Constructs an instance of ReportServiceClient with default settings.

Returns
Type Description
ReportServiceClient
Exceptions
Type Description
IOException

create(ReportServiceSettings settings)

public static final ReportServiceClient create(ReportServiceSettings settings)

Constructs an instance of ReportServiceClient, 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 ReportServiceSettings
Returns
Type Description
ReportServiceClient
Exceptions
Type Description
IOException

create(ReportServiceStub stub)

public static final ReportServiceClient create(ReportServiceStub stub)

Constructs an instance of ReportServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(ReportServiceSettings).

Parameter
Name Description
stub ReportServiceStub
Returns
Type Description
ReportServiceClient

Constructors

ReportServiceClient(ReportServiceSettings settings)

protected ReportServiceClient(ReportServiceSettings settings)

Constructs an instance of ReportServiceClient, 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 ReportServiceSettings

ReportServiceClient(ReportServiceStub stub)

protected ReportServiceClient(ReportServiceStub stub)
Parameter
Name Description
stub ReportServiceStub

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

createReport(CreateReportRequest request)

public final Report createReport(CreateReportRequest request)

API to create a Report object.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   CreateReportRequest request =
       CreateReportRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setReport(Report.newBuilder().build())
           .build();
   Report response = reportServiceClient.createReport(request);
 }
 
Parameter
Name Description
request CreateReportRequest

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

Returns
Type Description
Report

createReport(NetworkName parent, Report report)

public final Report createReport(NetworkName parent, Report report)

API to create a Report object.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   Report report = Report.newBuilder().build();
   Report response = reportServiceClient.createReport(parent, report);
 }
 
Parameters
Name Description
parent NetworkName

Required. The parent resource where this Report will be created. Format: networks/{network_code}

report Report

Required. The Report to create.

Returns
Type Description
Report

createReport(String parent, Report report)

public final Report createReport(String parent, Report report)

API to create a Report object.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   Report report = Report.newBuilder().build();
   Report response = reportServiceClient.createReport(parent, report);
 }
 
Parameters
Name Description
parent String

Required. The parent resource where this Report will be created. Format: networks/{network_code}

report Report

Required. The Report to create.

Returns
Type Description
Report

createReportCallable()

public final UnaryCallable<CreateReportRequest,Report> createReportCallable()

API to create a Report object.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   CreateReportRequest request =
       CreateReportRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setReport(Report.newBuilder().build())
           .build();
   ApiFuture<Report> future = reportServiceClient.createReportCallable().futureCall(request);
   // Do something.
   Report response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateReportRequest,Report>

fetchReportResultRows(FetchReportResultRowsRequest request)

public final ReportServiceClient.FetchReportResultRowsPagedResponse fetchReportResultRows(FetchReportResultRowsRequest request)

Returns the result rows from a completed report. The caller must have previously called RunReport and waited for that operation to complete. The rows will be returned according to the order specified by the sorts member of the report definition.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   FetchReportResultRowsRequest request =
       FetchReportResultRowsRequest.newBuilder()
           .setName("name3373707")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Report.DataTable.Row element :
       reportServiceClient.fetchReportResultRows(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request FetchReportResultRowsRequest

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

Returns
Type Description
ReportServiceClient.FetchReportResultRowsPagedResponse

fetchReportResultRows(String name)

public final ReportServiceClient.FetchReportResultRowsPagedResponse fetchReportResultRows(String name)

Returns the result rows from a completed report. The caller must have previously called RunReport and waited for that operation to complete. The rows will be returned according to the order specified by the sorts member of the report definition.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   String name = "name3373707";
   for (Report.DataTable.Row element :
       reportServiceClient.fetchReportResultRows(name).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
name String

The report result being fetched. Format: networks/{network_code}/reports/{report_id}/results/{report_result_id}

Returns
Type Description
ReportServiceClient.FetchReportResultRowsPagedResponse

fetchReportResultRowsCallable()

public final UnaryCallable<FetchReportResultRowsRequest,FetchReportResultRowsResponse> fetchReportResultRowsCallable()

Returns the result rows from a completed report. The caller must have previously called RunReport and waited for that operation to complete. The rows will be returned according to the order specified by the sorts member of the report definition.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   FetchReportResultRowsRequest request =
       FetchReportResultRowsRequest.newBuilder()
           .setName("name3373707")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     FetchReportResultRowsResponse response =
         reportServiceClient.fetchReportResultRowsCallable().call(request);
     for (Report.DataTable.Row 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<FetchReportResultRowsRequest,FetchReportResultRowsResponse>

fetchReportResultRowsPagedCallable()

public final UnaryCallable<FetchReportResultRowsRequest,ReportServiceClient.FetchReportResultRowsPagedResponse> fetchReportResultRowsPagedCallable()

Returns the result rows from a completed report. The caller must have previously called RunReport and waited for that operation to complete. The rows will be returned according to the order specified by the sorts member of the report definition.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   FetchReportResultRowsRequest request =
       FetchReportResultRowsRequest.newBuilder()
           .setName("name3373707")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Report.DataTable.Row> future =
       reportServiceClient.fetchReportResultRowsPagedCallable().futureCall(request);
   // Do something.
   for (Report.DataTable.Row element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<FetchReportResultRowsRequest,FetchReportResultRowsPagedResponse>

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

getReport(GetReportRequest request)

public final Report getReport(GetReportRequest request)

API to retrieve a Report object.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   GetReportRequest request =
       GetReportRequest.newBuilder()
           .setName(ReportName.of("[NETWORK_CODE]", "[REPORT]").toString())
           .build();
   Report response = reportServiceClient.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)

API to retrieve a Report object.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   ReportName name = ReportName.of("[NETWORK_CODE]", "[REPORT]");
   Report response = reportServiceClient.getReport(name);
 }
 
Parameter
Name Description
name ReportName

Required. The resource name of the report. Format: networks/{network_code}/reports/{report_id}

Returns
Type Description
Report

getReport(String name)

public final Report getReport(String name)

API to retrieve a Report object.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   String name = ReportName.of("[NETWORK_CODE]", "[REPORT]").toString();
   Report response = reportServiceClient.getReport(name);
 }
 
Parameter
Name Description
name String

Required. The resource name of the report. Format: networks/{network_code}/reports/{report_id}

Returns
Type Description
Report

getReportCallable()

public final UnaryCallable<GetReportRequest,Report> getReportCallable()

API to retrieve a Report object.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   GetReportRequest request =
       GetReportRequest.newBuilder()
           .setName(ReportName.of("[NETWORK_CODE]", "[REPORT]").toString())
           .build();
   ApiFuture<Report> future = reportServiceClient.getReportCallable().futureCall(request);
   // Do something.
   Report response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetReportRequest,Report>

getSettings()

public final ReportServiceSettings getSettings()
Returns
Type Description
ReportServiceSettings

getStub()

public ReportServiceStub getStub()
Returns
Type Description
ReportServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listReports(ListReportsRequest request)

public final ReportServiceClient.ListReportsPagedResponse listReports(ListReportsRequest request)

API to retrieve a list of Report objects.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   ListReportsRequest request =
       ListReportsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .setSkip(3532159)
           .build();
   for (Report element : reportServiceClient.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
ReportServiceClient.ListReportsPagedResponse

listReports(NetworkName parent)

public final ReportServiceClient.ListReportsPagedResponse listReports(NetworkName parent)

API to retrieve a list of Report objects.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   for (Report element : reportServiceClient.listReports(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent NetworkName

Required. The parent, which owns this collection of reports. Format: networks/{network_code}

Returns
Type Description
ReportServiceClient.ListReportsPagedResponse

listReports(String parent)

public final ReportServiceClient.ListReportsPagedResponse listReports(String parent)

API to retrieve a list of Report objects.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   for (Report element : reportServiceClient.listReports(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent, which owns this collection of reports. Format: networks/{network_code}

Returns
Type Description
ReportServiceClient.ListReportsPagedResponse

listReportsCallable()

public final UnaryCallable<ListReportsRequest,ListReportsResponse> listReportsCallable()

API to retrieve a list of Report objects.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   ListReportsRequest request =
       ListReportsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .setSkip(3532159)
           .build();
   while (true) {
     ListReportsResponse response = reportServiceClient.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,ReportServiceClient.ListReportsPagedResponse> listReportsPagedCallable()

API to retrieve a list of Report objects.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   ListReportsRequest request =
       ListReportsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .setSkip(3532159)
           .build();
   ApiFuture<Report> future = reportServiceClient.listReportsPagedCallable().futureCall(request);
   // Do something.
   for (Report element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListReportsRequest,ListReportsPagedResponse>

runReportAsync(ReportName name)

public final OperationFuture<RunReportResponse,RunReportMetadata> runReportAsync(ReportName name)

Initiates the execution of an existing report asynchronously. Users can get the report by polling this operation via OperationsService.GetOperation. Poll every 5 seconds initially, with an exponential backoff. Once a report is complete, the operation will contain a RunReportResponse in its response field containing a report_result that can be passed to the FetchReportResultRows method to retrieve the report data.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   ReportName name = ReportName.of("[NETWORK_CODE]", "[REPORT]");
   RunReportResponse response = reportServiceClient.runReportAsync(name).get();
 }
 
Parameter
Name Description
name ReportName

Required. The report to run. Format: networks/{network_code}/reports/{report_id}

Returns
Type Description
OperationFuture<RunReportResponse,RunReportMetadata>

runReportAsync(RunReportRequest request)

public final OperationFuture<RunReportResponse,RunReportMetadata> runReportAsync(RunReportRequest request)

Initiates the execution of an existing report asynchronously. Users can get the report by polling this operation via OperationsService.GetOperation. Poll every 5 seconds initially, with an exponential backoff. Once a report is complete, the operation will contain a RunReportResponse in its response field containing a report_result that can be passed to the FetchReportResultRows method to retrieve the report data.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   RunReportRequest request =
       RunReportRequest.newBuilder()
           .setName(ReportName.of("[NETWORK_CODE]", "[REPORT]").toString())
           .build();
   RunReportResponse response = reportServiceClient.runReportAsync(request).get();
 }
 
Parameter
Name Description
request RunReportRequest

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

Returns
Type Description
OperationFuture<RunReportResponse,RunReportMetadata>

runReportAsync(String name)

public final OperationFuture<RunReportResponse,RunReportMetadata> runReportAsync(String name)

Initiates the execution of an existing report asynchronously. Users can get the report by polling this operation via OperationsService.GetOperation. Poll every 5 seconds initially, with an exponential backoff. Once a report is complete, the operation will contain a RunReportResponse in its response field containing a report_result that can be passed to the FetchReportResultRows method to retrieve the report data.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   String name = ReportName.of("[NETWORK_CODE]", "[REPORT]").toString();
   RunReportResponse response = reportServiceClient.runReportAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The report to run. Format: networks/{network_code}/reports/{report_id}

Returns
Type Description
OperationFuture<RunReportResponse,RunReportMetadata>

runReportCallable()

public final UnaryCallable<RunReportRequest,Operation> runReportCallable()

Initiates the execution of an existing report asynchronously. Users can get the report by polling this operation via OperationsService.GetOperation. Poll every 5 seconds initially, with an exponential backoff. Once a report is complete, the operation will contain a RunReportResponse in its response field containing a report_result that can be passed to the FetchReportResultRows method to retrieve the report data.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   RunReportRequest request =
       RunReportRequest.newBuilder()
           .setName(ReportName.of("[NETWORK_CODE]", "[REPORT]").toString())
           .build();
   ApiFuture<Operation> future = reportServiceClient.runReportCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<RunReportRequest,Operation>

runReportOperationCallable()

public final OperationCallable<RunReportRequest,RunReportResponse,RunReportMetadata> runReportOperationCallable()

Initiates the execution of an existing report asynchronously. Users can get the report by polling this operation via OperationsService.GetOperation. Poll every 5 seconds initially, with an exponential backoff. Once a report is complete, the operation will contain a RunReportResponse in its response field containing a report_result that can be passed to the FetchReportResultRows method to retrieve the report data.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   RunReportRequest request =
       RunReportRequest.newBuilder()
           .setName(ReportName.of("[NETWORK_CODE]", "[REPORT]").toString())
           .build();
   OperationFuture<RunReportResponse, RunReportMetadata> future =
       reportServiceClient.runReportOperationCallable().futureCall(request);
   // Do something.
   RunReportResponse response = future.get();
 }
 
Returns
Type Description
OperationCallable<RunReportRequest,RunReportResponse,RunReportMetadata>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateReport(Report report, FieldMask updateMask)

public final Report updateReport(Report report, FieldMask updateMask)

API to update a Report object.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   Report report = Report.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Report response = reportServiceClient.updateReport(report, updateMask);
 }
 
Parameters
Name Description
report Report

Required. The Report to update.

updateMask FieldMask

Required. The list of fields to update.

Returns
Type Description
Report

updateReport(UpdateReportRequest request)

public final Report updateReport(UpdateReportRequest request)

API to update a Report object.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   UpdateReportRequest request =
       UpdateReportRequest.newBuilder()
           .setReport(Report.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Report response = reportServiceClient.updateReport(request);
 }
 
Parameter
Name Description
request UpdateReportRequest

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

Returns
Type Description
Report

updateReportCallable()

public final UnaryCallable<UpdateReportRequest,Report> updateReportCallable()

API to update a Report object.

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 (ReportServiceClient reportServiceClient = ReportServiceClient.create()) {
   UpdateReportRequest request =
       UpdateReportRequest.newBuilder()
           .setReport(Report.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Report> future = reportServiceClient.updateReportCallable().futureCall(request);
   // Do something.
   Report response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateReportRequest,Report>