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

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

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

Parameters:

Returns:



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

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



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 37

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:



91
92
93
94
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 91

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



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 101

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

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



155
156
157
158
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 155

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



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 165

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_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)


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

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



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 227

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

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



278
279
280
281
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 278

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:



289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 289

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 consent status Get the status of phone usage consent

Parameters:

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

    the optional parameters

Returns:



338
339
340
341
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 338

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



347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 347

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:



395
396
397
398
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 395

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



405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 405

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:



456
457
458
459
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 456

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

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

Get emergency addresses List emergency addresses

Parameters:

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

    the optional parameters

Returns:

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

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



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

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



516
517
518
519
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 516

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:



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

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:



589
590
591
592
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 589

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:



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

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:



655
656
657
658
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 655

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:



717
718
719
720
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 717

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



727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 727

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:



780
781
782
783
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 780

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



790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 790

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_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



665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 665

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

  • :page (Integer)

    Optional page index for list pagination (default to 0)

  • :size (Integer)

    Optional page size for list pagination (default to 20)

  • :sort (String)

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

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :search (String)

    Optional search filter

  • :include (Array<String>)

    Optional phoneIds to include in result

  • :favourite (Boolean)

    Optionally filter results for favourites only (default to false)

Returns:



851
852
853
854
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 851

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

  • :page (Integer)

    Optional page index for list pagination

  • :size (Integer)

    Optional page size for list pagination

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :search (String)

    Optional search filter

  • :include (Array<String>)

    Optional phoneIds to include in result

  • :favourite (Boolean)

    Optionally filter results for favourites only

Returns:

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

    PagePhoneNumberProjection data, response status code and response headers



869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 869

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", "CH", "PT", "NL", "IL", "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[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :multi) if !opts[:'include'].nil?
  query_params[:'favourite'] = opts[:'favourite'] if !opts[:'favourite'].nil?

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

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

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

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

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

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

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

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

Get phone plans Get phone number plans

Parameters:

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

    the optional parameters

Returns:



933
934
935
936
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 933

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:



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

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



996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 996

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

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

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

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

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

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

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

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

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

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

Get phone plans Get phone number plans

Parameters:

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

    the optional parameters

Returns:

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

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



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 942

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



1050
1051
1052
1053
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1050

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



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
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1066

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:



1140
1141
1142
1143
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1140

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



1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
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
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1158

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

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



1227
1228
1229
1230
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1227

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



1238
1239
1240
1241
1242
1243
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
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1238

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:



1296
1297
1298
1299
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1296

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



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

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:



1360
1361
1362
1363
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1360

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



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

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

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

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

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

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

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

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

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

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

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

Test sending an SMS to a number Test a phone number by sending an SMS to it

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)


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

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

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



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
1489
1490
1491
1492
1493
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1443

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:



1501
1502
1503
1504
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1501

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



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
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1512

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

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

Verify validity of a phone number Validate a phone number

Parameters:

Returns:



1570
1571
1572
1573
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1570

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



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
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
# File 'lib/mailslurp_client/api/phone_controller_api.rb', line 1580

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