Table of Contents

Class UsersResource.DraftsResource

Namespace
Google.Apis.Gmail.v1
Assembly
Google.Apis.Gmail.v1.dll

The "drafts" collection of methods.

public class UsersResource.DraftsResource
Inheritance
UsersResource.DraftsResource
Inherited Members

Constructors

DraftsResource(IClientService)

Constructs a new resource.

public DraftsResource(IClientService service)

Parameters

service IClientService

Methods

Create(Draft, string)

Creates a new draft with the DRAFT label.

public virtual UsersResource.DraftsResource.CreateRequest Create(Draft body, string userId)

Parameters

body Draft

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

Returns

UsersResource.DraftsResource.CreateRequest

Create(Draft, string, Stream, string)

Creates a new draft with the DRAFT label.

public virtual UsersResource.DraftsResource.CreateMediaUpload Create(Draft body, string userId, Stream stream, string contentType)

Parameters

body Draft

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

stream Stream

The stream to upload. See remarks for further information.

contentType string

The content type of the stream to upload.

Returns

UsersResource.DraftsResource.CreateMediaUpload

Remarks

Considerations regarding stream:

  • If stream is seekable, then the stream position will be reset to 0 before reading commences. If stream is not seekable, then it will be read from its current position.
  • Caller is responsible for maintaining the stream open until the upload is completed.
  • Caller is responsible for closing the stream.

Delete(string, string)

Immediately and permanently deletes the specified draft. Does not simply trash it.

public virtual UsersResource.DraftsResource.DeleteRequest Delete(string userId, string id)

Parameters

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

id string

The ID of the draft to delete.

Returns

UsersResource.DraftsResource.DeleteRequest

Get(string, string)

Gets the specified draft.

public virtual UsersResource.DraftsResource.GetRequest Get(string userId, string id)

Parameters

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

id string

The ID of the draft to retrieve.

Returns

UsersResource.DraftsResource.GetRequest

List(string)

Lists the drafts in the user's mailbox.

public virtual UsersResource.DraftsResource.ListRequest List(string userId)

Parameters

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

Returns

UsersResource.DraftsResource.ListRequest

Send(Draft, string)

Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.

public virtual UsersResource.DraftsResource.SendRequest Send(Draft body, string userId)

Parameters

body Draft

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

Returns

UsersResource.DraftsResource.SendRequest

Send(Draft, string, Stream, string)

Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.

public virtual UsersResource.DraftsResource.SendMediaUpload Send(Draft body, string userId, Stream stream, string contentType)

Parameters

body Draft

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

stream Stream

The stream to upload. See remarks for further information.

contentType string

The content type of the stream to upload.

Returns

UsersResource.DraftsResource.SendMediaUpload

Remarks

Considerations regarding stream:

  • If stream is seekable, then the stream position will be reset to 0 before reading commences. If stream is not seekable, then it will be read from its current position.
  • Caller is responsible for maintaining the stream open until the upload is completed.
  • Caller is responsible for closing the stream.

Update(Draft, string, string)

Replaces a draft's content.

public virtual UsersResource.DraftsResource.UpdateRequest Update(Draft body, string userId, string id)

Parameters

body Draft

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

id string

The ID of the draft to update.

Returns

UsersResource.DraftsResource.UpdateRequest

Update(Draft, string, string, Stream, string)

Replaces a draft's content.

public virtual UsersResource.DraftsResource.UpdateMediaUpload Update(Draft body, string userId, string id, Stream stream, string contentType)

Parameters

body Draft

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

id string

The ID of the draft to update.

stream Stream

The stream to upload. See remarks for further information.

contentType string

The content type of the stream to upload.

Returns

UsersResource.DraftsResource.UpdateMediaUpload

Remarks

Considerations regarding stream:

  • If stream is seekable, then the stream position will be reset to 0 before reading commences. If stream is not seekable, then it will be read from its current position.
  • Caller is responsible for maintaining the stream open until the upload is completed.
  • Caller is responsible for closing the stream.