get method
Gets the specified draft.
Request parameters:
userId
- The user's email address. The special value me
can be used to
indicate the authenticated user.
id
- The ID of the draft to retrieve.
format
- The format to return the draft in.
Possible string values are:
- "minimal" : Returns only email message ID and labels; does not return the email headers, body, or payload.
- "full" : Returns the full email message data with body content parsed in
the
payload
field; theraw
field is not used. Format cannot be used when accessing the api using the gmail.metadata scope. - "raw" : Returns the full email message data with body content in the
raw
field as a base64url encoded string; thepayload
field is not used. Format cannot be used when accessing the api using the gmail.metadata scope. - "metadata" : Returns only email message ID, labels, and email headers.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Draft.
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<Draft> get(
core.String userId,
core.String id, {
core.String? format,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (format != null) 'format': [format],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'gmail/v1/users/' +
commons.escapeVariable('$userId') +
'/drafts/' +
commons.escapeVariable('$id');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Draft.fromJson(response_ as core.Map<core.String, core.dynamic>);
}