Class: AsposeEmailCloud::ClientMessageApi
- Inherits:
-
Object
- Object
- AsposeEmailCloud::ClientMessageApi
- Defined in:
- lib/aspose-email-cloud/api/client_message_api.rb
Overview
ClientMessageApi operations.
Instance Attribute Summary collapse
-
#api_invoker ⇒ Object
readonly
Returns the value of attribute api_invoker.
Instance Method Summary collapse
-
#append(request) ⇒ ValueTOfString
Add email message to specified folder in email account.
-
#append_file(request) ⇒ ValueTOfString
Add email message from file to specified folder in email account.
-
#delete(request) ⇒ nil
Delete message.
-
#fetch(request) ⇒ MailMessageBase
Fetch message from email account.
-
#fetch_file(request) ⇒ File
Fetch message as file from email account.
-
#initialize(api_invoker) ⇒ ClientMessageApi
constructor
Initializes a new instance of the ClientMessageApi class.
-
#list(request) ⇒ MailMessageBaseList
Get messages from folder, filtered by query The query string should have the following view.
-
#move(request) ⇒ nil
Move message to another folder.
-
#send(request) ⇒ nil
Send an email specified by model in request.
-
#send_file(request) ⇒ nil
Send an email file.
-
#set_is_read(request) ⇒ nil
Mark message as read or unread.
Constructor Details
#initialize(api_invoker) ⇒ ClientMessageApi
Initializes a new instance of the ClientMessageApi class.
45 46 47 |
# File 'lib/aspose-email-cloud/api/client_message_api.rb', line 45 def initialize(api_invoker) @api_invoker = api_invoker end |
Instance Attribute Details
#api_invoker ⇒ Object (readonly)
Returns the value of attribute api_invoker.
31 32 33 |
# File 'lib/aspose-email-cloud/api/client_message_api.rb', line 31 def api_invoker @api_invoker end |
Instance Method Details
#append(request) ⇒ ValueTOfString
Add email message to specified folder in email account.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# 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 |
#append_file(request) ⇒ ValueTOfString
Add email message from file to specified folder in email account.
79 80 81 82 |
# 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(request) ⇒ nil
Delete message.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# 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(request) ⇒ MailMessageBase
Fetch message from email account
115 116 117 118 |
# 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_file(request) ⇒ File
Fetch message as file from email account
123 124 125 126 |
# 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 |
#list(request) ⇒ MailMessageBaseList
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"
132 133 134 135 |
# 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(request) ⇒ nil
Move message to another folder.
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# 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(request) ⇒ nil
Send an email specified by model in request.
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# 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_file(request) ⇒ nil
Send an email file.
196 197 198 199 200 |
# 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 |
#set_is_read(request) ⇒ nil
Mark message as read or unread.
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# 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 |