Class: MailSlurpClient::RulesetControllerApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ RulesetControllerApi

Returns a new instance of RulesetControllerApi.



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

def api_client
  @api_client
end

Instance Method Details

#create_new_ruleset(create_ruleset_options, opts = {}) ⇒ RulesetDto

Create a ruleset Create a new inbox or phone number rule for forwarding, blocking, and allowing emails or SMS when sending and receiving

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Inbox id to attach ruleset to

  • :phone_id (String)

    Phone id to attach ruleset to

Returns:



29
30
31
32
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 29

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

#create_new_ruleset_with_http_info(create_ruleset_options, opts = {}) ⇒ Array<(RulesetDto, Integer, Hash)>

Create a ruleset Create a new inbox or phone number rule for forwarding, blocking, and allowing emails or SMS when sending and receiving

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Inbox id to attach ruleset to

  • :phone_id (String)

    Phone id to attach ruleset to

Returns:

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

    RulesetDto data, response status code and response headers



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
85
86
87
88
89
90
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 41

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
  query_params[:'phoneId'] = opts[:'phone_id'] if !opts[:'phone_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(create_ruleset_options) 

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

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

#delete_ruleset(id, opts = {}) ⇒ nil

Delete a ruleset Delete ruleset

Parameters:

  • id (String)

    ID of ruleset

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

    the optional parameters

Returns:

  • (nil)


97
98
99
100
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 97

def delete_ruleset(id, opts = {})
  delete_ruleset_with_http_info(id, opts)
  nil
end

#delete_ruleset_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a ruleset Delete ruleset

Parameters:

  • id (String)

    ID of ruleset

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
149
150
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 107

def delete_ruleset_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RulesetControllerApi.delete_ruleset ...'
  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 RulesetControllerApi.delete_ruleset"
  end
  # resource path
  local_var_path = '/rulesets/{id}'.sub('{' + 'id' + '}', CGI.escape(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: RulesetControllerApi#delete_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_rulesets(opts = {}) ⇒ nil

Delete rulesets Delete rulesets. Accepts optional inboxId or phoneId filters.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Optional inbox id to attach ruleset to

  • :phone_id (String)

Returns:

  • (nil)


158
159
160
161
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 158

def delete_rulesets(opts = {})
  delete_rulesets_with_http_info(opts)
  nil
end

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

Delete rulesets Delete rulesets. Accepts optional inboxId or phoneId filters.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Optional inbox id to attach ruleset to

  • :phone_id (String)

Returns:

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

    nil, response status code and response headers



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
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 169

def delete_rulesets_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RulesetControllerApi.delete_rulesets ...'
  end
  # resource path
  local_var_path = '/rulesets'

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

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

#get_ruleset(id, opts = {}) ⇒ RulesetDto

Get a ruleset Get ruleset

Parameters:

  • id (String)

    ID of ruleset

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

    the optional parameters

Returns:



217
218
219
220
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 217

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

#get_ruleset_with_http_info(id, opts = {}) ⇒ Array<(RulesetDto, Integer, Hash)>

Get a ruleset Get ruleset

Parameters:

  • id (String)

    ID of ruleset

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

    the optional parameters

Returns:

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

    RulesetDto 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
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 227

def get_ruleset_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RulesetControllerApi.get_ruleset ...'
  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 RulesetControllerApi.get_ruleset"
  end
  # resource path
  local_var_path = '/rulesets/{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] || 'RulesetDto' 

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

#get_rulesets(opts = {}) ⇒ PageRulesetDto

List rulesets block and allow lists List all rulesets attached to an inbox or phone or account

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Optional inbox id to get rulesets from

  • :phone_id (String)

    Optional phone id to get rulesets from

  • :page (Integer)

    Optional page index in inbox ruleset list pagination (default to 0)

  • :size (Integer)

    Optional page size in inbox ruleset list pagination (default to 20)

  • :sort (String)

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

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:



286
287
288
289
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 286

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

#get_rulesets_with_http_info(opts = {}) ⇒ Array<(PageRulesetDto, Integer, Hash)>

List rulesets block and allow lists List all rulesets attached to an inbox or phone or account

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Optional inbox id to get rulesets from

  • :phone_id (String)

    Optional phone id to get rulesets from

  • :page (Integer)

    Optional page index in inbox ruleset list pagination

  • :size (Integer)

    Optional page size in inbox ruleset list pagination

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:

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

    PageRulesetDto data, response status code and response headers



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
344
345
346
347
348
349
350
351
352
353
354
355
356
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 303

def get_rulesets_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RulesetControllerApi.get_rulesets ...'
  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 = '/rulesets'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
  query_params[:'phoneId'] = opts[:'phone_id'] if !opts[:'phone_id'].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[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].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] || 'PageRulesetDto' 

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

#test_inbox_rulesets_for_inbox(inbox_id, ruleset_test_options, opts = {}) ⇒ InboxRulesetTestResult

Test inbox rulesets for inbox Test inbox rulesets for inbox

Parameters:

  • inbox_id (String)

    ID of inbox

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

    the optional parameters

Returns:



364
365
366
367
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 364

def test_inbox_rulesets_for_inbox(inbox_id, ruleset_test_options, opts = {})
  data, _status_code, _headers = test_inbox_rulesets_for_inbox_with_http_info(inbox_id, ruleset_test_options, opts)
  data
end

#test_inbox_rulesets_for_inbox_with_http_info(inbox_id, ruleset_test_options, opts = {}) ⇒ Array<(InboxRulesetTestResult, Integer, Hash)>

Test inbox rulesets for inbox Test inbox rulesets for inbox

Parameters:

  • inbox_id (String)

    ID of inbox

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

    the optional parameters

Returns:

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

    InboxRulesetTestResult data, response status code and response headers



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
423
424
425
426
427
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 375

def test_inbox_rulesets_for_inbox_with_http_info(inbox_id, ruleset_test_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RulesetControllerApi.test_inbox_rulesets_for_inbox ...'
  end
  # verify the required parameter 'inbox_id' is set
  if @api_client.config.client_side_validation && inbox_id.nil?
    fail ArgumentError, "Missing the required parameter 'inbox_id' when calling RulesetControllerApi.test_inbox_rulesets_for_inbox"
  end
  # verify the required parameter 'ruleset_test_options' is set
  if @api_client.config.client_side_validation && ruleset_test_options.nil?
    fail ArgumentError, "Missing the required parameter 'ruleset_test_options' when calling RulesetControllerApi.test_inbox_rulesets_for_inbox"
  end
  # resource path
  local_var_path = '/rulesets'

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

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

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

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

#test_new_ruleset(test_new_inbox_ruleset_options, opts = {}) ⇒ InboxRulesetTestResult

Test new ruleset Test new ruleset

Parameters:

Returns:



434
435
436
437
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 434

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

#test_new_ruleset_with_http_info(test_new_inbox_ruleset_options, opts = {}) ⇒ Array<(InboxRulesetTestResult, Integer, Hash)>

Test new ruleset Test new ruleset

Parameters:

Returns:

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

    InboxRulesetTestResult data, response status code and response headers



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
485
486
487
488
489
490
491
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 444

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

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

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

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

#test_ruleset(id, ruleset_test_options, opts = {}) ⇒ InboxRulesetTestResult

Test a ruleset Test an inbox or phone ruleset

Parameters:

  • id (String)

    ID of ruleset

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

    the optional parameters

Returns:



499
500
501
502
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 499

def test_ruleset(id, ruleset_test_options, opts = {})
  data, _status_code, _headers = test_ruleset_with_http_info(id, ruleset_test_options, opts)
  data
end

#test_ruleset_receiving(test_ruleset_receiving_options, opts = {}) ⇒ TestRulesetReceivingResult

Test receiving with rulesets Test whether inbound emails from an email address would be blocked or allowed by inbox rulesets or test if phone number can receive SMS

Parameters:

Returns:



568
569
570
571
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 568

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

#test_ruleset_receiving_with_http_info(test_ruleset_receiving_options, opts = {}) ⇒ Array<(TestRulesetReceivingResult, Integer, Hash)>

Test receiving with rulesets Test whether inbound emails from an email address would be blocked or allowed by inbox rulesets or test if phone number can receive SMS

Parameters:

Returns:

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

    TestRulesetReceivingResult data, response status code and response headers



578
579
580
581
582
583
584
585
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
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 578

def test_ruleset_receiving_with_http_info(test_ruleset_receiving_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RulesetControllerApi.test_ruleset_receiving ...'
  end
  # verify the required parameter 'test_ruleset_receiving_options' is set
  if @api_client.config.client_side_validation && test_ruleset_receiving_options.nil?
    fail ArgumentError, "Missing the required parameter 'test_ruleset_receiving_options' when calling RulesetControllerApi.test_ruleset_receiving"
  end
  # resource path
  local_var_path = '/rulesets/test-receiving'

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

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

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

#test_ruleset_sending(test_inbox_ruleset_sending_options, opts = {}) ⇒ TestRulesetSendingResult

Test sending with rulesets Test whether outbound emails to an email address would be blocked or allowed by inbox rulesets or whether a phone number can send SMS

Parameters:

Returns:



632
633
634
635
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 632

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

#test_ruleset_sending_with_http_info(test_inbox_ruleset_sending_options, opts = {}) ⇒ Array<(TestRulesetSendingResult, Integer, Hash)>

Test sending with rulesets Test whether outbound emails to an email address would be blocked or allowed by inbox rulesets or whether a phone number can send SMS

Parameters:

Returns:

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

    TestRulesetSendingResult data, response status code and response headers



642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 642

def test_ruleset_sending_with_http_info(test_inbox_ruleset_sending_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RulesetControllerApi.test_ruleset_sending ...'
  end
  # verify the required parameter 'test_inbox_ruleset_sending_options' is set
  if @api_client.config.client_side_validation && test_inbox_ruleset_sending_options.nil?
    fail ArgumentError, "Missing the required parameter 'test_inbox_ruleset_sending_options' when calling RulesetControllerApi.test_ruleset_sending"
  end
  # resource path
  local_var_path = '/rulesets/test-sending'

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

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

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

#test_ruleset_with_http_info(id, ruleset_test_options, opts = {}) ⇒ Array<(InboxRulesetTestResult, Integer, Hash)>

Test a ruleset Test an inbox or phone ruleset

Parameters:

  • id (String)

    ID of ruleset

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

    the optional parameters

Returns:

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

    InboxRulesetTestResult data, response status code and response headers



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
# File 'lib/mailslurp_client/api/ruleset_controller_api.rb', line 510

def test_ruleset_with_http_info(id, ruleset_test_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RulesetControllerApi.test_ruleset ...'
  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 RulesetControllerApi.test_ruleset"
  end
  # verify the required parameter 'ruleset_test_options' is set
  if @api_client.config.client_side_validation && ruleset_test_options.nil?
    fail ArgumentError, "Missing the required parameter 'ruleset_test_options' when calling RulesetControllerApi.test_ruleset"
  end
  # resource path
  local_var_path = '/rulesets/{id}/test'.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(['*/*'])
  # 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(ruleset_test_options) 

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

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