list method
Lists reports created by a specific job.
Returns NOT_FOUND if the job does not exist.
Request parameters:
jobId
- The ID of the job.
createdAfter
- If set, only reports created after the specified
date/time are returned.
onBehalfOfContentOwner
- The content owner's external ID on which behalf
the user is acting on. If not set, the user is acting for himself (his own
channel).
pageSize
- Requested page size. Server may return fewer report types
than requested. If unspecified, server will pick an appropriate default.
pageToken
- A token identifying a page of results the server should
return. Typically, this is the value of
ListReportsResponse.next_page_token returned in response to the previous
call to the ListReports
method.
startTimeAtOrAfter
- If set, only reports whose start time is greater
than or equal the specified date/time are returned.
startTimeBefore
- If set, only reports whose start time is smaller than
the specified date/time are returned.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListReportsResponse.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<ListReportsResponse> list(
core.String jobId, {
core.String? createdAfter,
core.String? onBehalfOfContentOwner,
core.int? pageSize,
core.String? pageToken,
core.String? startTimeAtOrAfter,
core.String? startTimeBefore,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (createdAfter != null) 'createdAfter': [createdAfter],
if (onBehalfOfContentOwner != null)
'onBehalfOfContentOwner': [onBehalfOfContentOwner],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if (startTimeAtOrAfter != null)
'startTimeAtOrAfter': [startTimeAtOrAfter],
if (startTimeBefore != null) 'startTimeBefore': [startTimeBefore],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/jobs/' + commons.escapeVariable('$jobId') + '/reports';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListReportsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}