twilio-ruby 5.33.0 → 5.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -0
  3. data/.rubocop_todo.yml +5 -26
  4. data/.travis.yml +9 -1
  5. data/CHANGES.md +110 -0
  6. data/README.md +17 -2
  7. data/lib/twilio-ruby.rb +4 -12
  8. data/lib/twilio-ruby/framework/error.rb +3 -3
  9. data/lib/twilio-ruby/jwt/jwt.rb +6 -0
  10. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +90 -90
  11. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +14 -0
  12. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +75 -72
  13. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +29 -29
  14. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +38 -3
  15. data/lib/twilio-ruby/rest/autopilot.rb +6 -0
  16. data/lib/twilio-ruby/rest/autopilot/v1.rb +7 -0
  17. data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +198 -0
  18. data/lib/twilio-ruby/rest/client.rb +35 -8
  19. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +19 -3
  20. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +27 -4
  21. data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +2 -1
  22. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
  23. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +20 -11
  24. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +26 -0
  25. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +324 -0
  26. data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +26 -0
  27. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb +239 -0
  28. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +266 -0
  29. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +197 -0
  30. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +7 -0
  31. data/lib/twilio-ruby/rest/studio.rb +2 -2
  32. data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +26 -0
  33. data/lib/twilio-ruby/rest/studio/v2.rb +3 -3
  34. data/lib/twilio-ruby/rest/studio/v2/flow.rb +7 -0
  35. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +71 -24
  36. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +12 -11
  37. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +21 -20
  38. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +18 -15
  39. data/lib/twilio-ruby/rest/supersim.rb +18 -0
  40. data/lib/twilio-ruby/rest/supersim/v1.rb +30 -0
  41. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +53 -10
  42. data/lib/twilio-ruby/rest/supersim/v1/network.rb +315 -0
  43. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +378 -0
  44. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +352 -0
  45. data/lib/twilio-ruby/rest/verify.rb +9 -0
  46. data/lib/twilio-ruby/rest/verify/v2.rb +16 -0
  47. data/lib/twilio-ruby/rest/verify/v2/form.rb +197 -0
  48. data/lib/twilio-ruby/rest/verify/v2/service.rb +48 -3
  49. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +379 -0
  50. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +500 -0
  51. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor/challenge.rb +494 -0
  52. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -3
  53. data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +8 -12
  54. data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +8 -12
  55. data/lib/twilio-ruby/rest/voice.rb +36 -0
  56. data/lib/twilio-ruby/rest/voice/v1.rb +64 -0
  57. data/lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb +513 -0
  58. data/lib/twilio-ruby/rest/voice/v1/connection_policy.rb +379 -0
  59. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +458 -0
  60. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +366 -0
  61. data/lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb +346 -0
  62. data/lib/twilio-ruby/twiml/twiml.rb +4 -0
  63. data/lib/twilio-ruby/twiml/voice_response.rb +3 -2
  64. data/lib/twilio-ruby/util/configuration.rb +9 -1
  65. data/lib/twilio-ruby/version.rb +1 -1
  66. data/spec/integration/api/v2010/account/call_spec.rb +5 -5
  67. data/spec/integration/api/v2010/account/conference_spec.rb +42 -14
  68. data/spec/integration/api/v2010/account/sip/domain_spec.rb +12 -4
  69. data/spec/integration/api/v2010/account/token_spec.rb +23 -11
  70. data/spec/integration/autopilot/v1/restore_assistant_spec.rb +53 -0
  71. data/spec/integration/bulkexports/v1/export/day_spec.rb +1 -1
  72. data/spec/integration/conversations/v1/conversation/participant_spec.rb +7 -0
  73. data/spec/integration/conversations/v1/conversation_spec.rb +4 -0
  74. data/spec/integration/flex_api/v1/configuration_spec.rb +3 -0
  75. data/spec/integration/numbers/v2/regulatory_compliance/bundle/evaluation_spec.rb +623 -0
  76. data/spec/integration/numbers/v2/regulatory_compliance/bundle_spec.rb +4 -0
  77. data/spec/integration/preview/bulk_exports/export/day_spec.rb +1 -1
  78. data/spec/integration/preview/trusted_comms/business/brand/branded_channel/channel_spec.rb +54 -0
  79. data/spec/integration/preview/trusted_comms/business/brand/branded_channel_spec.rb +52 -0
  80. data/spec/integration/preview/trusted_comms/business/brand_spec.rb +49 -0
  81. data/spec/integration/preview/trusted_comms/business_spec.rb +1 -0
  82. data/spec/integration/serverless/v1/service/asset/asset_version_spec.rb +1 -1
  83. data/spec/integration/serverless/v1/service/build_spec.rb +4 -4
  84. data/spec/integration/serverless/v1/service/environment/log_spec.rb +1 -0
  85. data/spec/integration/serverless/v1/service/function/function_version_spec.rb +1 -1
  86. data/spec/integration/studio/v1/flow/execution_spec.rb +46 -0
  87. data/spec/integration/studio/v2/flow/execution_spec.rb +45 -0
  88. data/spec/integration/studio/v2/flow_spec.rb +4 -0
  89. data/spec/integration/studio/v2/flow_validate_spec.rb +2 -2
  90. data/spec/integration/supersim/v1/fleet_spec.rb +12 -4
  91. data/spec/integration/supersim/v1/network_access_profile/network_access_profile_network_spec.rb +179 -0
  92. data/spec/integration/supersim/v1/network_access_profile_spec.rb +223 -0
  93. data/spec/integration/supersim/v1/network_spec.rb +139 -0
  94. data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +13 -13
  95. data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +23 -23
  96. data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +28 -28
  97. data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +17 -17
  98. data/spec/integration/trunking/v1/trunk_spec.rb +33 -33
  99. data/spec/integration/verify/v2/form_spec.rb +48 -0
  100. data/spec/integration/verify/v2/service/entity/factor/challenge_spec.rb +353 -0
  101. data/spec/integration/verify/v2/service/entity/factor_spec.rb +298 -0
  102. data/spec/integration/verify/v2/service/entity_spec.rb +201 -0
  103. data/spec/integration/verify/v2/service_spec.rb +28 -4
  104. data/spec/integration/video/v1/composition_settings_spec.rb +2 -2
  105. data/spec/integration/video/v1/recording_settings_spec.rb +2 -2
  106. data/spec/integration/video/v1/recording_spec.rb +2 -2
  107. data/spec/integration/video/v1/room/recording_spec.rb +2 -2
  108. data/spec/integration/voice/v1/byoc_trunk_spec.rb +250 -0
  109. data/spec/integration/voice/v1/connection_policy/connection_policy_target_spec.rb +246 -0
  110. data/spec/integration/voice/v1/connection_policy_spec.rb +226 -0
  111. data/spec/integration/voice/v1/ip_record_spec.rb +223 -0
  112. data/spec/integration/voice/v1/source_ip_mapping_spec.rb +219 -0
  113. data/spec/rest/client_spec.rb +173 -23
  114. data/spec/util/configuration_spec.rb +12 -0
  115. data/twilio-ruby.gemspec +4 -4
  116. metadata +67 -10
