list method

Future<FileList> list(
  1. String profileId, {
  2. int? maxResults,
  3. String? pageToken,
  4. String? scope,
  5. String? sortField,
  6. String? sortOrder,
  7. String? $fields,
})

Lists files for a user profile.

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 files in account.
  • "MINE" : My files.
  • "SHARED_WITH_ME" : Files shared with me.

sortField - The field by which to sort the list. Possible string values are:

  • "ID" : Sort by file ID.
  • "LAST_MODIFIED_TIME" : Sort by 'lastmodifiedAt' field.

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

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<FileList> 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>>{
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (scope != null) 'scope': [scope],
    if (sortField != null) 'sortField': [sortField],
    if (sortOrder != null) 'sortOrder': [sortOrder],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'userprofiles/' + commons.escapeVariable('$profileId') + '/files';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return FileList.fromJson(response_ as core.Map<core.String, core.dynamic>);
}