Class: MailSlurpClient::AliasControllerApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AliasControllerApi

Returns a new instance of AliasControllerApi.



19
20
21
# File 'lib/mailslurp_client/api/alias_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/alias_controller_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_alias(create_alias_options, opts = {}) ⇒ AliasDto

Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active. Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached

Parameters:

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

    the optional parameters

Returns:



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

def create_alias(create_alias_options, opts = {})
  data, _status_code, _headers = create_alias_with_http_info(create_alias_options, opts)
  data
end

#create_alias_with_http_info(create_alias_options, opts = {}) ⇒ Array<(AliasDto, Integer, Hash)>

Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active. Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached

Parameters:

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

    the optional parameters

Returns:

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

    AliasDto 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/alias_controller_api.rb', line 37

def create_alias_with_http_info(create_alias_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AliasControllerApi.create_alias ...'
  end
  # verify the required parameter 'create_alias_options' is set
  if @api_client.config.client_side_validation && create_alias_options.nil?
    fail ArgumentError, "Missing the required parameter 'create_alias_options' when calling AliasControllerApi.create_alias"
  end
  # resource path
  local_var_path = '/aliases'

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

  # 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(create_alias_options) 

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

  # 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: AliasControllerApi#create_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_alias(alias_id, opts = {}) ⇒ nil

Delete an email alias

Parameters:

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

    the optional parameters

Returns:

  • (nil)


90
91
92
93
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 90

def delete_alias(alias_id, opts = {})
  delete_alias_with_http_info(alias_id, opts)
  nil
end

#delete_alias_with_http_info(alias_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an email alias

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



99
100
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
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 99

def delete_alias_with_http_info(alias_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AliasControllerApi.delete_alias ...'
  end
  # verify the required parameter 'alias_id' is set
  if @api_client.config.client_side_validation && alias_id.nil?
    fail ArgumentError, "Missing the required parameter 'alias_id' when calling AliasControllerApi.delete_alias"
  end
  # resource path
  local_var_path = '/aliases/{aliasId}'.sub('{' + 'aliasId' + '}', CGI.escape(alias_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # 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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AliasControllerApi#delete_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_alias(alias_id, opts = {}) ⇒ AliasDto

Get an email alias Get an email alias by ID

Parameters:

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

    the optional parameters

Returns:



149
150
151
152
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 149

def get_alias(alias_id, opts = {})
  data, _status_code, _headers = get_alias_with_http_info(alias_id, opts)
  data
end

#get_alias_emails(alias_id, opts = {}) ⇒ PageEmailProjection

Get emails for an alias Get paginated emails for an alias by ID

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index alias email list pagination (default to 0)

  • :size (Integer)

    Optional page size alias email list pagination (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to ‘ASC’)

  • :since (DateTime)

    Optional filter by sent after given date time

  • :before (DateTime)

    Optional filter by sent before given date time

Returns:



216
217
218
219
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 216

def get_alias_emails(alias_id, opts = {})
  data, _status_code, _headers = get_alias_emails_with_http_info(alias_id, opts)
  data
end

#get_alias_emails_with_http_info(alias_id, opts = {}) ⇒ Array<(PageEmailProjection, Integer, Hash)>

Get emails for an alias Get paginated emails for an alias by ID

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index alias email list pagination

  • :size (Integer)

    Optional page size alias email list pagination

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :since (DateTime)

    Optional filter by sent after given date time

  • :before (DateTime)

    Optional filter by sent before given date time

Returns:

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

    PageEmailProjection data, response status code and response headers



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
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 231

def get_alias_emails_with_http_info(alias_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AliasControllerApi.get_alias_emails ...'
  end
  # verify the required parameter 'alias_id' is set
  if @api_client.config.client_side_validation && alias_id.nil?
    fail ArgumentError, "Missing the required parameter 'alias_id' when calling AliasControllerApi.get_alias_emails"
  end
  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/aliases/{aliasId}/emails'.sub('{' + 'aliasId' + '}', CGI.escape(alias_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].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] || 'PageEmailProjection' 

  # 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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AliasControllerApi#get_alias_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_alias_threads(alias_id, opts = {}) ⇒ PageThreadProjection

Get threads created for an alias Returns threads created for an email alias in paginated form

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in thread list pagination (default to 0)

  • :size (Integer)

    Optional page size in thread list pagination (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to ‘ASC’)

  • :since (DateTime)

    Optional filter by sent after given date time

  • :before (DateTime)

    Optional filter by sent before given date time

Returns:



297
298
299
300
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 297

def get_alias_threads(alias_id, opts = {})
  data, _status_code, _headers = get_alias_threads_with_http_info(alias_id, opts)
  data
end

#get_alias_threads_with_http_info(alias_id, opts = {}) ⇒ Array<(PageThreadProjection, Integer, Hash)>

Get threads created for an alias Returns threads created for an email alias in paginated form

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in thread list pagination

  • :size (Integer)

    Optional page size in thread list pagination

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :since (DateTime)

    Optional filter by sent after given date time

  • :before (DateTime)

    Optional filter by sent before given date time

Returns:

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

    PageThreadProjection data, response status code and response headers



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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 312

def get_alias_threads_with_http_info(alias_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AliasControllerApi.get_alias_threads ...'
  end
  # verify the required parameter 'alias_id' is set
  if @api_client.config.client_side_validation && alias_id.nil?
    fail ArgumentError, "Missing the required parameter 'alias_id' when calling AliasControllerApi.get_alias_threads"
  end
  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/aliases/{aliasId}/threads'.sub('{' + 'aliasId' + '}', CGI.escape(alias_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].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] || 'PageThreadProjection' 

  # 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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AliasControllerApi#get_alias_threads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_alias_with_http_info(alias_id, opts = {}) ⇒ Array<(AliasDto, Integer, Hash)>

Get an email alias Get an email alias by ID

Parameters:

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

    the optional parameters

Returns:

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

    AliasDto data, response status code and response headers



159
160
161
162
163
164
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
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 159

def get_alias_with_http_info(alias_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AliasControllerApi.get_alias ...'
  end
  # verify the required parameter 'alias_id' is set
  if @api_client.config.client_side_validation && alias_id.nil?
    fail ArgumentError, "Missing the required parameter 'alias_id' when calling AliasControllerApi.get_alias"
  end
  # resource path
  local_var_path = '/aliases/{aliasId}'.sub('{' + 'aliasId' + '}', CGI.escape(alias_id.to_s))

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

  # 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] || 'AliasDto' 

  # 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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AliasControllerApi#get_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_aliases(opts = {}) ⇒ PageAlias

Get all email aliases you have created Get all email aliases in paginated form

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Optional search term

  • :page (Integer)

    Optional page index in alias list pagination (default to 0)

  • :size (Integer)

    Optional page size in alias list pagination (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to ‘ASC’)

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:



378
379
380
381
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 378

def get_aliases(opts = {})
  data, _status_code, _headers = get_aliases_with_http_info(opts)
  data
end

#get_aliases_with_http_info(opts = {}) ⇒ Array<(PageAlias, Integer, Hash)>

Get all email aliases you have created Get all email aliases in paginated form

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Optional search term

  • :page (Integer)

    Optional page index in alias list pagination

  • :size (Integer)

    Optional page size in alias list pagination

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:

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

    PageAlias data, response status code and response headers



393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 393

def get_aliases_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AliasControllerApi.get_aliases ...'
  end
  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/aliases'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].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] || 'PageAlias' 

  # 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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AliasControllerApi#get_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_thread(thread_id, opts = {}) ⇒ ThreadProjection

Get a thread Return a thread associated with an alias

Parameters:

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

    the optional parameters

Returns:



451
452
453
454
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 451

def get_thread(thread_id, opts = {})
  data, _status_code, _headers = get_thread_with_http_info(thread_id, opts)
  data
end

#get_thread_with_http_info(thread_id, opts = {}) ⇒ Array<(ThreadProjection, Integer, Hash)>

Get a thread Return a thread associated with an alias

Parameters:

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

    the optional parameters

Returns:

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

    ThreadProjection data, response status code and response headers



461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 461

def get_thread_with_http_info(thread_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AliasControllerApi.get_thread ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AliasControllerApi.get_thread"
  end
  # resource path
  local_var_path = '/aliases/threads/{threadId}'.sub('{' + 'threadId' + '}', CGI.escape(thread_id.to_s))

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

  # 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] || 'ThreadProjection' 

  # 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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AliasControllerApi#get_thread\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_threads_paginated(opts = {}) ⇒ PageThreadProjection

Get all threads Returns threads created for all aliases in paginated form

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in thread list pagination (default to 0)

  • :size (Integer)

    Optional page size in thread list pagination (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to ‘ASC’)

  • :since (DateTime)

    Optional filter by sent after given date time

  • :before (DateTime)

    Optional filter by sent before given date time

Returns:



517
518
519
520
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 517

def get_threads_paginated(opts = {})
  data, _status_code, _headers = get_threads_paginated_with_http_info(opts)
  data
end

#get_threads_paginated_with_http_info(opts = {}) ⇒ Array<(PageThreadProjection, Integer, Hash)>

Get all threads Returns threads created for all aliases in paginated form

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in thread list pagination

  • :size (Integer)

    Optional page size in thread list pagination

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :since (DateTime)

    Optional filter by sent after given date time

  • :before (DateTime)

    Optional filter by sent before given date time

Returns:

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

    PageThreadProjection data, response status code and response headers



531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 531

def get_threads_paginated_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AliasControllerApi.get_threads_paginated ...'
  end
  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/aliases/threads'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].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] || 'PageThreadProjection' 

  # 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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AliasControllerApi#get_threads_paginated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reply_to_alias_email(alias_id, email_id, reply_to_alias_email_options, opts = {}) ⇒ SentEmailDto

Reply to an email Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails ‘to`, `cc`, and `bcc`.

Parameters:

  • alias_id (String)

    ID of the alias that email belongs to

  • email_id (String)

    ID of the email that should be replied to

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

    the optional parameters

Returns:



590
591
592
593
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 590

def reply_to_alias_email(alias_id, email_id, reply_to_alias_email_options, opts = {})
  data, _status_code, _headers = reply_to_alias_email_with_http_info(alias_id, email_id, reply_to_alias_email_options, opts)
  data
end

#reply_to_alias_email_with_http_info(alias_id, email_id, reply_to_alias_email_options, opts = {}) ⇒ Array<(SentEmailDto, Integer, Hash)>

Reply to an email Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails &#x60;to&#x60;, &#x60;cc&#x60;, and &#x60;bcc&#x60;.

Parameters:

  • alias_id (String)

    ID of the alias that email belongs to

  • email_id (String)

    ID of the email that should be replied to

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

    the optional parameters

Returns:

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

    SentEmailDto data, response status code and response headers



602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 602

def reply_to_alias_email_with_http_info(alias_id, email_id, reply_to_alias_email_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AliasControllerApi.reply_to_alias_email ...'
  end
  # verify the required parameter 'alias_id' is set
  if @api_client.config.client_side_validation && alias_id.nil?
    fail ArgumentError, "Missing the required parameter 'alias_id' when calling AliasControllerApi.reply_to_alias_email"
  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 AliasControllerApi.reply_to_alias_email"
  end
  # verify the required parameter 'reply_to_alias_email_options' is set
  if @api_client.config.client_side_validation && reply_to_alias_email_options.nil?
    fail ArgumentError, "Missing the required parameter 'reply_to_alias_email_options' when calling AliasControllerApi.reply_to_alias_email"
  end
  # resource path
  local_var_path = '/aliases/{aliasId}/emails/{emailId}'.sub('{' + 'aliasId' + '}', CGI.escape(alias_id.to_s)).sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

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

  # 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(reply_to_alias_email_options) 

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

  # 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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AliasControllerApi#reply_to_alias_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_alias_email(alias_id, send_email_options, opts = {}) ⇒ SentEmailDto

Send an email from an alias inbox Send an email from an alias. Replies to the email will be forwarded to the alias masked email address

Parameters:

  • alias_id (String)
  • send_email_options (SendEmailOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



665
666
667
668
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 665

def send_alias_email(alias_id, send_email_options, opts = {})
  data, _status_code, _headers = send_alias_email_with_http_info(alias_id, send_email_options, opts)
  data
end

#send_alias_email_with_http_info(alias_id, send_email_options, opts = {}) ⇒ Array<(SentEmailDto, Integer, Hash)>

Send an email from an alias inbox Send an email from an alias. Replies to the email will be forwarded to the alias masked email address

Parameters:

  • alias_id (String)
  • send_email_options (SendEmailOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    SentEmailDto data, response status code and response headers



676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 676

def send_alias_email_with_http_info(alias_id, send_email_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AliasControllerApi.send_alias_email ...'
  end
  # verify the required parameter 'alias_id' is set
  if @api_client.config.client_side_validation && alias_id.nil?
    fail ArgumentError, "Missing the required parameter 'alias_id' when calling AliasControllerApi.send_alias_email"
  end
  # verify the required parameter 'send_email_options' is set
  if @api_client.config.client_side_validation && send_email_options.nil?
    fail ArgumentError, "Missing the required parameter 'send_email_options' when calling AliasControllerApi.send_alias_email"
  end
  # resource path
  local_var_path = '/aliases/{aliasId}/emails'.sub('{' + 'aliasId' + '}', CGI.escape(alias_id.to_s))

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

  # 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(send_email_options) 

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

  # 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: AliasControllerApi#send_alias_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_alias(alias_id, update_alias_options, opts = {}) ⇒ AliasDto

Update an email alias

Parameters:

  • alias_id (String)
  • update_alias_options (UpdateAliasOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



734
735
736
737
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 734

def update_alias(alias_id, update_alias_options, opts = {})
  data, _status_code, _headers = update_alias_with_http_info(alias_id, update_alias_options, opts)
  data
end

#update_alias_with_http_info(alias_id, update_alias_options, opts = {}) ⇒ Array<(AliasDto, Integer, Hash)>

Update an email alias

Parameters:

  • alias_id (String)
  • update_alias_options (UpdateAliasOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    AliasDto data, response status code and response headers



744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
# File 'lib/mailslurp_client/api/alias_controller_api.rb', line 744

def update_alias_with_http_info(alias_id, update_alias_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AliasControllerApi.update_alias ...'
  end
  # verify the required parameter 'alias_id' is set
  if @api_client.config.client_side_validation && alias_id.nil?
    fail ArgumentError, "Missing the required parameter 'alias_id' when calling AliasControllerApi.update_alias"
  end
  # verify the required parameter 'update_alias_options' is set
  if @api_client.config.client_side_validation && update_alias_options.nil?
    fail ArgumentError, "Missing the required parameter 'update_alias_options' when calling AliasControllerApi.update_alias"
  end
  # resource path
  local_var_path = '/aliases/{aliasId}'.sub('{' + 'aliasId' + '}', CGI.escape(alias_id.to_s))

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

  # 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(update_alias_options) 

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

  # 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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AliasControllerApi#update_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end