insert method

Future<Groups> insert(
  1. String groupId, {
  2. String? $fields,
  3. Media? uploadMedia,
})

Inserts a new mail into the archive of the Google group.

Request parameters:

groupId - The group ID

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

uploadMedia - The media to upload.

Completes with a Groups.

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<Groups> insert(
  core.String groupId, {
  core.String? $fields,
  commons.Media? uploadMedia,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  core.String url_;
  if (uploadMedia == null) {
    url_ =
        'groups/v1/groups/' + commons.escapeVariable('$groupId') + '/archive';
  } else {
    url_ = '/upload/groups/v1/groups/' +
        commons.escapeVariable('$groupId') +
        '/archive';
  }

  final response_ = await _requester.request(
    url_,
    'POST',
    queryParams: queryParams_,
    uploadMedia: uploadMedia,
    uploadOptions: commons.UploadOptions.defaultOptions,
  );
  return Groups.fromJson(response_ as core.Map<core.String, core.dynamic>);
}