Class: MailSlurpClient::ImapControllerApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mailslurp_client/api/imap_controller_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ImapControllerApi

Returns a new instance of ImapControllerApi.



19
20
21
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#imap_server_fetch(seq_num, opts = {}) ⇒ ImapServerFetchResult

Fetch message in an inbox

Parameters:

  • seq_num (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Inbox ID to search

Returns:



27
28
29
30
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 27

def imap_server_fetch(seq_num, opts = {})
  data, _status_code, _headers = imap_server_fetch_with_http_info(seq_num, opts)
  data
end

#imap_server_fetch_with_http_info(seq_num, opts = {}) ⇒ Array<(ImapServerFetchResult, Integer, Hash)>

Fetch message in an inbox

Parameters:

  • seq_num (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Inbox ID to search

Returns:

  • (Array<(ImapServerFetchResult, Integer, Hash)>)

    ImapServerFetchResult data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 37

def imap_server_fetch_with_http_info(seq_num, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImapControllerApi.imap_server_fetch ...'
  end
  # verify the required parameter 'seq_num' is set
  if @api_client.config.client_side_validation && seq_num.nil?
    fail ArgumentError, "Missing the required parameter 'seq_num' when calling ImapControllerApi.imap_server_fetch"
  end
  # resource path
  local_var_path = '/imap/server/fetch'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'seqNum'] = seq_num
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'ImapServerFetchResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImapControllerApi#imap_server_fetch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#imap_server_get(email_id, opts = {}) ⇒ ImapServerGetResult

Get a message by email ID

Parameters:

  • email_id (String)

    Email ID to get

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Inbox ID to search

Returns:



91
92
93
94
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 91

def imap_server_get(email_id, opts = {})
  data, _status_code, _headers = imap_server_get_with_http_info(email_id, opts)
  data
end

#imap_server_get_with_http_info(email_id, opts = {}) ⇒ Array<(ImapServerGetResult, Integer, Hash)>

Get a message by email ID

Parameters:

  • email_id (String)

    Email ID to get

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Inbox ID to search

Returns:

  • (Array<(ImapServerGetResult, Integer, Hash)>)

    ImapServerGetResult data, response status code and response headers



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 101

def imap_server_get_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImapControllerApi.imap_server_get ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling ImapControllerApi.imap_server_get"
  end
  # resource path
  local_var_path = '/imap/server/get'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'emailId'] = email_id
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'ImapServerGetResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImapControllerApi#imap_server_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#imap_server_list(imap_server_list_options, opts = {}) ⇒ ImapServerListResult

List messages in an inbox

Parameters:

  • imap_server_list_options (ImapServerListOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Inbox ID to list

Returns:



155
156
157
158
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 155

def imap_server_list(imap_server_list_options, opts = {})
  data, _status_code, _headers = imap_server_list_with_http_info(imap_server_list_options, opts)
  data
end

#imap_server_list_with_http_info(imap_server_list_options, opts = {}) ⇒ Array<(ImapServerListResult, Integer, Hash)>

List messages in an inbox

Parameters:

  • imap_server_list_options (ImapServerListOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Inbox ID to list

Returns:

  • (Array<(ImapServerListResult, Integer, Hash)>)

    ImapServerListResult data, response status code and response headers



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 165

def imap_server_list_with_http_info(imap_server_list_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImapControllerApi.imap_server_list ...'
  end
  # verify the required parameter 'imap_server_list_options' is set
  if @api_client.config.client_side_validation && imap_server_list_options.nil?
    fail ArgumentError, "Missing the required parameter 'imap_server_list_options' when calling ImapControllerApi.imap_server_list"
  end
  # resource path
  local_var_path = '/imap/server/list'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(imap_server_list_options) 

  # return_type
  return_type = opts[:return_type] || 'ImapServerListResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImapControllerApi#imap_server_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#imap_server_mailbox(name, opts = {}) ⇒ ImapServerMailboxResult

Create a new mailbox if possible

Parameters:

  • name (String)

    Inbox email address to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



219
220
221
222
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 219

def imap_server_mailbox(name, opts = {})
  data, _status_code, _headers = imap_server_mailbox_with_http_info(name, opts)
  data
end

#imap_server_mailbox_with_http_info(name, opts = {}) ⇒ Array<(ImapServerMailboxResult, Integer, Hash)>

Create a new mailbox if possible

Parameters:

  • name (String)

    Inbox email address to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ImapServerMailboxResult, Integer, Hash)>)

    ImapServerMailboxResult data, response status code and response headers



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 228

def imap_server_mailbox_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImapControllerApi.imap_server_mailbox ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling ImapControllerApi.imap_server_mailbox"
  end
  # resource path
  local_var_path = '/imap/server/mailbox'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'name'] = name

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'ImapServerMailboxResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImapControllerApi#imap_server_mailbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#imap_server_search(imap_server_search_options, opts = {}) ⇒ ImapServerSearchResult

Search messages in an inbox

Parameters:

Options Hash (opts):

  • :inbox_id (String)

    Inbox ID to search

Returns:



281
282
283
284
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 281

def imap_server_search(imap_server_search_options, opts = {})
  data, _status_code, _headers = imap_server_search_with_http_info(imap_server_search_options, opts)
  data
end

#imap_server_search_with_http_info(imap_server_search_options, opts = {}) ⇒ Array<(ImapServerSearchResult, Integer, Hash)>

Search messages in an inbox

Parameters:

Options Hash (opts):

  • :inbox_id (String)

    Inbox ID to search

Returns:

  • (Array<(ImapServerSearchResult, Integer, Hash)>)

    ImapServerSearchResult data, response status code and response headers



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 291

def imap_server_search_with_http_info(imap_server_search_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImapControllerApi.imap_server_search ...'
  end
  # verify the required parameter 'imap_server_search_options' is set
  if @api_client.config.client_side_validation && imap_server_search_options.nil?
    fail ArgumentError, "Missing the required parameter 'imap_server_search_options' when calling ImapControllerApi.imap_server_search"
  end
  # resource path
  local_var_path = '/imap/server/search'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(imap_server_search_options) 

  # return_type
  return_type = opts[:return_type] || 'ImapServerSearchResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImapControllerApi#imap_server_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#imap_server_status(imap_server_status_options, opts = {}) ⇒ ImapServerStatusResult

Get status for mailbox

Parameters:

Options Hash (opts):

  • :inbox_id (String)

    Inbox ID to list

Returns:



346
347
348
349
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 346

def imap_server_status(imap_server_status_options, opts = {})
  data, _status_code, _headers = imap_server_status_with_http_info(imap_server_status_options, opts)
  data
end

#imap_server_status_with_http_info(imap_server_status_options, opts = {}) ⇒ Array<(ImapServerStatusResult, Integer, Hash)>

Get status for mailbox

Parameters:

Options Hash (opts):

  • :inbox_id (String)

    Inbox ID to list

Returns:

  • (Array<(ImapServerStatusResult, Integer, Hash)>)

    ImapServerStatusResult data, response status code and response headers



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 356

def imap_server_status_with_http_info(imap_server_status_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImapControllerApi.imap_server_status ...'
  end
  # verify the required parameter 'imap_server_status_options' is set
  if @api_client.config.client_side_validation && imap_server_status_options.nil?
    fail ArgumentError, "Missing the required parameter 'imap_server_status_options' when calling ImapControllerApi.imap_server_status"
  end
  # resource path
  local_var_path = '/imap/server/status'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(imap_server_status_options) 

  # return_type
  return_type = opts[:return_type] || 'ImapServerStatusResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImapControllerApi#imap_server_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#imap_server_update_flags(imap_update_flags_options, opts = {}) ⇒ nil

Update message flags

Parameters:

  • imap_update_flags_options (ImapUpdateFlagsOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

Returns:

  • (nil)


411
412
413
414
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 411

def imap_server_update_flags(imap_update_flags_options, opts = {})
  imap_server_update_flags_with_http_info(imap_update_flags_options, opts)
  nil
end

#imap_server_update_flags_with_http_info(imap_update_flags_options, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update message flags

Parameters:

  • imap_update_flags_options (ImapUpdateFlagsOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
# File 'lib/mailslurp_client/api/imap_controller_api.rb', line 421

def imap_server_update_flags_with_http_info(imap_update_flags_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImapControllerApi.imap_server_update_flags ...'
  end
  # verify the required parameter 'imap_update_flags_options' is set
  if @api_client.config.client_side_validation && imap_update_flags_options.nil?
    fail ArgumentError, "Missing the required parameter 'imap_update_flags_options' when calling ImapControllerApi.imap_server_update_flags"
  end
  # resource path
  local_var_path = '/imap/server/update-flags'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(imap_update_flags_options) 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImapControllerApi#imap_server_update_flags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end