create method

Future<TeamDrive> create(
  1. TeamDrive request,
  2. String requestId, {
  3. String? $fields,
})

Deprecated: Use drives.create instead.

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 Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned.

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

Completes with a TeamDrive.

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<TeamDrive> create(
  TeamDrive 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_ = 'teamdrives';

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