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_number_tags(phone_number_id, phone_number_tags_options, opts = {}) ⇒ PhoneNumberDto

Add phone number tags Add one or more tags to a phone number

Parameters:

  • phone_number_id (String)
  • phone_number_tags_options (PhoneNumberTagsOptions)
  • 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_number_tags(phone_number_id, phone_number_tags_options, opts = {})
  data, _status_code, _headers = add_phone_number_tags_with_http_info(phone_number_id, phone_number_tags_options, opts)
  data
end

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

Add phone number tags Add one or more tags to a phone number

Parameters:

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

    the optional parameters

Returns:

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

    PhoneNumberDto 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_number_tags_with_http_info(phone_number_id, phone_number_tags_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.add_phone_number_tags ...'
  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.add_phone_number_tags"
  end
  # verify the required parameter 'phone_number_tags_options' is set
  if @api_client.config.client_side_validation && phone_number_tags_options.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_tags_options' when calling PhoneControllerApi.add_phone_number_tags"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}/tags'.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(phone_number_tags_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#add_phone_number_tags\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:



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

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



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
287
288
289
290
291
292
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 241

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:



299
300
301
302
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 299

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



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 309

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:



363
364
365
366
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 363

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



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

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:



427
428
429
430
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 427

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



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
479
480
481
482
483
484
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 437

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:



491
492
493
494
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 491

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



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
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 501

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)


554
555
556
557
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 554

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



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
595
596
597
598
599
600
601
602
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 563

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:



609
610
611
612
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 609

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



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

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:



672
673
674
675
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 672

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



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

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)


739
740
741
742
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 739

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



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

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)


799
800
801
802
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 799

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



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
845
846
847
848
849
850
851
852
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 809

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:



860
861
862
863
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 860

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:



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

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:



923
924
925
926
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 923

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:



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
970
971
972
973
974
975
976
977
978
979
980
981
982
983
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 935

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:



989
990
991
992
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 989

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



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
1032
1033
1034
1035
1036
1037
1038
1039
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 998

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:



1046
1047
1048
1049
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1046

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



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
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1056

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:



1107
1108
1109
1110
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1107

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 data, response status code and response headers



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
1152
1153
1154
1155
1156
1157
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1116

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:



1164
1165
1166
1167
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1164

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



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

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:



1231
1232
1233
1234
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1231

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:



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

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:



1304
1305
1306
1307
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1304

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:



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
1356
1357
1358
1359
1360
1361
1362
1363
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1316

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:



1370
1371
1372
1373
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1370

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:



1432
1433
1434
1435
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1432

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



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
1482
1483
1484
1485
1486
1487
1488
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1442

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:



1495
1496
1497
1498
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1495

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



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
1546
1547
1548
1549
1550
1551
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1505

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:



1558
1559
1560
1561
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1558

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:



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
1608
1609
1610
1611
1612
1613
1614
1615
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1568

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:



1622
1623
1624
1625
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1622

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:



1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
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
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1632

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_tags(phone_number_id, opts = {}) ⇒ Array<String>

Get phone number tags Get tags for a specific phone number

Parameters:

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

    the optional parameters

Returns:

  • (Array<String>)


1684
1685
1686
1687
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1684

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

#get_phone_number_tags_with_http_info(phone_number_id, opts = {}) ⇒ Array<(Array<String>, Integer, Hash)>

Get phone number tags Get tags for a specific phone number

Parameters:

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

    the optional parameters

Returns:

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

    Array data, response status code and response headers



1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1694