@@ -363,6 +363,8 @@ module Twilio
363
363
  'status' => payload['status'],
364
364
  'uri' => payload['uri'],
365
365
  'subresource_uris' => payload['subresource_uris'],
366
+ 'reason_conference_ended' => payload['reason_conference_ended'],
367
+ 'call_sid_ending_conference' => payload['call_sid_ending_conference'],
366
368
  }
367
369
 
368
370
  # Context
@@ -441,6 +443,18 @@ module Twilio
441
443
  @properties['subresource_uris']
442
444
  end
443
445
 
446
+ ##
447
+ # @return [conference.ReasonConferenceEnded] The reason why a conference ended.
448
+ def reason_conference_ended
449
+ @properties['reason_conference_ended']
450
+ end
451
+
452
+ ##
453
+ # @return [String] The call SID that caused the conference to end
454
+ def call_sid_ending_conference
455
+ @properties['call_sid_ending_conference']
456
+ end
457
+
444
458
  ##
445
459
  # Fetch a ConferenceInstance
446
460
  # @return [ConferenceInstance] Fetched ConferenceInstance
@@ -63,6 +63,8 @@ module Twilio
63
63
  # action and you intend to confirm delivery of the message using the [Message
64
64
  # Feedback API](https://www.twilio.com/docs/sms/api/message-feedback-resource).
65
65
  # This parameter is `false` by default.
66
+ # @param [String] attempt Total number of attempts made ( including this ) to send
67
+ # out the message regardless of the provider used
66
68
  # @param [String] validity_period How long in seconds the message can remain in
67
69
  # our outgoing message queue. After this period elapses, the message fails and we
68
70
  # call your status callback. Can be between 1 and the default value of 14,400
@@ -100,7 +102,7 @@ module Twilio
100
102
  # parameters in the POST request. You can include up to 10 `media_url` parameters
