generateIds method

Future<GeneratedIds> generateIds({
  1. int? count,
  2. String? space,
  3. String? type,
  4. String? $fields,
})

Generates a set of file IDs which can be provided in create or copy requests.

Request parameters:

count - The number of IDs to return. Value must be between "1" and "1000".

space - The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. (Default: 'drive')

type - The type of items which the IDs can be used for. Supported values are 'files' and 'shortcuts'. Note that 'shortcuts' are only supported in the drive 'space'. (Default: 'files')

$fields - Selector specifying which fields to include in a partial response.

Completes with a GeneratedIds.

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<GeneratedIds> generateIds({
  core.int? count,
  core.String? space,
  core.String? type,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (count != null) 'count': ['${count}'],
    if (space != null) 'space': [space],
    if (type != null) 'type': [type],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'files/generateIds';

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