Class UsersResource.DraftsResource
The "drafts" collection of methods.
Inheritance
Inherited Members
Namespace: Google.Apis.Gmail.v1
Assembly: Google.Apis.Gmail.v1.dll
Syntax
public class DraftsResource
Constructors
DraftsResource(IClientService)
Constructs a new resource.
Declaration
public DraftsResource(IClientService service)
Parameters
| Type | Name | Description |
|---|---|---|
| IClientService | service |
Methods
Create(Draft, String)
Creates a new draft with the DRAFT label.
Declaration
public virtual UsersResource.DraftsResource.CreateRequest Create(Draft body, string userId)
Parameters
| Type | Name | Description |
|---|---|---|
| Draft | body | The body of the request. |
| System.String | userId | The user's email address. The special value me can be used to indicate the authenticated user. |
Returns
| Type | Description |
|---|---|
| UsersResource.DraftsResource.CreateRequest |
Create(Draft, String, Stream, String)
Creates a new draft with the DRAFT label.
Declaration
public virtual UsersResource.DraftsResource.CreateMediaUpload Create(Draft body, string userId, Stream stream, string contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| Draft | body | The body of the request. |
| System.String | userId | The user's email address. The special value me can be used to indicate the authenticated user. |
| System.IO.Stream | stream | The stream to upload. See remarks for further information. |
| System.String | contentType | The content type of the stream to upload. |
Returns
| Type | Description |
|---|---|
| UsersResource.DraftsResource.CreateMediaUpload |
Remarks
Considerations regarding stream:
-
If
streamis seekable, then the stream position will be reset to0before reading commences. Ifstreamis not seekable, then it will be read from its current position. -
Caller is responsible for maintaining the
streamopen 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.
Declaration
public virtual UsersResource.DraftsResource.DeleteRequest Delete(string userId, string id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userId | The user's email address. The special value me can be used to indicate the authenticated user. |
| System.String | id | The ID of the draft to delete. |
Returns
| Type | Description |
|---|---|
| UsersResource.DraftsResource.DeleteRequest |
Get(String, String)
Gets the specified draft.
Declaration
public virtual UsersResource.DraftsResource.GetRequest Get(string userId, string id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userId | The user's email address. The special value me can be used to indicate the authenticated user. |
| System.String | id | The ID of the draft to retrieve. |
Returns
| Type | Description |
|---|---|
| UsersResource.DraftsResource.GetRequest |
List(String)
Lists the drafts in the user's mailbox.
Declaration
public virtual UsersResource.DraftsResource.ListRequest List(string userId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userId | The user's email address. The special value me can be used to indicate the authenticated user. |
Returns
| Type | Description |
|---|---|
| UsersResource.DraftsResource.ListRequest |
Send(Draft, String)
Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.
Declaration
public virtual UsersResource.DraftsResource.SendRequest Send(Draft body, string userId)
Parameters
| Type | Name | Description |
|---|---|---|
| Draft | body | The body of the request. |
| System.String | userId | The user's email address. The special value me can be used to indicate the authenticated user. |
Returns
| Type | Description |
|---|---|
| UsersResource.DraftsResource.SendRequest |
Send(Draft, String, Stream, String)
Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.
Declaration
public virtual UsersResource.DraftsResource.SendMediaUpload Send(Draft body, string userId, Stream stream, string contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| Draft | body | The body of the request. |
| System.String | userId | The user's email address. The special value me can be used to indicate the authenticated user. |
| System.IO.Stream | stream | The stream to upload. See remarks for further information. |
| System.String | contentType | The content type of the stream to upload. |
Returns
| Type | Description |
|---|---|
| UsersResource.DraftsResource.SendMediaUpload |
Remarks
Considerations regarding stream:
-
If
streamis seekable, then the stream position will be reset to0before reading commences. Ifstreamis not seekable, then it will be read from its current position. -
Caller is responsible for maintaining the
streamopen until the upload is completed. -
Caller is responsible for closing the
stream.
Update(Draft, String, String)
Replaces a draft's content.
Declaration
public virtual UsersResource.DraftsResource.UpdateRequest Update(Draft body, string userId, string id)
Parameters
| Type | Name | Description |
|---|---|---|
| Draft | body | The body of the request. |
| System.String | userId | The user's email address. The special value me can be used to indicate the authenticated user. |
| System.String | id | The ID of the draft to update. |
Returns
| Type | Description |
|---|---|
| UsersResource.DraftsResource.UpdateRequest |
Update(Draft, String, String, Stream, String)
Replaces a draft's content.
Declaration
public virtual UsersResource.DraftsResource.UpdateMediaUpload Update(Draft body, string userId, string id, Stream stream, string contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| Draft | body | The body of the request. |
| System.String | userId | The user's email address. The special value me can be used to indicate the authenticated user. |
| System.String | id | The ID of the draft to update. |
| System.IO.Stream | stream | The stream to upload. See remarks for further information. |
| System.String | contentType | The content type of the stream to upload. |
Returns
| Type | Description |
|---|---|
| UsersResource.DraftsResource.UpdateMediaUpload |
Remarks
Considerations regarding stream:
-
If
streamis seekable, then the stream position will be reset to0before reading commences. Ifstreamis not seekable, then it will be read from its current position. -
Caller is responsible for maintaining the
streamopen until the upload is completed. -
Caller is responsible for closing the
stream.