generateCseToken method
Generates a CSE token which can be used to create or update CSE files.
Request parameters:
fileId - The ID of the file for which the JWT should be generated. If
not provided, an id will be generated.
parent - The ID of the expected parent of the file. Used when generating
a JWT for a new CSE file. If specified, the parent will be fetched, and if
the parent is a shared drive item, the shared drive's policy will be used
to determine the KACLS that should be used. It is invalid to specify both
file_id and parent in a single request.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a GenerateCseTokenResponse.
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<GenerateCseTokenResponse> generateCseToken({
core.String? fileId,
core.String? parent,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fileId': ?fileId == null ? null : [fileId],
'parent': ?parent == null ? null : [parent],
'fields': ?$fields == null ? null : [$fields],
};
const url_ = 'files/generateCseToken';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GenerateCseTokenResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}