Class: MailSlurpClient::PhoneControllerApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PhoneControllerApi

Returns a new instance of PhoneControllerApi.



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

def api_client
  @api_client
end

Instance Method Details

#acquire_phone_pool_lease(pool_id, acquire_phone_pool_lease_options, opts = {}) ⇒ PhonePoolLeaseDto

Acquire phone pool lease Acquire an available phone number from the pool and mark it leased

Parameters:

  • pool_id (String)
  • acquire_phone_pool_lease_options (AcquirePhonePoolLeaseOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



28
29
30
31
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 28

def acquire_phone_pool_lease(pool_id, acquire_phone_pool_lease_options, opts = {})
  data, _status_code, _headers = acquire_phone_pool_lease_with_http_info(pool_id, acquire_phone_pool_lease_options, opts)
  data
end

#acquire_phone_pool_lease_with_http_info(pool_id, acquire_phone_pool_lease_options, opts = {}) ⇒ Array<(PhonePoolLeaseDto, Integer, Hash)>

Acquire phone pool lease Acquire an available phone number from the pool and mark it leased

Parameters:

  • pool_id (String)
  • acquire_phone_pool_lease_options (AcquirePhonePoolLeaseOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    PhonePoolLeaseDto data, response status code and response headers



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

def acquire_phone_pool_lease_with_http_info(pool_id, acquire_phone_pool_lease_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.acquire_phone_pool_lease ...'
  end
  # verify the required parameter 'pool_id' is set
  if @api_client.config.client_side_validation && pool_id.nil?
    fail ArgumentError, "Missing the required parameter 'pool_id' when calling PhoneControllerApi.acquire_phone_pool_lease"
  end
  # verify the required parameter 'acquire_phone_pool_lease_options' is set
  if @api_client.config.client_side_validation && acquire_phone_pool_lease_options.nil?
    fail ArgumentError, "Missing the required parameter 'acquire_phone_pool_lease_options' when calling PhoneControllerApi.acquire_phone_pool_lease"
  end
  # resource path
  local_var_path = '/phone/pools/{poolId}/leases'.sub('{' + 'poolId' + '}', CGI.escape(pool_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(acquire_phone_pool_lease_options) 

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

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

#add_all_phone_numbers_to_phone_pool(pool_id, opts = {}) ⇒ PhonePoolDetailDto

Add all phone numbers to phone pool Add all active owned phone numbers to a pool

Parameters:

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

    the optional parameters

Returns:



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

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

#add_all_phone_numbers_to_phone_pool_with_http_info(pool_id, opts = {}) ⇒ Array<(PhonePoolDetailDto, Integer, Hash)>

Add all phone numbers to phone pool Add all active owned phone numbers to a pool

Parameters:

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

    the optional parameters

Returns:

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

    PhonePoolDetailDto data, 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
151
152
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 107

def add_all_phone_numbers_to_phone_pool_with_http_info(pool_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.add_all_phone_numbers_to_phone_pool ...'
  end
  # verify the required parameter 'pool_id' is set
  if @api_client.config.client_side_validation && pool_id.nil?
    fail ArgumentError, "Missing the required parameter 'pool_id' when calling PhoneControllerApi.add_all_phone_numbers_to_phone_pool"
  end
  # resource path
  local_var_path = '/phone/pools/{poolId}/numbers/add-all'.sub('{' + 'poolId' + '}', CGI.escape(pool_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] || 'PhonePoolDetailDto' 

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

#add_phone_numbers_to_phone_pool(pool_id, add_phone_pool_numbers_options, opts = {}) ⇒ PhonePoolDetailDto

Add phone numbers to phone pool Add one or more owned phone numbers to a pool

Parameters:

  • pool_id (String)
  • add_phone_pool_numbers_options (AddPhonePoolNumbersOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



160
161
162
163
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 160

def add_phone_numbers_to_phone_pool(pool_id, add_phone_pool_numbers_options, opts = {})
  data, _status_code, _headers = add_phone_numbers_to_phone_pool_with_http_info(pool_id, add_phone_pool_numbers_options, opts)
  data
end

#add_phone_numbers_to_phone_pool_with_http_info(pool_id, add_phone_pool_numbers_options, opts = {}) ⇒ Array<(PhonePoolDetailDto, Integer, Hash)>

Add phone numbers to phone pool Add one or more owned phone numbers to a pool

Parameters:

  • pool_id (String)
  • add_phone_pool_numbers_options (AddPhonePoolNumbersOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    PhonePoolDetailDto data, response status code and response headers



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 171

def add_phone_numbers_to_phone_pool_with_http_info(pool_id, add_phone_pool_numbers_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.add_phone_numbers_to_phone_pool ...'
  end
  # verify the required parameter 'pool_id' is set
  if @api_client.config.client_side_validation && pool_id.nil?
    fail ArgumentError, "Missing the required parameter 'pool_id' when calling PhoneControllerApi.add_phone_numbers_to_phone_pool"
  end
  # verify the required parameter 'add_phone_pool_numbers_options' is set
  if @api_client.config.client_side_validation && add_phone_pool_numbers_options.nil?
    fail ArgumentError, "Missing the required parameter 'add_phone_pool_numbers_options' when calling PhoneControllerApi.add_phone_numbers_to_phone_pool"
  end
  # resource path
  local_var_path = '/phone/pools/{poolId}/numbers'.sub('{' + 'poolId' + '}', CGI.escape(pool_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(add_phone_pool_numbers_options) 

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

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

#create_emergency_address(create_emergency_address_options, opts = {}) ⇒ EmergencyAddress

Create an emergency address Add an emergency address to a phone number

Parameters:

Returns:



229
230
231
232
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 229

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

#create_emergency_address_with_http_info(create_emergency_address_options, opts = {}) ⇒ Array<(EmergencyAddress, Integer, Hash)>

Create an emergency address Add an emergency address to a phone number

Parameters:

Returns:

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

    EmergencyAddress data, response status code and response headers



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
286
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 239

def create_emergency_address_with_http_info(create_emergency_address_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.create_emergency_address ...'
  end
  # verify the required parameter 'create_emergency_address_options' is set
  if @api_client.config.client_side_validation && create_emergency_address_options.nil?
    fail ArgumentError, "Missing the required parameter 'create_emergency_address_options' when calling PhoneControllerApi.create_emergency_address"
  end
  # resource path
  local_var_path = '/phone/emergency-addresses'

  # 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_emergency_address_options) 

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

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

#create_phone_number(create_phone_number_options, opts = {}) ⇒ PhoneNumberDto

Add phone number to your account. Only works if you have already added a plan and an initial phone number in your account and acknowledged the pricing and terms of service by enabling API phone creation. Create new phone number

Parameters:

Returns:



293
294
295
296
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 293

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

#create_phone_number_with_http_info(create_phone_number_options, opts = {}) ⇒ Array<(PhoneNumberDto, Integer, Hash)>

Add phone number to your account. Only works if you have already added a plan and an initial phone number in your account and acknowledged the pricing and terms of service by enabling API phone creation. Create new phone number

Parameters:

Returns:

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

    PhoneNumberDto 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
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 303

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

  # 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_phone_number_options) 

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

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

#create_phone_pool(create_phone_pool_options, opts = {}) ⇒ PhonePoolDetailDto

Create phone pool Create a reusable pool of phone numbers for coordinated leasing

Parameters:

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

    the optional parameters

Returns:



357
358
359
360
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 357

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

#create_phone_pool_with_http_info(create_phone_pool_options, opts = {}) ⇒ Array<(PhonePoolDetailDto, Integer, Hash)>

Create phone pool Create a reusable pool of phone numbers for coordinated leasing

Parameters:

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

    the optional parameters

Returns:

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

    PhonePoolDetailDto data, response status code and response headers



367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 367

def create_phone_pool_with_http_info(create_phone_pool_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.create_phone_pool ...'
  end
  # verify the required parameter 'create_phone_pool_options' is set
  if @api_client.config.client_side_validation && create_phone_pool_options.nil?
    fail ArgumentError, "Missing the required parameter 'create_phone_pool_options' when calling PhoneControllerApi.create_phone_pool"
  end
  # resource path
  local_var_path = '/phone/pools'

  # 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_phone_pool_options) 

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

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

#create_phone_provisioning_job(create_phone_provisioning_job_options, opts = {}) ⇒ PhoneProvisioningJobDto

Create a phone provisioning job Create an advanced phone provisioning job from shortlisted numbers

Parameters:

Returns:



421
422
423
424
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 421

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

#create_phone_provisioning_job_with_http_info(create_phone_provisioning_job_options, opts = {}) ⇒ Array<(PhoneProvisioningJobDto, Integer, Hash)>

Create a phone provisioning job Create an advanced phone provisioning job from shortlisted numbers

Parameters:

Returns:

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

    PhoneProvisioningJobDto data, response status code and response headers



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 431

def create_phone_provisioning_job_with_http_info(create_phone_provisioning_job_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.create_phone_provisioning_job ...'
  end
  # verify the required parameter 'create_phone_provisioning_job_options' is set
  if @api_client.config.client_side_validation && create_phone_provisioning_job_options.nil?
    fail ArgumentError, "Missing the required parameter 'create_phone_provisioning_job_options' when calling PhoneControllerApi.create_phone_provisioning_job"
  end
  # resource path
  local_var_path = '/phone/provisioning/jobs'

  # 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_phone_provisioning_job_options) 

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

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

#delete_all_phone_number(opts = {}) ⇒ nil

Delete all phone numbers Remove all phone number from account

Parameters:

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

    the optional parameters

Returns:

  • (nil)


484
485
486
487
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 484

def delete_all_phone_number(opts = {})
  delete_all_phone_number_with_http_info(opts)
  nil
end

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

Delete all phone numbers Remove all phone number from account

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 493

def delete_all_phone_number_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.delete_all_phone_number ...'
  end
  # resource path
  local_var_path = '/phone/numbers'

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

#delete_emergency_address(address_id, opts = {}) ⇒ EmptyResponseDto

Delete an emergency address Delete an emergency address

Parameters:

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

    the optional parameters

Returns:



539
540
541
542
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 539

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

#delete_emergency_address_with_http_info(address_id, opts = {}) ⇒ Array<(EmptyResponseDto, Integer, Hash)>

Delete an emergency address Delete an emergency address

Parameters:

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

    the optional parameters

Returns:

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

    EmptyResponseDto data, response status code and response headers



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
582
583
584
585
586
587
588
589
590
591
592
593
594
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 549

def delete_emergency_address_with_http_info(address_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.delete_emergency_address ...'
  end
  # verify the required parameter 'address_id' is set
  if @api_client.config.client_side_validation && address_id.nil?
    fail ArgumentError, "Missing the required parameter 'address_id' when calling PhoneControllerApi.delete_emergency_address"
  end
  # resource path
  local_var_path = '/phone/emergency-addresses/{addressId}'.sub('{' + 'addressId' + '}', CGI.escape(address_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] || 'EmptyResponseDto' 

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

#delete_phone_message_thread_items(phone_number_id, other_number, opts = {}) ⇒ EmptyResponseDto

Delete messages in a phone thread Delete all messages in an SMS thread

Parameters:

  • phone_number_id (String)
  • other_number (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



602
603
604
605
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 602

def delete_phone_message_thread_items(phone_number_id, other_number, opts = {})
  data, _status_code, _headers = delete_phone_message_thread_items_with_http_info(phone_number_id, other_number, opts)
  data
end

#delete_phone_message_thread_items_with_http_info(phone_number_id, other_number, opts = {}) ⇒ Array<(EmptyResponseDto, Integer, Hash)>

Delete messages in a phone thread Delete all messages in an SMS thread

Parameters:

  • phone_number_id (String)
  • other_number (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    EmptyResponseDto data, response status code and response headers



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
658
659
660
661
662
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 613

def delete_phone_message_thread_items_with_http_info(phone_number_id, other_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.delete_phone_message_thread_items ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.delete_phone_message_thread_items"
  end
  # verify the required parameter 'other_number' is set
  if @api_client.config.client_side_validation && other_number.nil?
    fail ArgumentError, "Missing the required parameter 'other_number' when calling PhoneControllerApi.delete_phone_message_thread_items"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}/message-threads/{otherNumber}'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_id.to_s)).sub('{' + 'otherNumber' + '}', CGI.escape(other_number.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] || 'EmptyResponseDto' 

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

#delete_phone_number(phone_number_id, opts = {}) ⇒ nil

Delete a phone number Remove phone number from account

Parameters:

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

    the optional parameters

Returns:

  • (nil)


669
670
671
672
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 669

def delete_phone_number(phone_number_id, opts = {})
  delete_phone_number_with_http_info(phone_number_id, opts)
  nil
end

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

Delete a phone number Remove phone number from account

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

def delete_phone_number_with_http_info(phone_number_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.delete_phone_number ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.delete_phone_number"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_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: PhoneControllerApi#delete_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_phone_pool(pool_id, opts = {}) ⇒ nil

Delete phone pool Delete a phone pool and release any active leases from that pool

Parameters:

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

    the optional parameters

Returns:

  • (nil)


729
730
731
732
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 729

def delete_phone_pool(pool_id, opts = {})
  delete_phone_pool_with_http_info(pool_id, opts)
  nil
end

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

Delete phone pool Delete a phone pool and release any active leases from that pool

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



739
740
741
742
743
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
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 739

def delete_phone_pool_with_http_info(pool_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.delete_phone_pool ...'
  end
  # verify the required parameter 'pool_id' is set
  if @api_client.config.client_side_validation && pool_id.nil?
    fail ArgumentError, "Missing the required parameter 'pool_id' when calling PhoneControllerApi.delete_phone_pool"
  end
  # resource path
  local_var_path = '/phone/pools/{poolId}'.sub('{' + 'poolId' + '}', CGI.escape(pool_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: PhoneControllerApi#delete_phone_pool\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_phone_message_threads(opts = {}) ⇒ PagePhoneMessageThreadProjection

Get the latest messages for all phones List all message threads for all phones

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 0
  • :size (Integer) — default: default to 20

Returns:



790
791
792
793
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 790

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

#get_all_phone_message_threads_with_http_info(opts = {}) ⇒ Array<(PagePhoneMessageThreadProjection, Integer, Hash)>

Get the latest messages for all phones List all message threads for all phones

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)
  • :size (Integer)

Returns:



801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 801

def get_all_phone_message_threads_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_all_phone_message_threads ...'
  end
  # resource path
  local_var_path = '/phone/numbers/message-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?

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

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

#get_all_phone_number_releases(opts = {}) ⇒ PagePhoneNumberReleaseProjection

Get all phone number releases List released or deleted phone numbers

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 0
  • :size (Integer) — default: default to 20
  • :sort (String)

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

Returns:



853
854
855
856
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 853

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

#get_all_phone_number_releases_with_http_info(opts = {}) ⇒ Array<(PagePhoneNumberReleaseProjection, Integer, Hash)>

Get all phone number releases List released or deleted phone numbers

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)
  • :size (Integer)
  • :sort (String)

    Optional createdAt sort direction ASC or DESC

Returns:



865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 865

def get_all_phone_number_releases_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_all_phone_number_releases ...'
  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 = '/phone/releases'

  # 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?

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

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

Get consent status Get the status of phone usage consent

Parameters:

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

    the optional parameters

Returns:



919
920
921
922
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 919

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

Get consent status Get the status of phone usage consent

Parameters:

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

    the optional parameters

Returns:

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

    ConsentStatusDto data, response status code and response headers



928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 928

def get_consent_status_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_consent_status ...'
  end
  # resource path
  local_var_path = '/phone/consent'

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

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

#get_emergency_address(address_id, opts = {}) ⇒ EmergencyAddress

Get an emergency address Fetch an emergency address by ID

Parameters:

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

    the optional parameters

Returns:



976
977
978
979
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 976

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

#get_emergency_address_with_http_info(address_id, opts = {}) ⇒ Array<(EmergencyAddress, Integer, Hash)>

Get an emergency address Fetch an emergency address by ID

Parameters:

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

    the optional parameters

Returns:

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

    EmergencyAddress data, response status code and response headers



986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 986

def get_emergency_address_with_http_info(address_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_emergency_address ...'
  end
  # verify the required parameter 'address_id' is set
  if @api_client.config.client_side_validation && address_id.nil?
    fail ArgumentError, "Missing the required parameter 'address_id' when calling PhoneControllerApi.get_emergency_address"
  end
  # resource path
  local_var_path = '/phone/emergency-addresses/{addressId}'.sub('{' + 'addressId' + '}', CGI.escape(address_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] || 'EmergencyAddress' 

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

#get_emergency_addresses(opts = {}) ⇒ Array<EmergencyAddressDto>

Get emergency addresses List emergency addresses

Parameters:

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

    the optional parameters

Returns:



1037
1038
1039
1040
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1037

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

#get_emergency_addresses_with_http_info(opts = {}) ⇒ Array<(Array<EmergencyAddressDto>, Integer, Hash)>

Get emergency addresses List emergency addresses

Parameters:

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

    the optional parameters

Returns:

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

    Array<EmergencyAddressDto> data, response status code and response headers



1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1046

def get_emergency_addresses_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_emergency_addresses ...'
  end
  # resource path
  local_var_path = '/phone/emergency-addresses'

  # 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] || 'Array<EmergencyAddressDto>' 

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

#get_or_create_phone_pool(get_or_create_phone_pool_options, opts = {}) ⇒ PhonePoolDetailDto

Get or create phone pool Get a phone pool by name or create it if it does not exist

Parameters:

Returns:



1094
1095
1096
1097
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1094

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

#get_or_create_phone_pool_with_http_info(get_or_create_phone_pool_options, opts = {}) ⇒ Array<(PhonePoolDetailDto, Integer, Hash)>

Get or create phone pool Get a phone pool by name or create it if it does not exist

Parameters:

Returns:

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

    PhonePoolDetailDto data, response status code and response headers



1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1104

def get_or_create_phone_pool_with_http_info(get_or_create_phone_pool_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_or_create_phone_pool ...'
  end
  # verify the required parameter 'get_or_create_phone_pool_options' is set
  if @api_client.config.client_side_validation && get_or_create_phone_pool_options.nil?
    fail ArgumentError, "Missing the required parameter 'get_or_create_phone_pool_options' when calling PhoneControllerApi.get_or_create_phone_pool"
  end
  # resource path
  local_var_path = '/phone/pools/get-or-create'

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

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

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

#get_phone_message_thread_items(phone_number_id, other_number, opts = {}) ⇒ PagePhoneMessageThreadItemProjection

Get messages in a phone thread List message thread messages for a phone message thread

Parameters:

  • phone_number_id (String)
  • other_number (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 0
  • :size (Integer) — default: default to 20

Returns:



1161
1162
1163
1164
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1161

def get_phone_message_thread_items(phone_number_id, other_number, opts = {})
  data, _status_code, _headers = get_phone_message_thread_items_with_http_info(phone_number_id, other_number, opts)
  data
end

#get_phone_message_thread_items_with_http_info(phone_number_id, other_number, opts = {}) ⇒ Array<(PagePhoneMessageThreadItemProjection, Integer, Hash)>

Get messages in a phone thread List message thread messages for a phone message thread

Parameters:

  • phone_number_id (String)
  • other_number (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)
  • :size (Integer)

Returns:



1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1174

def get_phone_message_thread_items_with_http_info(phone_number_id, other_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_message_thread_items ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.get_phone_message_thread_items"
  end
  # verify the required parameter 'other_number' is set
  if @api_client.config.client_side_validation && other_number.nil?
    fail ArgumentError, "Missing the required parameter 'other_number' when calling PhoneControllerApi.get_phone_message_thread_items"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}/message-threads/{otherNumber}'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_id.to_s)).sub('{' + 'otherNumber' + '}', CGI.escape(other_number.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?

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

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

#get_phone_message_threads(phone_number_id, opts = {}) ⇒ PagePhoneMessageThreadProjection

Get the latest message preview for a thread List message threads for a phone

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 0
  • :size (Integer) — default: default to 20

Returns:



1234
1235
1236
1237
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1234

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

#get_phone_message_threads_with_http_info(phone_number_id, opts = {}) ⇒ Array<(PagePhoneMessageThreadProjection, Integer, Hash)>

Get the latest message preview for a thread List message threads for a phone

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)
  • :size (Integer)

Returns:



1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1246

def get_phone_message_threads_with_http_info(phone_number_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_message_threads ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.get_phone_message_threads"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}/message-threads'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_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?

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

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

#get_phone_number(phone_number_id, opts = {}) ⇒ PhoneNumberDto

Get a phone number by ID Get a phone number by ID

Parameters:

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

    the optional parameters

Returns:



1300
1301
1302
1303
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1300

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

#get_phone_number_by_name(name, opts = {}) ⇒ PhoneNumberDto

Get a phone number by name Get a phone number by name

Parameters:

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

    the optional parameters

Returns:



1362
1363
1364
1365
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1362

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

#get_phone_number_by_name_with_http_info(name, opts = {}) ⇒ Array<(PhoneNumberDto, Integer, Hash)>

Get a phone number by name Get a phone number by name

Parameters:

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

    the optional parameters

Returns:

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

    PhoneNumberDto data, response status code and response headers



1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1372

def get_phone_number_by_name_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_number_by_name ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling PhoneControllerApi.get_phone_number_by_name"
  end
  # resource path
  local_var_path = '/phone/numbers/by-name'

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

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

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

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

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

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

#get_phone_number_by_phone_number(phone_number, opts = {}) ⇒ PhoneNumberDto

Get a phone number by phone number Get a phone number by phone number

Parameters:

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

    the optional parameters

Returns:



1425
1426
1427
1428
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1425

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

#get_phone_number_by_phone_number_with_http_info(phone_number, opts = {}) ⇒ Array<(PhoneNumberDto, Integer, Hash)>

Get a phone number by phone number Get a phone number by phone number

Parameters:

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

    the optional parameters

Returns:

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

    PhoneNumberDto data, response status code and response headers



1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1435

def get_phone_number_by_phone_number_with_http_info(phone_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_number_by_phone_number ...'
  end
  # verify the required parameter 'phone_number' is set
  if @api_client.config.client_side_validation && phone_number.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number' when calling PhoneControllerApi.get_phone_number_by_phone_number"
  end
  # resource path
  local_var_path = '/phone/numbers/by-phone-number'

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

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

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

#get_phone_number_line_type_intelligence(validate_phone_number_options, opts = {}) ⇒ PhoneNumberLineTypeLookupDto

Get line type intelligence for a phone number Lookup line type intelligence for a phone number

Parameters:

Returns:



1488
1489
1490
1491
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1488

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

#get_phone_number_line_type_intelligence_with_http_info(validate_phone_number_options, opts = {}) ⇒ Array<(PhoneNumberLineTypeLookupDto, Integer, Hash)>

Get line type intelligence for a phone number Lookup line type intelligence for a phone number

Parameters:

Returns:



1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1498

def get_phone_number_line_type_intelligence_with_http_info(validate_phone_number_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_number_line_type_intelligence ...'
  end
  # verify the required parameter 'validate_phone_number_options' is set
  if @api_client.config.client_side_validation && validate_phone_number_options.nil?
    fail ArgumentError, "Missing the required parameter 'validate_phone_number_options' when calling PhoneControllerApi.get_phone_number_line_type_intelligence"
  end
  # resource path
  local_var_path = '/phone/validate/line-type-intelligence'

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

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

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

#get_phone_number_release(release_id, opts = {}) ⇒ PhoneNumberReleaseProjection

Get phone number release Get a released or deleted phone numbers

Parameters:

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

    the optional parameters

Returns:



1552
1553
1554
1555
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1552

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

#get_phone_number_release_with_http_info(release_id, opts = {}) ⇒ Array<(PhoneNumberReleaseProjection, Integer, Hash)>

Get phone number release Get a released or deleted phone numbers

Parameters:

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

    the optional parameters

Returns:



1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1562

def get_phone_number_release_with_http_info(release_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_number_release ...'
  end
  # verify the required parameter 'release_id' is set
  if @api_client.config.client_side_validation && release_id.nil?
    fail ArgumentError, "Missing the required parameter 'release_id' when calling PhoneControllerApi.get_phone_number_release"
  end
  # resource path
  local_var_path = '/phone/releases/{releaseId}'.sub('{' + 'releaseId' + '}', CGI.escape(release_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] || 'PhoneNumberReleaseProjection' 

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

#get_phone_number_with_http_info(phone_number_id, opts = {}) ⇒ Array<(PhoneNumberDto, Integer, Hash)>

Get a phone number by ID Get a phone number by ID

Parameters:

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

    the optional parameters

Returns:

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

    PhoneNumberDto data, response status code and response headers



1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1310

def get_phone_number_with_http_info(phone_number_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_number ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.get_phone_number"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_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] || 'PhoneNumberDto' 

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

#get_phone_numbers(opts = {}) ⇒ PagePhoneNumberProjection

Get phone numbers List phone numbers for account

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :phone_country (String)

    Optional phone country

  • :line_type (String)

    Optional line type filter

  • :carrier_name (String)

    Optional carrier name filter

  • :mobile_country_code (String)

    Optional mobile country code filter

  • :mobile_network_code (String)

    Optional mobile network code filter

  • :provider_label (String)

    Optional provider label filter such as T1 or T2

  • :page (Integer)

    Optional page index for list pagination (default to 0)

  • :size (Integer)

    Optional page size for 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

  • :search (String)

    Optional search filter

  • :include (Array<String>)

    Optional phoneIds to include in result

  • :favourite (Boolean)

    Optionally filter results for favourites only (default to false)

Returns:



1627
1628
1629
1630
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1627

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

#get_phone_numbers_with_http_info(opts = {}) ⇒ Array<(PagePhoneNumberProjection, Integer, Hash)>

Get phone numbers List phone numbers for account

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :phone_country (String)

    Optional phone country

  • :line_type (String)

    Optional line type filter

  • :carrier_name (String)

    Optional carrier name filter

  • :mobile_country_code (String)

    Optional mobile country code filter

  • :mobile_network_code (String)

    Optional mobile network code filter

  • :provider_label (String)

    Optional provider label filter such as T1 or T2

  • :page (Integer)

    Optional page index for list pagination

  • :size (Integer)

    Optional page size for 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

  • :search (String)

    Optional search filter

  • :include (Array<String>)

    Optional phoneIds to include in result

  • :favourite (Boolean)

    Optionally filter results for favourites only

Returns:

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

    PagePhoneNumberProjection data, response status code and response headers



1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1650

def get_phone_numbers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_numbers ...'
  end
  allowable_values = ["US", "GB", "AU", "CA", "EE", "HK", "PL", "PT", "NL", "IL", "FI", "SE"]
  if @api_client.config.client_side_validation && opts[:'phone_country'] && !allowable_values.include?(opts[:'phone_country'])
    fail ArgumentError, "invalid value for \"phone_country\", must be one of #{allowable_values}"
  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 = '/phone/numbers'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'phoneCountry'] = opts[:'phone_country'] if !opts[:'phone_country'].nil?
  query_params[:'lineType'] = opts[:'line_type'] if !opts[:'line_type'].nil?
  query_params[:'carrierName'] = opts[:'carrier_name'] if !opts[:'carrier_name'].nil?
  query_params[:'mobileCountryCode'] = opts[:'mobile_country_code'] if !opts[:'mobile_country_code'].nil?
  query_params[:'mobileNetworkCode'] = opts[:'mobile_network_code'] if !opts[:'mobile_network_code'].nil?
  query_params[:'providerLabel'] = opts[:'provider_label'] if !opts[:'provider_label'].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?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :multi) if !opts[:'include'].nil?
  query_params[:'favourite'] = opts[:'favourite'] if !opts[:'favourite'].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] || 'PagePhoneNumberProjection' 

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

#get_phone_plans(opts = {}) ⇒ Array<PhonePlanDto>

Get phone plans Get phone number plans

Parameters:

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

    the optional parameters

Returns:



1719
1720
1721
1722
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1719

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

#get_phone_plans_availability(opts = {}) ⇒ PhonePlanAvailability

Get phone plans availability

Parameters:

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

    the optional parameters

Returns:



1774
1775
1776
1777
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1774

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

#get_phone_plans_availability_with_http_info(opts = {}) ⇒ Array<(PhonePlanAvailability, Integer, Hash)>

Get phone plans availability

Parameters:

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

    the optional parameters

Returns:

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

    PhonePlanAvailability data, response status code and response headers



1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1782

def get_phone_plans_availability_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_plans_availability ...'
  end
  # resource path
  local_var_path = '/phone/plans/availability'

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

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

#get_phone_plans_with_http_info(opts = {}) ⇒ Array<(Array<PhonePlanDto>, Integer, Hash)>

Get phone plans Get phone number plans

Parameters:

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

    the optional parameters

Returns:

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

    Array<PhonePlanDto> data, response status code and response headers



1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1728

def get_phone_plans_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_plans ...'
  end
  # resource path
  local_var_path = '/phone/plans'

  # 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] || 'Array<PhonePlanDto>' 

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

#get_phone_pool(pool_id, opts = {}) ⇒ PhonePoolDetailDto

Get phone pool Get phone pool details by ID

Parameters:

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

    the optional parameters

Returns:



1830
1831
1832
1833
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1830

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

#get_phone_pool_by_name(name, opts = {}) ⇒ PhonePoolDetailDto

Get phone pool by name Get phone pool details by name

Parameters:

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

    the optional parameters

Returns:



1892
1893
1894
1895
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1892

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

#get_phone_pool_by_name_with_http_info(name, opts = {}) ⇒ Array<(PhonePoolDetailDto, Integer, Hash)>

Get phone pool by name Get phone pool details by name

Parameters:

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

    the optional parameters

Returns:

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

    PhonePoolDetailDto data, response status code and response headers



1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1902

def get_phone_pool_by_name_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_pool_by_name ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling PhoneControllerApi.get_phone_pool_by_name"
  end
  # resource path
  local_var_path = '/phone/pools/by-name'

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

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

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

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

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

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

#get_phone_pool_with_http_info(pool_id, opts = {}) ⇒ Array<(PhonePoolDetailDto, Integer, Hash)>

Get phone pool Get phone pool details by ID

Parameters:

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

    the optional parameters

Returns:

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

    PhonePoolDetailDto data, response status code and response headers



1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1840

def get_phone_pool_with_http_info(pool_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_pool ...'
  end
  # verify the required parameter 'pool_id' is set
  if @api_client.config.client_side_validation && pool_id.nil?
    fail ArgumentError, "Missing the required parameter 'pool_id' when calling PhoneControllerApi.get_phone_pool"
  end
  # resource path
  local_var_path = '/phone/pools/{poolId}'.sub('{' + 'poolId' + '}', CGI.escape(pool_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] || 'PhonePoolDetailDto' 

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

#get_phone_pools(opts = {}) ⇒ Array<PhonePoolDto>

Get phone pools List phone pools for the authenticated user

Parameters:

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

    the optional parameters

Returns:



1954
1955
1956
1957
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1954

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

#get_phone_pools_with_http_info(opts = {}) ⇒ Array<(Array<PhonePoolDto>, Integer, Hash)>

Get phone pools List phone pools for the authenticated user

Parameters:

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

    the optional parameters

Returns:

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

    Array<PhonePoolDto> data, response status code and response headers



1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1963

def get_phone_pools_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_pools ...'
  end
  # resource path
  local_var_path = '/phone/pools'

  # 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] || 'Array<PhonePoolDto>' 

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

#get_phone_provisioning_capabilities(phone_country, opts = {}) ⇒ PhoneProviderCapabilitiesResult

Get phone provisioning capabilities Get supported provider-country variant capabilities for advanced provisioning

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider_label (String)

Returns:



2012
2013
2014
2015
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2012

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

#get_phone_provisioning_capabilities_with_http_info(phone_country, opts = {}) ⇒ Array<(PhoneProviderCapabilitiesResult, Integer, Hash)>

Get phone provisioning capabilities Get supported provider-country variant capabilities for advanced provisioning

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :provider_label (String)

Returns:



2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2023

def get_phone_provisioning_capabilities_with_http_info(phone_country, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_provisioning_capabilities ...'
  end
  # verify the required parameter 'phone_country' is set
  if @api_client.config.client_side_validation && phone_country.nil?
    fail ArgumentError, "Missing the required parameter 'phone_country' when calling PhoneControllerApi.get_phone_provisioning_capabilities"
  end
  # verify enum value
  allowable_values = ["US", "GB", "AU", "CA", "EE", "HK", "PL", "PT", "NL", "IL", "FI", "SE"]
  if @api_client.config.client_side_validation && !allowable_values.include?(phone_country)
    fail ArgumentError, "invalid value for \"phone_country\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/phone/provisioning/capabilities'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'phoneCountry'] = phone_country
  query_params[:'providerLabel'] = opts[:'provider_label'] if !opts[:'provider_label'].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] || 'PhoneProviderCapabilitiesResult' 

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

#get_phone_provisioning_job(job_id, opts = {}) ⇒ PhoneProvisioningJobDto

Get phone provisioning job Get advanced phone provisioning job status

Parameters:

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

    the optional parameters

Returns:



2082
2083
2084
2085
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2082

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

#get_phone_provisioning_job_with_http_info(job_id, opts = {}) ⇒ Array<(PhoneProvisioningJobDto, Integer, Hash)>

Get phone provisioning job Get advanced phone provisioning job status

Parameters:

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

    the optional parameters

Returns:

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

    PhoneProvisioningJobDto data, response status code and response headers



2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2092

def get_phone_provisioning_job_with_http_info(job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_provisioning_job ...'
  end
  # verify the required parameter 'job_id' is set
  if @api_client.config.client_side_validation && job_id.nil?
    fail ArgumentError, "Missing the required parameter 'job_id' when calling PhoneControllerApi.get_phone_provisioning_job"
  end
  # resource path
  local_var_path = '/phone/provisioning/jobs/{jobId}'.sub('{' + 'jobId' + '}', CGI.escape(job_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] || 'PhoneProvisioningJobDto' 

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

#get_phone_sms_prepaid_credit(credit_id, opts = {}) ⇒ PhoneSmsPrepaidCreditDto

Get SMS prepaid credit Get a specific SMS prepaid credit balance for the authenticated account

Parameters:

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

    the optional parameters

Returns:



2144
2145
2146
2147
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2144

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

#get_phone_sms_prepaid_credit_with_http_info(credit_id, opts = {}) ⇒ Array<(PhoneSmsPrepaidCreditDto, Integer, Hash)>

Get SMS prepaid credit Get a specific SMS prepaid credit balance for the authenticated account

Parameters:

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

    the optional parameters

Returns:

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

    PhoneSmsPrepaidCreditDto data, response status code and response headers



2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2154

def get_phone_sms_prepaid_credit_with_http_info(credit_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_sms_prepaid_credit ...'
  end
  # verify the required parameter 'credit_id' is set
  if @api_client.config.client_side_validation && credit_id.nil?
    fail ArgumentError, "Missing the required parameter 'credit_id' when calling PhoneControllerApi.get_phone_sms_prepaid_credit"
  end
  # resource path
  local_var_path = '/phone/sms-prepaid-credits/{creditId}'.sub('{' + 'creditId' + '}', CGI.escape(credit_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] || 'PhoneSmsPrepaidCreditDto' 

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

#get_phone_sms_prepaid_credits(opts = {}) ⇒ PhoneSmsPrepaidCreditsDto

Get SMS prepaid credits List SMS prepaid credits for the authenticated account

Parameters:

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

    the optional parameters

Returns:



2205
2206
2207
2208
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2205

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

#get_phone_sms_prepaid_credits_with_http_info(opts = {}) ⇒ Array<(PhoneSmsPrepaidCreditsDto, Integer, Hash)>

Get SMS prepaid credits List SMS prepaid credits for the authenticated account

Parameters:

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

    the optional parameters

Returns:

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

    PhoneSmsPrepaidCreditsDto data, response status code and response headers



2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2214

def get_phone_sms_prepaid_credits_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_sms_prepaid_credits ...'
  end
  # resource path
  local_var_path = '/phone/sms-prepaid-credits'

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

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

#get_phone_summary(opts = {}) ⇒ PhoneSummaryDto

Get phone summary Get overview of assigned phones

Parameters:

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

    the optional parameters

Returns:



2261
2262
2263
2264
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2261

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

#get_phone_summary_with_http_info(opts = {}) ⇒ Array<(PhoneSummaryDto, Integer, Hash)>

Get phone summary Get overview of assigned phones

Parameters:

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

    the optional parameters

Returns:

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

    PhoneSummaryDto data, response status code and response headers



2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2270

def get_phone_summary_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_summary ...'
  end
  # resource path
  local_var_path = '/phone/summary'

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

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

#get_sent_sms_by_phone_number(phone_number_id, opts = {}) ⇒ PageSentSmsProjection

List sent TXT messages for a phone number Get sent SMS messages for a phone number

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results (default to 20)

  • :sort (String)

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

  • :since (DateTime)

    Optional filter SMSs received after given date time

  • :before (DateTime)

    Optional filter SMSs received before given date time

  • :search (String)

    Optional search filter

Returns:



2324
2325
2326
2327
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2324

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

#get_sent_sms_by_phone_number_with_http_info(phone_number_id, opts = {}) ⇒ Array<(PageSentSmsProjection, Integer, Hash)>

List sent TXT messages for a phone number Get sent SMS messages for a phone number

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in SMS list pagination

  • :size (Integer)

    Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :since (DateTime)

    Optional filter SMSs received after given date time

  • :before (DateTime)

    Optional filter SMSs received before given date time

  • :search (String)

    Optional search filter

Returns:

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

    PageSentSmsProjection data, response status code and response headers



2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2340

def get_sent_sms_by_phone_number_with_http_info(phone_number_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_sent_sms_by_phone_number ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.get_sent_sms_by_phone_number"
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling PhoneControllerApi.get_sent_sms_by_phone_number, 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 = '/phone/numbers/{phoneNumberId}/sms-sent'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_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?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].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] || 'PageSentSmsProjection' 

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

#get_sms_by_phone_number(phone_number_id, opts = {}) ⇒ PageSmsProjection

List SMS messages for a phone number Get SMS messages for a phone number

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results (default to 20)

  • :sort (String)

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

  • :unread_only (Boolean)

    Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly (default to false)

  • :since (DateTime)

    Optional filter SMSs received after given date time

  • :before (DateTime)

    Optional filter SMSs received before given date time

  • :search (String)

    Optional search filter

  • :favourite (Boolean)

    Optionally filter results for favourites only (default to false)

Returns:



2414
2415
2416
2417
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2414

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

#get_sms_by_phone_number_with_http_info(phone_number_id, opts = {}) ⇒ Array<(PageSmsProjection, Integer, Hash)>

List SMS messages for a phone number Get SMS messages for a phone number

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in SMS list pagination

  • :size (Integer)

    Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :unread_only (Boolean)

    Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly

  • :since (DateTime)

    Optional filter SMSs received after given date time

  • :before (DateTime)

    Optional filter SMSs received before given date time

  • :search (String)

    Optional search filter

  • :favourite (Boolean)

    Optionally filter results for favourites only

Returns:

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

    PageSmsProjection data, response status code and response headers



2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2432

def get_sms_by_phone_number_with_http_info(phone_number_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_sms_by_phone_number ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.get_sms_by_phone_number"
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling PhoneControllerApi.get_sms_by_phone_number, 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 = '/phone/numbers/{phoneNumberId}/sms'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_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[:'unreadOnly'] = opts[:'unread_only'] if !opts[:'unread_only'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'favourite'] = opts[:'favourite'] if !opts[:'favourite'].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] || 'PageSmsProjection' 

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

#reassign_phone_number_release(release_id, opts = {}) ⇒ PhoneNumberDto

Reassign phone number release Reassign phone number that was released or deleted

Parameters:

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

    the optional parameters

Returns:



2500
2501
2502
2503
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2500

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

#reassign_phone_number_release_with_http_info(release_id, opts = {}) ⇒ Array<(PhoneNumberDto, Integer, Hash)>

Reassign phone number release Reassign phone number that was released or deleted

Parameters:

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

    the optional parameters

Returns:

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

    PhoneNumberDto data, response status code and response headers



2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2510

def reassign_phone_number_release_with_http_info(release_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.reassign_phone_number_release ...'
  end
  # verify the required parameter 'release_id' is set
  if @api_client.config.client_side_validation && release_id.nil?
    fail ArgumentError, "Missing the required parameter 'release_id' when calling PhoneControllerApi.reassign_phone_number_release"
  end
  # resource path
  local_var_path = '/phone/releases/{releaseId}/reassign'.sub('{' + 'releaseId' + '}', CGI.escape(release_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] || 'PhoneNumberDto' 

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

#release_phone_pool_lease(pool_id, lease_id, opts = {}) ⇒ nil

Release phone pool lease Release an active phone pool lease

Parameters:

  • pool_id (String)
  • lease_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


2563
2564
2565
2566
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2563

def release_phone_pool_lease(pool_id, lease_id, opts = {})
  release_phone_pool_lease_with_http_info(pool_id, lease_id, opts)
  nil
end

#release_phone_pool_lease_with_http_info(pool_id, lease_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Release phone pool lease Release an active phone pool lease

Parameters:

  • pool_id (String)
  • lease_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2574

def release_phone_pool_lease_with_http_info(pool_id, lease_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.release_phone_pool_lease ...'
  end
  # verify the required parameter 'pool_id' is set
  if @api_client.config.client_side_validation && pool_id.nil?
    fail ArgumentError, "Missing the required parameter 'pool_id' when calling PhoneControllerApi.release_phone_pool_lease"
  end
  # verify the required parameter 'lease_id' is set
  if @api_client.config.client_side_validation && lease_id.nil?
    fail ArgumentError, "Missing the required parameter 'lease_id' when calling PhoneControllerApi.release_phone_pool_lease"
  end
  # resource path
  local_var_path = '/phone/pools/{poolId}/leases/{leaseId}'.sub('{' + 'poolId' + '}', CGI.escape(pool_id.to_s)).sub('{' + 'leaseId' + '}', CGI.escape(lease_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: PhoneControllerApi#release_phone_pool_lease\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_phone_number_from_phone_pool(pool_id, phone_number_id, opts = {}) ⇒ nil

Remove phone number from phone pool Remove a phone number from a pool. If the number is leased from this pool the lease is released.

Parameters:

  • pool_id (String)
  • phone_number_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


2629
2630
2631
2632
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2629

def remove_phone_number_from_phone_pool(pool_id, phone_number_id, opts = {})
  remove_phone_number_from_phone_pool_with_http_info(pool_id, phone_number_id, opts)
  nil
end

#remove_phone_number_from_phone_pool_with_http_info(pool_id, phone_number_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove phone number from phone pool Remove a phone number from a pool. If the number is leased from this pool the lease is released.

Parameters:

  • pool_id (String)
  • phone_number_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2640

def remove_phone_number_from_phone_pool_with_http_info(pool_id, phone_number_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.remove_phone_number_from_phone_pool ...'
  end
  # verify the required parameter 'pool_id' is set
  if @api_client.config.client_side_validation && pool_id.nil?
    fail ArgumentError, "Missing the required parameter 'pool_id' when calling PhoneControllerApi.remove_phone_number_from_phone_pool"
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.remove_phone_number_from_phone_pool"
  end
  # resource path
  local_var_path = '/phone/pools/{poolId}/numbers/{phoneNumberId}'.sub('{' + 'poolId' + '}', CGI.escape(pool_id.to_s)).sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_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: PhoneControllerApi#remove_phone_number_from_phone_pool\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_available_phone_numbers(search_available_phone_numbers_options, opts = {}) ⇒ AvailablePhoneNumbersResult

Search available phone numbers Search available numbers for advanced provisioning

Parameters:

Returns:



2694
2695
2696
2697
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2694

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

#search_available_phone_numbers_with_http_info(search_available_phone_numbers_options, opts = {}) ⇒ Array<(AvailablePhoneNumbersResult, Integer, Hash)>

Search available phone numbers Search available numbers for advanced provisioning

Parameters:

Returns:

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

    AvailablePhoneNumbersResult data, response status code and response headers



2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2704

def search_available_phone_numbers_with_http_info(search_available_phone_numbers_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.search_available_phone_numbers ...'
  end
  # verify the required parameter 'search_available_phone_numbers_options' is set
  if @api_client.config.client_side_validation && search_available_phone_numbers_options.nil?
    fail ArgumentError, "Missing the required parameter 'search_available_phone_numbers_options' when calling PhoneControllerApi.search_available_phone_numbers"
  end
  # resource path
  local_var_path = '/phone/provisioning/search'

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

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

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

#send_sms_from_phone_number(phone_number_id, sms_send_options, opts = {}) ⇒ SentSmsDto

Send TXT message from a phone number Send SMS from a phone number

Parameters:

  • phone_number_id (String)
  • sms_send_options (SmsSendOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2759
2760
2761
2762
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2759

def send_sms_from_phone_number(phone_number_id, sms_send_options, opts = {})
  data, _status_code, _headers = send_sms_from_phone_number_with_http_info(phone_number_id, sms_send_options, opts)
  data
end

#send_sms_from_phone_number_with_http_info(phone_number_id, sms_send_options, opts = {}) ⇒ Array<(SentSmsDto, Integer, Hash)>

Send TXT message from a phone number Send SMS from a phone number

Parameters:

  • phone_number_id (String)
  • sms_send_options (SmsSendOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    SentSmsDto data, response status code and response headers



2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2770

def send_sms_from_phone_number_with_http_info(phone_number_id, sms_send_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.send_sms_from_phone_number ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.send_sms_from_phone_number"
  end
  # verify the required parameter 'sms_send_options' is set
  if @api_client.config.client_side_validation && sms_send_options.nil?
    fail ArgumentError, "Missing the required parameter 'sms_send_options' when calling PhoneControllerApi.send_sms_from_phone_number"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}/sms'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_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(sms_send_options) 

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

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

Set consent status Give or revoke consent for phone usage

Parameters:

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

    the optional parameters

Returns:



2828
2829
2830
2831
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2828

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

Set consent status Give or revoke consent for phone usage

Parameters:

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

    the optional parameters

Returns:

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

    ConsentStatusDto data, response status code and response headers



2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2838

def set_consent_status_with_http_info(agree, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.set_consent_status ...'
  end
  # verify the required parameter 'agree' is set
  if @api_client.config.client_side_validation && agree.nil?
    fail ArgumentError, "Missing the required parameter 'agree' when calling PhoneControllerApi.set_consent_status"
  end
  # resource path
  local_var_path = '/phone/consent'

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

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

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

#set_phone_favourited(phone_number_id, set_phone_favourited_options, opts = {}) ⇒ PhoneNumberDto

Set phone favourited state Set and return new favorite state for a phone

Parameters:

  • phone_number_id (String)

    ID of phone to set favourite state

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

    the optional parameters

Returns:



2892
2893
2894
2895
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2892

def set_phone_favourited(phone_number_id, set_phone_favourited_options, opts = {})
  data, _status_code, _headers = set_phone_favourited_with_http_info(phone_number_id, set_phone_favourited_options, opts)
  data
end

#set_phone_favourited_with_http_info(phone_number_id, set_phone_favourited_options, opts = {}) ⇒ Array<(PhoneNumberDto, Integer, Hash)>

Set phone favourited state Set and return new favorite state for a phone

Parameters:

  • phone_number_id (String)

    ID of phone to set favourite state

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

    the optional parameters

Returns:

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

    PhoneNumberDto data, response status code and response headers



2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2903

def set_phone_favourited_with_http_info(phone_number_id, set_phone_favourited_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.set_phone_favourited ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.set_phone_favourited"
  end
  # verify the required parameter 'set_phone_favourited_options' is set
  if @api_client.config.client_side_validation && set_phone_favourited_options.nil?
    fail ArgumentError, "Missing the required parameter 'set_phone_favourited_options' when calling PhoneControllerApi.set_phone_favourited"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}/favourite'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_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(set_phone_favourited_options) 

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

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

#test_phone_number_send_sms(phone_number_id, test_phone_number_options, opts = {}) ⇒ nil

Test sending an SMS to a number Test a phone number by sending an SMS to it. NOTE this is only for internal use to check that a phone number is working. For end-to-end phone testing see docs.mailslurp.com/txt-sms/

Parameters:

  • phone_number_id (String)
  • test_phone_number_options (TestPhoneNumberOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_test_id (String)

Returns:

  • (nil)


2963
2964
2965
2966
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2963

def test_phone_number_send_sms(phone_number_id, test_phone_number_options, opts = {})
  test_phone_number_send_sms_with_http_info(phone_number_id, test_phone_number_options, opts)
  nil
end

#test_phone_number_send_sms_with_http_info(phone_number_id, test_phone_number_options, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Test sending an SMS to a number Test a phone number by sending an SMS to it. NOTE this is only for internal use to check that a phone number is working. For end-to-end phone testing see docs.mailslurp.com/txt-sms/

Parameters:

  • phone_number_id (String)
  • test_phone_number_options (TestPhoneNumberOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_test_id (String)

Returns:

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

    nil, response status code and response headers



2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2975

def test_phone_number_send_sms_with_http_info(phone_number_id, test_phone_number_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.test_phone_number_send_sms ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.test_phone_number_send_sms"
  end
  # verify the required parameter 'test_phone_number_options' is set
  if @api_client.config.client_side_validation && test_phone_number_options.nil?
    fail ArgumentError, "Missing the required parameter 'test_phone_number_options' when calling PhoneControllerApi.test_phone_number_send_sms"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}/test'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'x-test-id'] = opts[:'x_test_id'] if !opts[:'x_test_id'].nil?

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

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

  # return_type
  return_type = opts[:return_type] 

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

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

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

#update_phone_number(phone_number_id, update_phone_number_options, opts = {}) ⇒ PhoneNumberDto

Update a phone number Set field for phone number

Parameters:

  • phone_number_id (String)

    ID of phone to set favourite state

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

    the optional parameters

Returns:



3033
3034
3035
3036
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3033

def update_phone_number(phone_number_id, update_phone_number_options, opts = {})
  data, _status_code, _headers = update_phone_number_with_http_info(phone_number_id, update_phone_number_options, opts)
  data
end

#update_phone_number_with_http_info(phone_number_id, update_phone_number_options, opts = {}) ⇒ Array<(PhoneNumberDto, Integer, Hash)>

Update a phone number Set field for phone number

Parameters:

  • phone_number_id (String)

    ID of phone to set favourite state

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

    the optional parameters

Returns:

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

    PhoneNumberDto data, response status code and response headers



3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3044

def update_phone_number_with_http_info(phone_number_id, update_phone_number_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.update_phone_number ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.update_phone_number"
  end
  # verify the required parameter 'update_phone_number_options' is set
  if @api_client.config.client_side_validation && update_phone_number_options.nil?
    fail ArgumentError, "Missing the required parameter 'update_phone_number_options' when calling PhoneControllerApi.update_phone_number"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_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_phone_number_options) 

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

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

#update_phone_pool(pool_id, update_phone_pool_options, opts = {}) ⇒ PhonePoolDetailDto

Update phone pool Update phone pool metadata such as name or description

Parameters:

  • pool_id (String)
  • update_phone_pool_options (UpdatePhonePoolOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3103
3104
3105
3106
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3103

def update_phone_pool(pool_id, update_phone_pool_options, opts = {})
  data, _status_code, _headers = update_phone_pool_with_http_info(pool_id, update_phone_pool_options, opts)
  data
end

#update_phone_pool_with_http_info(pool_id, update_phone_pool_options, opts = {}) ⇒ Array<(PhonePoolDetailDto, Integer, Hash)>

Update phone pool Update phone pool metadata such as name or description

Parameters:

  • pool_id (String)
  • update_phone_pool_options (UpdatePhonePoolOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    PhonePoolDetailDto data, response status code and response headers



3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3114

def update_phone_pool_with_http_info(pool_id, update_phone_pool_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.update_phone_pool ...'
  end
  # verify the required parameter 'pool_id' is set
  if @api_client.config.client_side_validation && pool_id.nil?
    fail ArgumentError, "Missing the required parameter 'pool_id' when calling PhoneControllerApi.update_phone_pool"
  end
  # verify the required parameter 'update_phone_pool_options' is set
  if @api_client.config.client_side_validation && update_phone_pool_options.nil?
    fail ArgumentError, "Missing the required parameter 'update_phone_pool_options' when calling PhoneControllerApi.update_phone_pool"
  end
  # resource path
  local_var_path = '/phone/pools/{poolId}'.sub('{' + 'poolId' + '}', CGI.escape(pool_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_phone_pool_options) 

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

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

#validate_phone_number(validate_phone_number_options, opts = {}) ⇒ PhoneNumberValidationDto

Verify validity of a phone number Validate a phone number

Parameters:

Returns:



3172
3173
3174
3175
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3172

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

#validate_phone_number_with_http_info(validate_phone_number_options, opts = {}) ⇒ Array<(PhoneNumberValidationDto, Integer, Hash)>

Verify validity of a phone number Validate a phone number

Parameters:

Returns:

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

    PhoneNumberValidationDto data, response status code and response headers



3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3182

def validate_phone_number_with_http_info(validate_phone_number_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.validate_phone_number ...'
  end
  # verify the required parameter 'validate_phone_number_options' is set
  if @api_client.config.client_side_validation && validate_phone_number_options.nil?
    fail ArgumentError, "Missing the required parameter 'validate_phone_number_options' when calling PhoneControllerApi.validate_phone_number"
  end
  # resource path
  local_var_path = '/phone/validate'

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

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

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