Class: MailSlurpClient::BounceControllerApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BounceControllerApi

Returns a new instance of BounceControllerApi.



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

def api_client
  @api_client
end

Instance Method Details

#filter_bounced_recipient(filter_bounced_recipients_options, opts = {}) ⇒ FilterBouncedRecipientsResult

Filter a list of email recipients and remove those who have bounced Prevent email sending errors by remove recipients who have resulted in past email bounces or complaints

Parameters:

Returns:



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

def filter_bounced_recipient(filter_bounced_recipients_options, opts = {})
  data, _status_code, _headers = filter_bounced_recipient_with_http_info(filter_bounced_recipients_options, opts)
  data
end

#filter_bounced_recipient_with_http_info(filter_bounced_recipients_options, opts = {}) ⇒ Array<(FilterBouncedRecipientsResult, Integer, Hash)>

Filter a list of email recipients and remove those who have bounced Prevent email sending errors by remove recipients who have resulted in past email bounces or complaints

Parameters:

Returns:



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

def filter_bounced_recipient_with_http_info(filter_bounced_recipients_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BounceControllerApi.filter_bounced_recipient ...'
  end
  # verify the required parameter 'filter_bounced_recipients_options' is set
  if @api_client.config.client_side_validation && filter_bounced_recipients_options.nil?
    fail ArgumentError, "Missing the required parameter 'filter_bounced_recipients_options' when calling BounceControllerApi.filter_bounced_recipient"
  end
  # resource path
  local_var_path = '/bounce/filter-recipients'

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

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

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

#get_account_bounce_block_status(opts = {}) ⇒ AccountBounceBlockDto

Can account send email Check if account block status prevents sending

Parameters:

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

    the optional parameters

Returns:



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

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

#get_account_bounce_block_status_with_http_info(opts = {}) ⇒ Array<(AccountBounceBlockDto, Integer, Hash)>

Can account send email Check if account block status prevents sending

Parameters:

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

    the optional parameters

Returns:

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

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

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BounceControllerApi.get_account_bounce_block_status ...'
  end
  # resource path
  local_var_path = '/bounce/account-block'

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

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

#get_bounced_email(id, opts = {}) ⇒ BouncedEmailDto

Get a bounced email. Bounced emails are email you have sent that were rejected by a recipient

Parameters:

  • id (String)

    ID of the bounced email to fetch

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

    the optional parameters

Returns:



147
148
149
150
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 147

def get_bounced_email(id, opts = {})
  data, _status_code, _headers = get_bounced_email_with_http_info(id, opts)
  data
end

#get_bounced_email_with_http_info(id, opts = {}) ⇒ Array<(BouncedEmailDto, Integer, Hash)>

Get a bounced email. Bounced emails are email you have sent that were rejected by a recipient

Parameters:

  • id (String)

    ID of the bounced email to fetch

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

    the optional parameters

Returns:

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

    BouncedEmailDto data, response status code and response headers



157
158
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
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 157

def get_bounced_email_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BounceControllerApi.get_bounced_email ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling BounceControllerApi.get_bounced_email"
  end
  # resource path
  local_var_path = '/bounce/emails/{id}'.sub('{' + 'id' + '}', CGI.escape(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] || 'BouncedEmailDto' 

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

#get_bounced_emails(opts = {}) ⇒ PageBouncedEmail

Get paginated list of bounced emails. Bounced emails are email you have sent that were rejected by a recipient

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index (default to 0)

  • :size (Integer)

    Optional page size (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:



213
214
215
216
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 213

def get_bounced_emails(opts = {})
  data, _status_code, _headers = get_bounced_emails_with_http_info(opts)
  data
end

#get_bounced_emails_with_http_info(opts = {}) ⇒ Array<(PageBouncedEmail, Integer, Hash)>

Get paginated list of bounced emails. Bounced emails are email you have sent that were rejected by a recipient

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index

  • :size (Integer)

    Optional page size

  • :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<(PageBouncedEmail, Integer, Hash)>)

    PageBouncedEmail data, response status code and response headers



227
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
275
276
277
278
279
280
281
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 227

def get_bounced_emails_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BounceControllerApi.get_bounced_emails ...'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling BounceControllerApi.get_bounced_emails, must be smaller than or equal to 100.'
  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 = '/bounce/emails'

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

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

#get_bounced_recipient(id, opts = {}) ⇒ BouncedRecipientDto

Get a bounced email. Bounced emails are email you have sent that were rejected by a recipient

Parameters:

  • id (String)

    ID of the bounced recipient

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

    the optional parameters

Returns:



288
289
290
291
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 288

def get_bounced_recipient(id, opts = {})
  data, _status_code, _headers = get_bounced_recipient_with_http_info(id, opts)
  data
end

#get_bounced_recipient_with_http_info(id, opts = {}) ⇒ Array<(BouncedRecipientDto, Integer, Hash)>

Get a bounced email. Bounced emails are email you have sent that were rejected by a recipient

Parameters:

  • id (String)

    ID of the bounced recipient

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

    the optional parameters

Returns:

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

    BouncedRecipientDto data, response status code and response headers



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
340
341
342
343
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 298

def get_bounced_recipient_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BounceControllerApi.get_bounced_recipient ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling BounceControllerApi.get_bounced_recipient"
  end
  # resource path
  local_var_path = '/bounce/recipients/{id}'.sub('{' + 'id' + '}', CGI.escape(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] || 'BouncedRecipientDto' 

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

#get_bounced_recipients(opts = {}) ⇒ PageBouncedRecipients

Get paginated list of bounced recipients. Bounced recipients are email addresses that you have sent emails to that did not accept the sent email. Once a recipient is bounced you cannot send emails to that address.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index (default to 0)

  • :size (Integer)

    Optional page size (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:



354
355
356
357
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 354

def get_bounced_recipients(opts = {})
  data, _status_code, _headers = get_bounced_recipients_with_http_info(opts)
  data
end

#get_bounced_recipients_with_http_info(opts = {}) ⇒ Array<(PageBouncedRecipients, Integer, Hash)>

Get paginated list of bounced recipients. Bounced recipients are email addresses that you have sent emails to that did not accept the sent email. Once a recipient is bounced you cannot send emails to that address.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index

  • :size (Integer)

    Optional page size

  • :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<(PageBouncedRecipients, Integer, Hash)>)

    PageBouncedRecipients data, response status code and response headers



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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 368

def get_bounced_recipients_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BounceControllerApi.get_bounced_recipients ...'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling BounceControllerApi.get_bounced_recipients, must be smaller than or equal to 100.'
  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 = '/bounce/recipients'

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

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

#get_complaint(id, opts = {}) ⇒ Complaint

Get complaint Get complaint

Parameters:

  • id (String)

    ID of the complaint

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

    the optional parameters

Returns:



429
430
431
432
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 429

def get_complaint(id, opts = {})
  data, _status_code, _headers = get_complaint_with_http_info(id, opts)
  data
end

#get_complaint_with_http_info(id, opts = {}) ⇒ Array<(Complaint, Integer, Hash)>

Get complaint Get complaint

Parameters:

  • id (String)

    ID of the complaint

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

    the optional parameters

Returns:

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

    Complaint data, response status code and response headers



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
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 439

def get_complaint_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BounceControllerApi.get_complaint ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling BounceControllerApi.get_complaint"
  end
  # resource path
  local_var_path = '/bounce/complaints/{id}'.sub('{' + 'id' + '}', CGI.escape(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] || 'Complaint' 

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

#get_complaints(opts = {}) ⇒ PageComplaint

Get paginated list of complaints. SMTP complaints made against your account

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index (default to 0)

  • :size (Integer)

    Optional page size (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:



495
496
497
498
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 495

def get_complaints(opts = {})
  data, _status_code, _headers = get_complaints_with_http_info(opts)
  data
end

#get_complaints_with_http_info(opts = {}) ⇒ Array<(PageComplaint, Integer, Hash)>

Get paginated list of complaints. SMTP complaints made against your account

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index

  • :size (Integer)

    Optional page size

  • :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<(PageComplaint, Integer, Hash)>)

    PageComplaint data, response status code and response headers



509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
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
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 509

def get_complaints_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BounceControllerApi.get_complaints ...'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling BounceControllerApi.get_complaints, must be smaller than or equal to 100.'
  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 = '/bounce/complaints'

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

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

#get_list_unsubscribe_recipients(opts = {}) ⇒ PageListUnsubscribeRecipients

Get paginated list of unsubscribed recipients. Unsubscribed recipient have unsubscribed from a mailing list for a user or domain and cannot be contacted again.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index (default to 0)

  • :size (Integer)

    Optional page size (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'ASC')

  • :domain_id (String)

    Filter by domainId

Returns:



573
574
575
576
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 573

def get_list_unsubscribe_recipients(opts = {})
  data, _status_code, _headers = get_list_unsubscribe_recipients_with_http_info(opts)
  data
end

#get_list_unsubscribe_recipients_with_http_info(opts = {}) ⇒ Array<(PageListUnsubscribeRecipients, Integer, Hash)>

Get paginated list of unsubscribed recipients. Unsubscribed recipient have unsubscribed from a mailing list for a user or domain and cannot be contacted again.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index

  • :size (Integer)

    Optional page size

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :domain_id (String)

    Filter by domainId

Returns:



586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
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
# File 'lib/mailslurp_client/api/bounce_controller_api.rb', line 586

def get_list_unsubscribe_recipients_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BounceControllerApi.get_list_unsubscribe_recipients ...'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling BounceControllerApi.get_list_unsubscribe_recipients, must be smaller than or equal to 100.'
  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 = '/bounce/list-unsubscribe-recipients'

  # 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[:'domainId'] = opts[:'domain_id'] if !opts[:'domain_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] || 'PageListUnsubscribeRecipients' 

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