Class UsersResource.DraftsResource
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
DraftThe body of the request.
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.
Returns
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
DraftThe body of the request.
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.stream
StreamThe stream to upload. See remarks for further information.
contentType
stringThe content type of the stream to upload.
Returns
Remarks
Considerations regarding stream
:
-
If
stream
is seekable, then the stream position will be reset to0
before reading commences. Ifstream
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
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.id
stringThe ID of the draft to delete.
Returns
Get(string, string)
Gets the specified draft.
public virtual UsersResource.DraftsResource.GetRequest Get(string userId, string id)
Parameters
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.id
stringThe ID of the draft to retrieve.
Returns
List(string)
Lists the drafts in the user's mailbox.
public virtual UsersResource.DraftsResource.ListRequest List(string userId)
Parameters
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.
Returns
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
DraftThe body of the request.
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.
Returns
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
DraftThe body of the request.
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.stream
StreamThe stream to upload. See remarks for further information.
contentType
stringThe content type of the stream to upload.
Returns
Remarks
Considerations regarding stream
:
-
If
stream
is seekable, then the stream position will be reset to0
before reading commences. Ifstream
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
DraftThe body of the request.
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.id
stringThe ID of the draft to update.
Returns
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
DraftThe body of the request.
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.id
stringThe ID of the draft to update.
stream
StreamThe stream to upload. See remarks for further information.
contentType
stringThe content type of the stream to upload.
Returns
Remarks
Considerations regarding stream
:
-
If
stream
is seekable, then the stream position will be reset to0
before reading commences. Ifstream
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
.