create method
Creates a shared drive.
request
- The metadata request object.
Request parameters:
requestId
- Required. An ID, such as a random UUID, which uniquely
identifies this user's request for idempotent creation of a shared drive.
A repeated request by the same user and with the same request ID will
avoid creating duplicates by attempting to create the same shared drive.
If the shared drive already exists a 409 error will be returned.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Drive.
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<Drive> create(
Drive request,
core.String requestId, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'requestId': [requestId],
if ($fields != null) 'fields': [$fields],
};
const url_ = 'drives';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Drive.fromJson(response_ as core.Map<core.String, core.dynamic>);
}