class AsposeEmailCloud::ClientMessageApi
ClientMessageApi
operations.
Attributes
Public Class Methods
Initializes a new instance of the ClientMessageApi
class. @param [ApiInvoker] api_invoker
# File lib/aspose-email-cloud/api/client_message_api.rb, line 45 def initialize(api_invoker) @api_invoker = api_invoker end
Public Instance Methods
Add email message to specified folder in email account.
@param [ClientMessageAppendRequest] request Append email request. @return [ValueTOfString]
# File lib/aspose-email-cloud/api/client_message_api.rb, line 52 def append(request) # verify the required parameter 'request' is set if @api_invoker.api_client.config.client_side_validation && request.nil? raise ArgumentError, "Missing the required parameter 'request' when calling ClientMessageApi.append" end local_var_path = '/email/client/message/append' post_body = @api_invoker.api_client.object_to_http_body(request) auth_names = ['JWT'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = EmailRequest.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json']) http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path, header_params: header_params, body: post_body, auth_names: auth_names) @api_invoker.make_request(http_request, :POST, 'ValueTOfString') end
Add email message from file to specified folder in email account.
@param [ClientMessageAppendFileRequest] request Request object. @return [ValueTOfString]
# File lib/aspose-email-cloud/api/client_message_api.rb, line 79 def append_file(request) http_request = request.to_http_info(@api_invoker.api_client) @api_invoker.make_request(http_request, :POST, 'ValueTOfString') end
Delete message.
@param [ClientMessageDeleteRequest] request Delete message request. @return [nil]
# File lib/aspose-email-cloud/api/client_message_api.rb, line 87 def delete(request) # verify the required parameter 'request' is set if @api_invoker.api_client.config.client_side_validation && request.nil? raise ArgumentError, "Missing the required parameter 'request' when calling ClientMessageApi.delete" end local_var_path = '/email/client/message' post_body = @api_invoker.api_client.object_to_http_body(request) auth_names = ['JWT'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = EmailRequest.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json']) http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path, header_params: header_params, body: post_body, auth_names: auth_names) @api_invoker.make_request(http_request, :DELETE, nil) nil end
Fetch message from email account
@param [ClientMessageFetchRequest] request Request object. @return [MailMessageBase]
# File lib/aspose-email-cloud/api/client_message_api.rb, line 115 def fetch(request) http_request = request.to_http_info(@api_invoker.api_client) @api_invoker.make_request(http_request, :GET, 'MailMessageBase') end
Fetch message as file from email account
@param [ClientMessageFetchFileRequest] request Request object. @return [File]
# File lib/aspose-email-cloud/api/client_message_api.rb, line 123 def fetch_file(request) http_request = request.to_http_info(@api_invoker.api_client) @api_invoker.make_request(http_request, :GET, 'File') end
Get messages from folder, filtered by query
The query string should have the following view. The example of a simple expression: '<Field name>' <Comparison operator> '<Field value>', where <Field Name> - the name of a message field through which filtering is made, <Comparison operator> - comparison operators, as their name implies, allow to compare message field and specified value, <Field value> - value to be compared with a message field. The number of simple expressions can make a compound one, ex.: (<Simple expression 1> & <Simple expression 2>) | <Simple expression 3 >, where "&" - logical-AND operator, "|" - logical-OR operator At present the following values are allowed as a field name (<Field name>): "To" - represents a TO field of message, "Text" - represents string in the header or body of the message, "Bcc" - represents a BCC field of message, "Body" - represents a string in the body of message, "Cc" - represents a CC field of message, "From" - represents a From field of message, "Subject" - represents a string in the subject of message, "InternalDate" - represents an internal date of message, "SentDate" - represents a sent date of message Additionally, the following field names are allowed for IMAP-protocol: "Answered" - represents an /Answered flag of message "Seen" - represents a /Seen flag of message "Flagged" - represents a /Flagged flag of message "Draft" - represents a /Draft flag of message "Deleted" - represents a Deleted/ flag of message "Recent" - represents a Deleted/ flag of message "MessageSize" - represents a size (in bytes) of message Additionally, the following field names are allowed for Exchange: "IsRead" - Indicates whether the message has been read "HasAttachment" - Indicates whether or not the message has attachments "IsSubmitted" - Indicates whether the message has been submitted to the Outbox "ContentClass" - represents a content class of item The field value (<Field value>) can take the following values: For text fields - any string, For date type fields - the string of "d-MMM-yyy" format, ex. "10-Feb-2009", For flags (fields of boolean type) - either "True", or "False"
@param [ClientMessageListRequest] request Request object. @return [MailMessageBaseList]
# File lib/aspose-email-cloud/api/client_message_api.rb, line 132 def list(request) http_request = request.to_http_info(@api_invoker.api_client) @api_invoker.make_request(http_request, :GET, 'MailMessageBaseList') end
Move message to another folder.
@param [ClientMessageMoveRequest] request Move message request. @return [nil]
# File lib/aspose-email-cloud/api/client_message_api.rb, line 140 def move(request) # verify the required parameter 'request' is set if @api_invoker.api_client.config.client_side_validation && request.nil? raise ArgumentError, "Missing the required parameter 'request' when calling ClientMessageApi.move" end local_var_path = '/email/client/message/move' post_body = @api_invoker.api_client.object_to_http_body(request) auth_names = ['JWT'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = EmailRequest.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json']) http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path, header_params: header_params, body: post_body, auth_names: auth_names) @api_invoker.make_request(http_request, :PUT, nil) nil end
Send an email specified by model in request.
@param [ClientMessageSendRequest] request Send email request. @return [nil]
# File lib/aspose-email-cloud/api/client_message_api.rb, line 168 def send(request) # verify the required parameter 'request' is set if @api_invoker.api_client.config.client_side_validation && request.nil? raise ArgumentError, "Missing the required parameter 'request' when calling ClientMessageApi.send" end local_var_path = '/email/client/message' post_body = @api_invoker.api_client.object_to_http_body(request) auth_names = ['JWT'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = EmailRequest.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json']) http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path, header_params: header_params, body: post_body, auth_names: auth_names) @api_invoker.make_request(http_request, :POST, nil) nil end
Send an email file.
@param [ClientMessageSendFileRequest] request Request object. @return [nil]
# File lib/aspose-email-cloud/api/client_message_api.rb, line 196 def send_file(request) http_request = request.to_http_info(@api_invoker.api_client) @api_invoker.make_request(http_request, :POST, nil) nil end
Mark message as read or unread.
@param [ClientMessageSetIsReadRequest] request Delete message request. @return [nil]
# File lib/aspose-email-cloud/api/client_message_api.rb, line 205 def set_is_read(request) # verify the required parameter 'request' is set if @api_invoker.api_client.config.client_side_validation && request.nil? raise ArgumentError, "Missing the required parameter 'request' when calling ClientMessageApi.set_is_read" end local_var_path = '/email/client/message/set-is-read' post_body = @api_invoker.api_client.object_to_http_body(request) auth_names = ['JWT'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = EmailRequest.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json']) http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path, header_params: header_params, body: post_body, auth_names: auth_names) @api_invoker.make_request(http_request, :PUT, nil) nil end