Class: AsposeEmailCloud::ClientMessageApi

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose-email-cloud/api/client_message_api.rb

Overview

ClientMessageApi operations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_invoker) ⇒ ClientMessageApi

Initializes a new instance of the ClientMessageApi class.

Parameters:



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_invokerObject (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.

Parameters:

Returns:



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.

Parameters:

Returns:



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.

Parameters:

Returns:

  • (nil)


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

Parameters:

Returns:



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

Parameters:

Returns:

  • (File)


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 &lt;Field Name&gt; - the name of a message field through which filtering is made, &lt;Comparison operator&gt; - comparison operators, as their name implies, allow to compare message field and specified value, &lt;Field value&gt; - 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 "&amp;" - 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"

Parameters:

Returns:



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.

Parameters:

Returns:

  • (nil)


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.

Parameters:

Returns:

  • (nil)


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.

Parameters:

Returns:

  • (nil)


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.

Parameters:

Returns:

  • (nil)


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