Class UsersResource.DraftsResource
The "drafts" collection of methods.
Inherited Members
Namespace: Google.Apis.Gmail.v1
Assembly: Google.Apis.Gmail.v1.dll
Syntax
public class UsersResource.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. |
| string | userId | The user's email address. The special value |
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. |
| string | userId | The user's email address. The special value |
| Stream | stream | The stream to upload. See remarks for further information. |
| 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 |
|---|---|---|
| string | userId | The user's email address. The special value |
| 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 |
|---|---|---|
| string | userId | The user's email address. The special value |
| 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 |
|---|---|---|
| string | userId | The user's email address. The special value |
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. |
| string | userId | The user's email address. The special value |
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. |
| string | userId | The user's email address. The special value |
| Stream | stream | The stream to upload. See remarks for further information. |
| 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. |
| string | userId | The user's email address. The special value |
| 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. |
| string | userId | The user's email address. The special value |
| string | id | The ID of the draft to update. |
| Stream | stream | The stream to upload. See remarks for further information. |
| 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