list method
Retrieves list of reports.
Request parameters:
profileId - The Campaign Manager 360 user profile ID.
maxResults - Maximum number of results to return.
pageToken - The value of the nextToken from the previous result page.
scope - The scope that defines which results are returned.
Possible string values are:
- "ALL" : All reports in account.
- "MINE" : My reports.
sortField - The field by which to sort the list.
Possible string values are:
- "ID" : Sort by report ID.
- "LAST_MODIFIED_TIME" : Sort by 'lastModifiedTime' field.
- "NAME" : Sort by name of reports.
sortOrder - Order of sorted results.
Possible string values are:
- "ASCENDING" : Ascending order.
- "DESCENDING" : Descending order.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a ReportList.
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<ReportList> list(
core.String profileId, {
core.int? maxResults,
core.String? pageToken,
core.String? scope,
core.String? sortField,
core.String? sortOrder,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'scope': ?scope == null ? null : [scope],
'sortField': ?sortField == null ? null : [sortField],
'sortOrder': ?sortOrder == null ? null : [sortOrder],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'userprofiles/' + commons.escapeVariable('$profileId') + '/reports';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ReportList.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}