Class UsersResource.MessagesResource
The "messages" collection of methods.
public class UsersResource.MessagesResource
- Inheritance
-
UsersResource.MessagesResource
- Inherited Members
Constructors
MessagesResource(IClientService)
Constructs a new resource.
public MessagesResource(IClientService service)
Parameters
service
IClientService
Properties
Attachments
Gets the Attachments resource.
public virtual UsersResource.MessagesResource.AttachmentsResource Attachments { get; }
Property Value
Methods
BatchDelete(BatchDeleteMessagesRequest, string)
Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.
public virtual UsersResource.MessagesResource.BatchDeleteRequest BatchDelete(BatchDeleteMessagesRequest body, string userId)
Parameters
body
BatchDeleteMessagesRequestThe body of the request.
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.
Returns
BatchModify(BatchModifyMessagesRequest, string)
Modifies the labels on the specified messages.
public virtual UsersResource.MessagesResource.BatchModifyRequest BatchModify(BatchModifyMessagesRequest body, string userId)
Parameters
body
BatchModifyMessagesRequestThe body of the request.
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.
Returns
Delete(string, string)
Immediately and permanently deletes the specified message. This operation cannot be undone.
Prefer messages.trash
instead.
public virtual UsersResource.MessagesResource.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 message to delete.
Returns
Get(string, string)
Gets the specified message.
public virtual UsersResource.MessagesResource.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 message to retrieve.
Returns
Import(Message, string)
Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message. Note: This function doesn't trigger forwarding rules or filters set up by the user.
public virtual UsersResource.MessagesResource.ImportRequest Import(Message body, string userId)
Parameters
body
MessageThe body of the request.
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.
Returns
Import(Message, string, Stream, string)
Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message. Note: This function doesn't trigger forwarding rules or filters set up by the user.
public virtual UsersResource.MessagesResource.ImportMediaUpload Import(Message body, string userId, Stream stream, string contentType)
Parameters
body
MessageThe 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
.
Insert(Message, string)
Directly inserts a message into only this user's mailbox similar to IMAP APPEND
, bypassing
most scanning and classification. Does not send a message.
public virtual UsersResource.MessagesResource.InsertRequest Insert(Message body, string userId)
Parameters
body
MessageThe body of the request.
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.
Returns
Insert(Message, string, Stream, string)
Directly inserts a message into only this user's mailbox similar to IMAP APPEND
, bypassing
most scanning and classification. Does not send a message.
public virtual UsersResource.MessagesResource.InsertMediaUpload Insert(Message body, string userId, Stream stream, string contentType)
Parameters
body
MessageThe 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
.
List(string)
Lists the messages in the user's mailbox.
public virtual UsersResource.MessagesResource.ListRequest List(string userId)
Parameters
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.
Returns
Modify(ModifyMessageRequest, string, string)
Modifies the labels on the specified message.
public virtual UsersResource.MessagesResource.ModifyRequest Modify(ModifyMessageRequest body, string userId, string id)
Parameters
body
ModifyMessageRequestThe 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 message to modify.
Returns
Send(Message, string)
Sends the specified message to the recipients in the To
, Cc
, and Bcc
headers.
public virtual UsersResource.MessagesResource.SendRequest Send(Message body, string userId)
Parameters
body
MessageThe body of the request.
userId
stringThe user's email address. The special value
me
can be used to indicate the authenticated user.
Returns
Send(Message, string, Stream, string)
Sends the specified message to the recipients in the To
, Cc
, and Bcc
headers.
public virtual UsersResource.MessagesResource.SendMediaUpload Send(Message body, string userId, Stream stream, string contentType)
Parameters
body
MessageThe 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
.
Trash(string, string)
Moves the specified message to the trash.
public virtual UsersResource.MessagesResource.TrashRequest Trash(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 message to Trash.
Returns
Untrash(string, string)
Removes the specified message from the trash.
public virtual UsersResource.MessagesResource.UntrashRequest Untrash(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 message to remove from Trash.