def get_phone_number_tags_with_http_info(phone_number_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_number_tags ...'
  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_tags"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}/tags'.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] || 'Array<String>' 

  # 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_tags\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



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
1419
1420
1421
1422
1423
1424
1425
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1380

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

  • :tag (Array<String>)

    Optional tags to filter by. A phone must include all provided tags

  • :include (Array<String>)

    Optional phoneIds to include in result

  • :favourite (Boolean)

    Optionally filter results for favourites only (default to false)

Returns:



1760
1761
1762
1763
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1760

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

  • :tag (Array<String>)

    Optional tags to filter by. A phone must include all provided tags

  • :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



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
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1784

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[:'tag'] = @api_client.build_collection_param(opts[:'tag'], :multi) if !opts[:'tag'].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:



1854
1855
1856
1857
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1854

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:



1909
1910
1911
1912
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1909

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



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
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1917

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 data, response status code and response headers



1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1863

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:



1965
1966
1967
1968
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1965

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:



2027
2028
2029
2030
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2027

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



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
2076
2077
2078
2079
2080
2081
2082
2083
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2037

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



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
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1975

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:



2089
2090
2091
2092
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2089

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 data, response status code and response headers



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

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:



2147
2148
2149
2150
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2147

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:



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
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2158

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:



2217
2218
2219
2220
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2217

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



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
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2227

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:



2279
2280
2281
2282
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2279

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



2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2289

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:



2340
2341
2342
2343
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2340

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



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

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:



2396
2397
2398
2399
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2396

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



2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2405

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_phone_tags(opts = {}) ⇒ Array<String>

Get phone tags List all unique tags used by your phone numbers

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Optional search filter

Returns:

  • (Array<String>)


2453
2454
2455
2456
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2453

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

#get_phone_tags_with_http_info(opts = {}) ⇒ Array<(Array<String>, Integer, Hash)>

Get phone tags List all unique tags used by your phone numbers

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Optional search filter

Returns:

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

    Array data, response status code and response headers



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
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2463

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

  # query parameters
  query_params = opts[:query_params] || {}
  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] || 'Array<String>' 

  # 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_tags\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:



2518
2519
2520
2521
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2518

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



2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2534

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:



2608
2609
2610
2611
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2608

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



2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
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 2626

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:



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

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



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

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)


2757
2758
2759
2760
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2757

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



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

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)


2823
2824
2825
2826
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2823

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



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

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

#remove_phone_number_tags(phone_number_id, phone_number_tags_options, opts = {}) ⇒ PhoneNumberDto

Remove phone number tags Remove one or more tags from a phone number

Parameters:

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

    the optional parameters

Returns:



2889
2890
2891
2892
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2889

def remove_phone_number_tags(phone_number_id, phone_number_tags_options, opts = {})
  data, _status_code, _headers = remove_phone_number_tags_with_http_info(phone_number_id, phone_number_tags_options, opts)
  data
end

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

Remove phone number tags Remove one or more tags from a phone number

Parameters:

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

    the optional parameters

Returns:

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

    PhoneNumberDto data, response status code and response headers



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

def remove_phone_number_tags_with_http_info(phone_number_id, phone_number_tags_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.remove_phone_number_tags ...'
  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_tags"
  end
  # verify the required parameter 'phone_number_tags_options' is set
  if @api_client.config.client_side_validation && phone_number_tags_options.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_tags_options' when calling PhoneControllerApi.remove_phone_number_tags"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}/tags'.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(phone_number_tags_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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneControllerApi#remove_phone_number_tags\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:



2958
2959
2960
2961
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2958

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



2968
2969
2970
2971
2972
2973
2974
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
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 2968

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:



3023
3024
3025
3026
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3023

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



3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
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
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3034

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:



3092
3093
3094
3095
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3092

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



3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
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
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3102

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:



3156
3157
3158
3159
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3156

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



3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
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
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3167

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

#set_phone_number_tags(phone_number_id, phone_number_tags_options, opts = {}) ⇒ PhoneNumberDto

Set phone number tags Replace all tags on a phone number

Parameters:

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

    the optional parameters

Returns:



3226
3227
3228
3229
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3226

def set_phone_number_tags(phone_number_id, phone_number_tags_options, opts = {})
  data, _status_code, _headers = set_phone_number_tags_with_http_info(phone_number_id, phone_number_tags_options, opts)
  data
end

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

Set phone number tags Replace all tags on a phone number

Parameters:

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

    the optional parameters

Returns:

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

    PhoneNumberDto data, response status code and response headers



3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3237

def set_phone_number_tags_with_http_info(phone_number_id, phone_number_tags_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneControllerApi.set_phone_number_tags ...'
  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_number_tags"
  end
  # verify the required parameter 'phone_number_tags_options' is set
  if @api_client.config.client_side_validation && phone_number_tags_options.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_tags_options' when calling PhoneControllerApi.set_phone_number_tags"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}/tags'.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(phone_number_tags_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_number_tags\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 https://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)


3297
3298
3299
3300
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3297

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 https://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



3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3309

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:



3367
3368
3369
3370
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3367

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



3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3378

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:



3437
3438
3439
3440
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3437

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



3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3448

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:



3506
3507
3508
3509
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3506

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



3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 3516

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