101
103
  # per message. You can send images in an SMS message in only the US and Canada.
102
104
  # @return [MessageInstance] Newly created MessageInstance
103
- def create(to: nil, status_callback: :unset, application_sid: :unset, max_price: :unset, provide_feedback: :unset, validity_period: :unset, force_delivery: :unset, content_retention: :unset, address_retention: :unset, smart_encoded: :unset, persistent_action: :unset, from: :unset, messaging_service_sid: :unset, body: :unset, media_url: :unset)
105
+ def create(to: nil, status_callback: :unset, application_sid: :unset, max_price: :unset, provide_feedback: :unset, attempt: :unset, validity_period: :unset, force_delivery: :unset, content_retention: :unset, address_retention: :unset, smart_encoded: :unset, persistent_action: :unset, from: :unset, messaging_service_sid: :unset, body: :unset, media_url: :unset)
104
106
  data = Twilio::Values.of({
105
107
  'To' => to,
106
108
  'From' => from,
@@ -111,6 +113,7 @@ module Twilio
111
113
  'ApplicationSid' => application_sid,
112
114
  'MaxPrice' => max_price,
113
115
  'ProvideFeedback' => provide_feedback,
116
+ 'Attempt' => attempt,
114
117
  'ValidityPeriod' => validity_period,
115
118
  'ForceDelivery' => force_delivery,
116
119
  'ContentRetention' => content_retention,
@@ -410,26 +413,26 @@ module Twilio
410
413
 
411
414
  # Marshaled Properties
412
415
  @properties = {
413
- 'account_sid' => payload['account_sid'],
414
- 'api_version' => payload['api_version'],
415
416
  'body' => payload['body'],
416
- 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
417
- 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
418
- 'date_sent' => Twilio.deserialize_rfc2822(payload['date_sent']),
417
+ 'num_segments' => payload['num_segments'],
419
418
  'direction' => payload['direction'],
420
- 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
421
- 'error_message' => payload['error_message'],
422
419
  'from' => payload['from'],
423
- 'messaging_service_sid' => payload['messaging_service_sid'],
424
- 'num_media' => payload['num_media'],
425
- 'num_segments' => payload['num_segments'],
420
+ 'to' => payload['to'],
421
+ 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
426
422
  'price' => payload['price'],
427
- 'price_unit' => payload['price_unit'],
428
- 'sid' => payload['sid'],
423
+ 'error_message' => payload['error_message'],
424
+ 'uri' => payload['uri'],
425
+ 'account_sid' => payload['account_sid'],
426
+ 'num_media' => payload['num_media'],
429
427
  'status' => payload['status'],
428
+ 'messaging_service_sid' => payload['messaging_service_sid'],
429
+ 'sid' => payload['sid'],
430
+ 'date_sent' => Twilio.deserialize_rfc2822(payload['date_sent']),
431
+ 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
432
+ 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
433
+ 'price_unit' => payload['price_unit'],
434
+ 'api_version' => payload['api_version'],
430
435
  'subresource_uris' => payload['subresource_uris'],
431
- 'to' => payload['to'],
432
- 'uri' => payload['uri'],
433
436
  }
434
437
 
435
438
  # Context
@@ -448,18 +451,6 @@ module Twilio
448
451
  @instance_context
449
452
  end
450
453
 
451
- ##
452
- # @return [String] The SID of the Account that created the resource
453
- def account_sid
454
- @properties['account_sid']
455
- end
456
-
457
- ##
458
- # @return [String] The API version used to process the message
459
- def api_version
460
- @properties['api_version']
461
- end
462
-
463
454
  ##
464
455
  # @return [String] The message text
465
456
  def body
@@ -467,33 +458,39 @@ module Twilio
467
458
  end
468
459
 
469
460
  ##
470
- # @return [Time] The RFC 2822 date and time in GMT that the resource was created
471
- def date_created
472
- @properties['date_created']
461
+ # @return [String] The number of messages used to deliver the message body
462
+ def num_segments
463
+ @properties['num_segments']
473
464
  end
474
465
 
475
466
  ##
476
- # @return [Time] The RFC 2822 date and time in GMT that the resource was last updated
477
- def date_updated
478
- @properties['date_updated']
467
+ # @return [message.Direction] The direction of the message
468
+ def direction
469
+ @properties['direction']
479
470
  end
480
471
 
481
472
  ##
482
- # @return [Time] The RFC 2822 date and time in GMT when the message was sent
483
- def date_sent
484
- @properties['date_sent']
473
+ # @return [String] The phone number that initiated the message
474
+ def from
475
+ @properties['from']
485
476
  end
486
477
 
487
478
  ##
488
- # @return [message.Direction] The direction of the message
489
- def direction
490
- @properties['direction']
479
+ # @return [String] The phone number that received the message
480
+ def to
481
+ @properties['to']
491
482
  end
492
483
 
493
484
  ##
494
- # @return [String] The error code associated with the message
495
- def error_code
496
- @properties['error_code']
485
+ # @return [Time] The RFC 2822 date and time in GMT that the resource was last updated
486
+ def date_updated
487
+ @properties['date_updated']
488
+ end
489
+
490
+ ##
491
+ # @return [String] The amount billed for the message
492
+ def price
493
+ @properties['price']
497
494
  end
498
495
 
499
496
  ##
@@ -503,15 +500,15 @@ module Twilio
503
500
  end
504
501
 
505
502
  ##
506
- # @return [String] The phone number that initiated the message
507
- def from
508
- @properties['from']
503
+ # @return [String] The URI of the resource, relative to `https://api.twilio.com`
504
+ def uri
505
+ @properties['uri']
509
506
  end
510
507
 
511
508
  ##
512
- # @return [String] The SID of the Messaging Service used with the message.
513
- def messaging_service_sid
514
- @properties['messaging_service_sid']
509
+ # @return [String] The SID of the Account that created the resource
510
+ def account_sid
511
+ @properties['account_sid']
515
512
  end
516
513
 
517
514
  ##
@@ -521,21 +518,15 @@ module Twilio
521
518
  end
522
519
 
523
520
  ##
524
- # @return [String] The number of messages used to deliver the message body
525
- def num_segments
526
- @properties['num_segments']
527
- end
528
-
529
- ##
530
- # @return [String] The amount billed for the message
531
- def price
532
- @properties['price']
521
+ # @return [message.Status] The status of the message
522
+ def status
523
+ @properties['status']
533
524
  end
534
525
 
535
526
  ##
536
- # @return [String] The currency in which price is measured
537
- def price_unit
538
- @properties['price_unit']
527
+ # @return [String] The SID of the Messaging Service used with the message.
528
+ def messaging_service_sid
529
+ @properties['messaging_service_sid']
539
530
  end
540
531
 
541
532
  ##
@@ -545,27 +536,39 @@ module Twilio
545
536
  end
546
537
 
547
538
  ##
548
- # @return [message.Status] The status of the message
549
- def status
550
- @properties['status']
539
+ # @return [Time] The RFC 2822 date and time in GMT when the message was sent
540
+ def date_sent
541
+ @properties['date_sent']
551
542
  end
552
543
 
553
544
  ##
554
- # @return [String] A list of related resources identified by their relative URIs
555
- def subresource_uris
556
- @properties['subresource_uris']
545
+ # @return [Time] The RFC 2822 date and time in GMT that the resource was created
546
+ def date_created
547
+ @properties['date_created']
557
548
  end
558
549
 
559
550
  ##
560
- # @return [String] The phone number that received the message
561
- def to
562
- @properties['to']
551
+ # @return [String] The error code associated with the message
552
+ def error_code
553
+ @properties['error_code']
563
554
  end
564
555
 
565
556
  ##
566
- # @return [String] The URI of the resource, relative to `https://api.twilio.com`
567
- def uri
568
- @properties['uri']
557
+ # @return [String] The currency in which price is measured
558
+ def price_unit
559
+ @properties['price_unit']
560
+ end
561
+
562
+ ##
563
+ # @return [String] The API version used to process the message
564
+ def api_version
565
+ @properties['api_version']
566
+ end
567
+
568
+ ##
569
+ # @return [String] A list of related resources identified by their relative URIs
570
+ def subresource_uris
571
+ @properties['subresource_uris']
569
572
  end
570
573
 
571
574
  ##
@@ -280,15 +280,15 @@ module Twilio
280
280
 
281
281
  # Marshaled Properties
282
282
  @properties = {
283
+ 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
284
+ 'current_size' => payload['current_size'].to_i,
285
+ 'friendly_name' => payload['friendly_name'],
286
+ 'uri' => payload['uri'],
283
287
  'account_sid' => payload['account_sid'],
284
288
  'average_wait_time' => payload['average_wait_time'].to_i,
285
- 'current_size' => payload['current_size'].to_i,
289
+ 'sid' => payload['sid'],
286
290
  'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
287
- 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
288
- 'friendly_name' => payload['friendly_name'],
289
291
  'max_size' => payload['max_size'].to_i,
290
- 'sid' => payload['sid'],
291
- 'uri' => payload['uri'],
292
292
  }
293
293
 
294
294
  # Context
@@ -308,15 +308,9 @@ module Twilio
308
308
  end
309
309
 
310
310
  ##
311
- # @return [String] The SID of the Account that created this resource
312
- def account_sid
313
- @properties['account_sid']
314
- end
315
-
316
- ##
317
- # @return [String] Average wait time of members in the queue
318
- def average_wait_time
319
- @properties['average_wait_time']
311
+ # @return [Time] The RFC 2822 date and time in GMT that this resource was last updated
312
+ def date_updated
313
+ @properties['date_updated']
320
314
  end
321
315
 
322
316
  ##
@@ -326,27 +320,27 @@ module Twilio
326
320
  end
327
321
 
328
322
  ##
329
- # @return [Time] The RFC 2822 date and time in GMT that this resource was created
330
- def date_created
331
- @properties['date_created']
323
+ # @return [String] A string that you assigned to describe this resource
324
+ def friendly_name
325
+ @properties['friendly_name']
332
326
  end
333
327
 
334
328
  ##
335
- # @return [Time] The RFC 2822 date and time in GMT that this resource was last updated
336
- def date_updated
337
- @properties['date_updated']
329
+ # @return [String] The URI of this resource, relative to `https://api.twilio.com`
330
+ def uri
331
+ @properties['uri']
338
332
  end
339
333
 
340
334
  ##
341
- # @return [String] A string that you assigned to describe this resource
342
- def friendly_name
343
- @properties['friendly_name']
335
+ # @return [String] The SID of the Account that created this resource
336
+ def account_sid
337
+ @properties['account_sid']
344
338
  end
345
339
 
346
340
  ##
347
- # @return [String] The max number of calls allowed in the queue
348
- def max_size
349
- @properties['max_size']
341
+ # @return [String] Average wait time of members in the queue
342
+ def average_wait_time
343
+ @properties['average_wait_time']
350
344
  end
351
345
 
352
346
  ##
@@ -356,9 +350,15 @@ module Twilio
356
350
  end
357
351
 
358
352
  ##
359
- # @return [String] The URI of this resource, relative to `https://api.twilio.com`
360
- def uri
361
- @properties['uri']
353
+ # @return [Time] The RFC 2822 date and time in GMT that this resource was created
354
+ def date_created
355
+ @properties['date_created']
356
+ end
357
+
358
+ ##
359
+ # @return [String] The max number of calls allowed in the queue
360
+ def max_size
361
+ @properties['max_size']
362
362
  end
363
363
 
364
364
  ##
@@ -136,8 +136,13 @@ module Twilio
136
136
  # @param [Boolean] secure Whether secure SIP is enabled for the domain. If
137
137
  # enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls
138
138
  # to this sip domain.
139
+ # @param [String] byoc_trunk_sid The SID of the BYOC Trunk(Bring Your Own Carrier)
140
+ # resource that the Sip Domain will be associated with.
141
+ # @param [String] emergency_caller_sid Whether an emergency caller sid is
142
+ # configured for the domain. If present, this phone number will be used as the
143
+ # callback for the emergency call.
139
144
  # @return [DomainInstance] Newly created DomainInstance
140
- def create(domain_name: nil, friendly_name: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, voice_status_callback_url: :unset, voice_status_callback_method: :unset, sip_registration: :unset, emergency_calling_enabled: :unset, secure: :unset)
145
+ def create(domain_name: nil, friendly_name: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, voice_status_callback_url: :unset, voice_status_callback_method: :unset, sip_registration: :unset, emergency_calling_enabled: :unset, secure: :unset, byoc_trunk_sid: :unset, emergency_caller_sid: :unset)
141
146
  data = Twilio::Values.of({
142
147
  'DomainName' => domain_name,
143
148
  'FriendlyName' => friendly_name,
@@ -150,6 +155,8 @@ module Twilio
150
155
  'SipRegistration' => sip_registration,
151
156
  'EmergencyCallingEnabled' => emergency_calling_enabled,
152
157
  'Secure' => secure,
158
+ 'ByocTrunkSid' => byoc_trunk_sid,
159
+ 'EmergencyCallerSid' => emergency_caller_sid,
153
160
  })
154
161
 
155
162
  payload = @version.create(
@@ -261,8 +268,13 @@ module Twilio
261
268
  # @param [Boolean] secure Whether secure SIP is enabled for the domain. If
262
269
  # enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls
263
270
  # to this sip domain.
271
+ # @param [String] byoc_trunk_sid The SID of the BYOC Trunk(Bring Your Own Carrier)
272
+ # resource that the Sip Domain will be associated with.
273
+ # @param [String] emergency_caller_sid Whether an emergency caller sid is
274
+ # configured for the domain. If present, this phone number will be used as the
275
+ # callback for the emergency call.
264
276
  # @return [DomainInstance] Updated DomainInstance
265
- def update(friendly_name: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_status_callback_method: :unset, voice_status_callback_url: :unset, voice_url: :unset, sip_registration: :unset, domain_name: :unset, emergency_calling_enabled: :unset, secure: :unset)
277
+ def update(friendly_name: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_status_callback_method: :unset, voice_status_callback_url: :unset, voice_url: :unset, sip_registration: :unset, domain_name: :unset, emergency_calling_enabled: :unset, secure: :unset, byoc_trunk_sid: :unset, emergency_caller_sid: :unset)
266
278
  data = Twilio::Values.of({
267
279
  'FriendlyName' => friendly_name,
268
280
  'VoiceFallbackMethod' => voice_fallback_method,
@@ -275,6 +287,8 @@ module Twilio
275
287
  'DomainName' => domain_name,
276
288
  'EmergencyCallingEnabled' => emergency_calling_enabled,
277
289
  'Secure' => secure,
290
+ 'ByocTrunkSid' => byoc_trunk_sid,
291
+ 'EmergencyCallerSid' => emergency_caller_sid,
278
292
  })
279
293
 
280
294
  payload = @version.update(
@@ -407,6 +421,8 @@ module Twilio
407
421
  'sip_registration' => payload['sip_registration'],
408
422
  'emergency_calling_enabled' => payload['emergency_calling_enabled'],
409
423
  'secure' => payload['secure'],
424
+ 'byoc_trunk_sid' => payload['byoc_trunk_sid'],
425
+ 'emergency_caller_sid' => payload['emergency_caller_sid'],
410
426
  }
411
427
 
412
428
  # Context
@@ -539,6 +555,18 @@ module Twilio
539
555
  @properties['secure']
540
556
  end
541
557
 
558
+ ##
559
+ # @return [String] The SID of the BYOC Trunk resource.
560
+ def byoc_trunk_sid
561
+ @properties['byoc_trunk_sid']
562
+ end
563
+
564
+ ##
565
+ # @return [String] Whether an emergency caller sid is configured for the domain.
566
+ def emergency_caller_sid
567
+ @properties['emergency_caller_sid']
568
+ end
569
+
542
570
  ##
543
571
  # Fetch a DomainInstance
544
572
  # @return [DomainInstance] Fetched DomainInstance
@@ -572,8 +600,13 @@ module Twilio
572
600
  # @param [Boolean] secure Whether secure SIP is enabled for the domain. If
573
601
  # enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls
574
602
  # to this sip domain.
603
+ # @param [String] byoc_trunk_sid The SID of the BYOC Trunk(Bring Your Own Carrier)
604
+ # resource that the Sip Domain will be associated with.
605
+ # @param [String] emergency_caller_sid Whether an emergency caller sid is
606
+ # configured for the domain. If present, this phone number will be used as the
607
+ # callback for the emergency call.
575
608
  # @return [DomainInstance] Updated DomainInstance
576
- def update(friendly_name: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_status_callback_method: :unset, voice_status_callback_url: :unset, voice_url: :unset, sip_registration: :unset, domain_name: :unset, emergency_calling_enabled: :unset, secure: :unset)
609
+ def update(friendly_name: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_status_callback_method: :unset, voice_status_callback_url: :unset, voice_url: :unset, sip_registration: :unset, domain_name: :unset, emergency_calling_enabled: :unset, secure: :unset, byoc_trunk_sid: :unset, emergency_caller_sid: :unset)
577
610
  context.update(
578
611
  friendly_name: friendly_name,
579
612
  voice_fallback_method: voice_fallback_method,
@@ -586,6 +619,8 @@ module Twilio
586
619
  domain_name: domain_name,
587
620
  emergency_calling_enabled: emergency_calling_enabled,
588
621
  secure: secure,
622
+ byoc_trunk_sid: byoc_trunk_sid,
623
+ emergency_caller_sid: emergency_caller_sid,
589
624
  )
590
625
  end
591
626