twilio-ruby 5.39.1 → 5.40.2

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 (122) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/CHANGES.md +101 -1
  4. data/CONTRIBUTING.md +2 -2
  5. data/ISSUE_TEMPLATE.md +5 -1
  6. data/Makefile +1 -1
  7. data/PULL_REQUEST_TEMPLATE.md +1 -1
  8. data/README.md +4 -3
  9. data/lib/twilio-ruby/framework/version.rb +2 -7
  10. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +6 -4
  11. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +3 -3
  12. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +79 -60
  13. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +14 -0
  14. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +14 -0
  15. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +14 -0
  16. data/lib/twilio-ruby/rest/client.rb +7 -0
  17. data/lib/twilio-ruby/rest/conversations.rb +52 -0
  18. data/lib/twilio-ruby/rest/conversations/v1.rb +88 -1
  19. data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +258 -0
  20. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +15 -4
  21. data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +19 -10
  22. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +12 -2
  23. data/lib/twilio-ruby/rest/conversations/v1/credential.rb +427 -0
  24. data/lib/twilio-ruby/rest/conversations/v1/notification.rb +310 -0
  25. data/lib/twilio-ruby/rest/conversations/v1/role.rb +372 -0
  26. data/lib/twilio-ruby/rest/conversations/v1/service.rb +442 -0
  27. data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +385 -0
  28. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +259 -0
  29. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +586 -0
  30. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +546 -0
  31. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +388 -0
  32. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +513 -0
  33. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +454 -0
  34. data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +393 -0
  35. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +419 -0
  36. data/lib/twilio-ruby/rest/conversations/v1/user.rb +398 -0
  37. data/lib/twilio-ruby/rest/events.rb +63 -0
  38. data/lib/twilio-ruby/rest/events/v1.rb +74 -0
  39. data/lib/twilio-ruby/rest/events/v1/event_type.rb +291 -0
  40. data/lib/twilio-ruby/rest/events/v1/sink.rb +380 -0
  41. data/lib/twilio-ruby/rest/events/v1/sink/sink_test.rb +115 -0
  42. data/lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb +119 -0
  43. data/lib/twilio-ruby/rest/events/v1/subscription.rb +363 -0
  44. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +322 -0
  45. data/lib/twilio-ruby/rest/messaging.rb +6 -0
  46. data/lib/twilio-ruby/rest/messaging/v1.rb +7 -0
  47. data/lib/twilio-ruby/rest/messaging/v1/deactivation.rb +164 -0
  48. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +3 -3
  49. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb +16 -2
  50. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +18 -4
  51. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +45 -4
  52. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +14 -1
  53. data/lib/twilio-ruby/rest/serverless/v1/service.rb +13 -13
  54. data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +6 -6
  55. data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +5 -5
  56. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +8 -8
  57. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +6 -8
  58. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +8 -8
  59. data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +14 -14
  60. data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
  61. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +7 -7
  62. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +1 -1
  63. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +12 -11
  64. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +39 -9
  65. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +75 -9
  66. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +2 -1
  67. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +25 -3
  68. data/lib/twilio-ruby/rest/verify/v2/service.rb +21 -9
  69. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +10 -2
  70. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +4 -1
  71. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +0 -6
  72. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +5 -19
  73. data/lib/twilio-ruby/version.rb +1 -1
  74. data/spec/framework/version_spec.rb +42 -0
  75. data/spec/holodeck/holodeck.rb +3 -3
  76. data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +35 -36
  77. data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +39 -40
  78. data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +35 -36
  79. data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +25 -23
  80. data/spec/integration/api/v2010/account/message_spec.rb +37 -0
  81. data/spec/integration/bulkexports/v1/export/day_spec.rb +5 -5
  82. data/spec/integration/bulkexports/v1/export_configuration_spec.rb +4 -4
  83. data/spec/integration/bulkexports/v1/export_spec.rb +3 -3
  84. data/spec/integration/conversations/v1/configuration_spec.rb +85 -0
  85. data/spec/integration/conversations/v1/conversation/message/delivery_receipt_spec.rb +4 -0
  86. data/spec/integration/conversations/v1/conversation/message_spec.rb +38 -0
  87. data/spec/integration/conversations/v1/conversation/participant_spec.rb +60 -4
  88. data/spec/integration/conversations/v1/conversation_spec.rb +35 -0
  89. data/spec/integration/conversations/v1/credential_spec.rb +219 -0
  90. data/spec/integration/conversations/v1/notification_spec.rb +107 -0
  91. data/spec/integration/conversations/v1/role_spec.rb +249 -0
  92. data/spec/integration/conversations/v1/service/binding_spec.rb +166 -0
  93. data/spec/integration/conversations/v1/service/configuration_spec.rb +87 -0
  94. data/spec/integration/conversations/v1/service/conversation/message/delivery_receipt_spec.rb +144 -0
  95. data/spec/integration/conversations/v1/service/conversation/message_spec.rb +429 -0
  96. data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +407 -0
  97. data/spec/integration/conversations/v1/service/conversation/webhook_spec.rb +299 -0
  98. data/spec/integration/conversations/v1/service/conversation_spec.rb +289 -0
  99. data/spec/integration/conversations/v1/service/role_spec.rb +260 -0
  100. data/spec/integration/conversations/v1/service/user_spec.rb +230 -0
  101. data/spec/integration/conversations/v1/service_spec.rb +174 -0
  102. data/spec/integration/conversations/v1/user_spec.rb +220 -0
  103. data/spec/integration/events/v1/event_type_spec.rb +133 -0
  104. data/spec/integration/events/v1/sink/sink_test_spec.rb +42 -0
  105. data/spec/integration/events/v1/sink/sink_validate_spec.rb +44 -0
  106. data/spec/integration/events/v1/sink_spec.rb +217 -0
  107. data/spec/integration/events/v1/subscription/subscribed_event_spec.rb +212 -0
  108. data/spec/integration/events/v1/subscription_spec.rb +205 -0
  109. data/spec/integration/messaging/v1/deactivation_spec.rb +40 -0
  110. data/spec/integration/numbers/v2/regulatory_compliance/end_user_spec.rb +27 -0
  111. data/spec/integration/numbers/v2/regulatory_compliance/supporting_document_spec.rb +27 -0
  112. data/spec/integration/studio/v1/flow/execution/execution_step_spec.rb +1 -0
  113. data/spec/integration/studio/v2/flow/execution/execution_step_spec.rb +1 -0
  114. data/spec/integration/supersim/v1/sim_spec.rb +23 -0
  115. data/spec/integration/supersim/v1/usage_record_spec.rb +463 -18
  116. data/spec/integration/trunking/v1/trunk_spec.rb +4 -0
  117. data/spec/integration/verify/v2/service/access_token_spec.rb +1 -1
  118. data/spec/integration/verify/v2/service/entity/challenge_spec.rb +8 -8
  119. data/spec/integration/video/v1/room_spec.rb +37 -0
  120. data/spec/integration/wireless/v1/sim/data_session_spec.rb +2 -2
  121. data/spec/spec_helper.rb +1 -1
  122. metadata +70 -2
@@ -140,7 +140,8 @@ module Twilio
140
140
  # `break`, and `email`.
141
141
  # @param [Boolean] available Whether the Worker should be eligible to receive a
142
142
  # Task when it occupies the Activity. A value of `true`, `1`, or `yes` specifies
143
- # the Activity is available. All other values specify that it is not.
143
+ # the Activity is available. All other values specify that it is not. The value
144
+ # cannot be changed after the Activity is created.
144
145
  # @return [ActivityInstance] Created ActivityInstance
145
146
  def create(friendly_name: nil, available: :unset)
146
147
  data = Twilio::Values.of({'FriendlyName' => friendly_name, 'Available' => available, })
@@ -48,6 +48,10 @@ module Twilio
48
48
  # e.g.`/Trunks/[Trunk_SID]/Recording -XPOST -d'Mode=record-from-answer'`. See
49
49
  # [Recording](https://www.twilio.com/docs/sip-trunking#recording) for more
50
50
  # information.
51
+ # @param [trunk.TransferSetting] transfer_mode The call transfer settings for the
52
+ # trunk. Can be: `enable-all`, `sip-only` and `disable-all`. See
53
+ # [Transfer](https://www.twilio.com/docs/sip-trunking/call-transfer) for more
54
+ # information.
51
55
  # @param [Boolean] secure Whether Secure Trunking is enabled for the trunk. If
52
56
  # enabled, all calls going through the trunk will be secure using SRTP for media
53
57
  # and TLS for signaling. If disabled, then RTP will be used for media. See [Secure
@@ -59,13 +63,14 @@ module Twilio
59
63
  # Caller ID data on your phone. See [CNAM
60
64
  # Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information.
61
65
  # @return [TrunkInstance] Created TrunkInstance
62
- def create(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, recording: :unset, secure: :unset, cnam_lookup_enabled: :unset)
66
+ def create(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, recording: :unset, transfer_mode: :unset, secure: :unset, cnam_lookup_enabled: :unset)
63
67
  data = Twilio::Values.of({
64
68
  'FriendlyName' => friendly_name,
65
69
  'DomainName' => domain_name,
66
70
  'DisasterRecoveryUrl' => disaster_recovery_url,
67
71
  'DisasterRecoveryMethod' => disaster_recovery_method,
68
72
  'Recording' => recording,
73
+ 'TransferMode' => transfer_mode,
69
74
  'Secure' => secure,
70
75
  'CnamLookupEnabled' => cnam_lookup_enabled,
71
76
  })
@@ -251,6 +256,10 @@ module Twilio
251
256
  # will be recorded. See
252
257
  # [Recording](https://www.twilio.com/docs/sip-trunking#recording) for more
253
258
  # information.
259
+ # @param [trunk.TransferSetting] transfer_mode The call transfer settings for the
260
+ # trunk. Can be: `enable-all`, `sip-only` and `disable-all`. See
261
+ # [Transfer](https://www.twilio.com/docs/sip-trunking/call-transfer) for more
262
+ # information.
254
263
  # @param [Boolean] secure Whether Secure Trunking is enabled for the trunk. If
255
264
  # enabled, all calls going through the trunk will be secure using SRTP for media
256
265
  # and TLS for signaling. If disabled, then RTP will be used for media. See [Secure
@@ -262,13 +271,14 @@ module Twilio
262
271
  # Caller ID data on your phone. See [CNAM
263
272
  # Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information.
264
273
  # @return [TrunkInstance] Updated TrunkInstance
265
- def update(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, recording: :unset, secure: :unset, cnam_lookup_enabled: :unset)
274
+ def update(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, recording: :unset, transfer_mode: :unset, secure: :unset, cnam_lookup_enabled: :unset)
266
275
  data = Twilio::Values.of({
267
276
  'FriendlyName' => friendly_name,
268
277
  'DomainName' => domain_name,
269
278
  'DisasterRecoveryUrl' => disaster_recovery_url,
270
279
  'DisasterRecoveryMethod' => disaster_recovery_method,
271
280
  'Recording' => recording,
281
+ 'TransferMode' => transfer_mode,
272
282
  'Secure' => secure,
273
283
  'CnamLookupEnabled' => cnam_lookup_enabled,
274
284
  })
@@ -385,6 +395,7 @@ module Twilio
385
395
  'friendly_name' => payload['friendly_name'],
386
396
  'secure' => payload['secure'],
387
397
  'recording' => payload['recording'],
398
+ 'transfer_mode' => payload['transfer_mode'],
388
399
  'cnam_lookup_enabled' => payload['cnam_lookup_enabled'],
389
400
  'auth_type' => payload['auth_type'],
390
401
  'auth_type_set' => payload['auth_type_set'],
@@ -453,6 +464,12 @@ module Twilio
453
464
  @properties['recording']
454
465
  end
455
466
 
467
+ ##
468
+ # @return [trunk.TransferSetting] The call transfer settings for the trunk
469
+ def transfer_mode
470
+ @properties['transfer_mode']
471
+ end
472
+
456
473
  ##
457
474
  # @return [Boolean] Whether Caller ID Name (CNAM) lookup is enabled for the trunk
458
475
  def cnam_lookup_enabled
@@ -538,6 +555,10 @@ module Twilio
538
555
  # will be recorded. See
539
556
  # [Recording](https://www.twilio.com/docs/sip-trunking#recording) for more
540
557
  # information.
558
+ # @param [trunk.TransferSetting] transfer_mode The call transfer settings for the
559
+ # trunk. Can be: `enable-all`, `sip-only` and `disable-all`. See
560
+ # [Transfer](https://www.twilio.com/docs/sip-trunking/call-transfer) for more
561
+ # information.
541
562
  # @param [Boolean] secure Whether Secure Trunking is enabled for the trunk. If
542
563
  # enabled, all calls going through the trunk will be secure using SRTP for media
543
564
  # and TLS for signaling. If disabled, then RTP will be used for media. See [Secure
@@ -549,13 +570,14 @@ module Twilio
549
570
  # Caller ID data on your phone. See [CNAM
550
571
  # Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information.
551
572
  # @return [TrunkInstance] Updated TrunkInstance
552
- def update(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, recording: :unset, secure: :unset, cnam_lookup_enabled: :unset)
573
+ def update(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, recording: :unset, transfer_mode: :unset, secure: :unset, cnam_lookup_enabled: :unset)
553
574
  context.update(
554
575
  friendly_name: friendly_name,
555
576
  domain_name: domain_name,
556
577
  disaster_recovery_url: disaster_recovery_url,
557
578
  disaster_recovery_method: disaster_recovery_method,
558
579
  recording: recording,
580
+ transfer_mode: transfer_mode,
559
581
  secure: secure,
560
582
  cnam_lookup_enabled: cnam_lookup_enabled,
561
583
  )
@@ -47,10 +47,14 @@ module Twilio
47
47
  # @param [Boolean] custom_code_enabled Whether to allow sending verifications with
48
48
  # a custom code instead of a randomly generated one. Not available for all
49
49
  # customers.
50
- # @param [Hash] push The optional service level push factors configuration. If
51
- # present it must be a json string with the following format:
50
+ # @param [Hash] push Configurations for the Push factors (channel) created under
51
+ # this Service. If present, it must be a json string with the following format:
52
52
  # {"notify_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "include_date":
53
- # true}
53
+ # true}. If `include_date` is set to `true`, which is the default, that means that
54
+ # the push challenge’s response will include the date created value. If
55
+ # `include_date` is set to `false`, then the date created value will not be
56
+ # included. See [Challenge](https://www.twilio.com/docs/verify/api/challenge)
57
+ # resource’s details parameter for more info
54
58
  # @return [ServiceInstance] Created ServiceInstance
55
59
  def create(friendly_name: nil, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push: :unset)
56
60
  data = Twilio::Values.of({
@@ -249,10 +253,14 @@ module Twilio
249
253
  # @param [Boolean] custom_code_enabled Whether to allow sending verifications with
250
254
  # a custom code instead of a randomly generated one. Not available for all
251
255
  # customers.
252
- # @param [Hash] push The optional service level push factors configuration. If
253
- # present it must be a json string with the following format:
256
+ # @param [Hash] push Configurations for the Push factors (channel) created under
257
+ # this Service. If present, it must be a json string with the following format:
254
258
  # {"notify_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "include_date":
255
- # true}
259
+ # true}. If `include_date` is set to `true`, which is the default, that means that
260
+ # the push challenge’s response will include the date created value. If
261
+ # `include_date` is set to `false`, then the date created value will not be
262
+ # included. See [Challenge](https://www.twilio.com/docs/verify/api/challenge)
263
+ # resource’s details parameter for more info
256
264
  # @return [ServiceInstance] Updated ServiceInstance
257
265
  def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push: :unset)
258
266
  data = Twilio::Values.of({
@@ -581,10 +589,14 @@ module Twilio
581
589
  # @param [Boolean] custom_code_enabled Whether to allow sending verifications with
582
590
  # a custom code instead of a randomly generated one. Not available for all
583
591
  # customers.
584
- # @param [Hash] push The optional service level push factors configuration. If
585
- # present it must be a json string with the following format:
592
+ # @param [Hash] push Configurations for the Push factors (channel) created under
593
+ # this Service. If present, it must be a json string with the following format:
586
594
  # {"notify_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "include_date":
587
- # true}
595
+ # true}. If `include_date` is set to `true`, which is the default, that means that
596
+ # the push challenge’s response will include the date created value. If
597
+ # `include_date` is set to `false`, then the date created value will not be
598
+ # included. See [Challenge](https://www.twilio.com/docs/verify/api/challenge)
599
+ # resource’s details parameter for more info
588
600
  # @return [ServiceInstance] Updated ServiceInstance
589
601
  def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push: :unset)
590
602
  context.update(
@@ -36,9 +36,17 @@ module Twilio
36
36
  # @param [Time] expiration_date The future date in which this Challenge will
37
37
  # expire, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
38
38
  # @param [String] details Details provided to give context about the Challenge.
39
- # Shown to the end user.
39
+ # Shown to the end user. It must be a stringified JSON with the following
40
+ # structure: {"message": "string", "fields": [ { "label": "string", "value":
41
+ # "string"}]}. `message` is required. If you send the `fields` property, each
42
+ # field has to include `label` and `value` properties. If you had set
43
+ # `include_date=true` in the `push` configuration of the
44
+ # [service](https://www.twilio.com/docs/verify/api/service), the response will
45
+ # also include the challenge's date created value as an additional field called
46
+ # `date`
40
47
  # @param [String] hidden_details Details provided to give context about the
41
- # Challenge. Not shown to the end user.
48
+ # Challenge. Not shown to the end user. It must be a stringified JSON with only
49
+ # strings values eg. `{"ip": "172.168.1.234"}`
42
50
  # @param [String] twilio_sandbox_mode The Twilio-Sandbox-Mode HTTP request header
43
51
  # @return [ChallengeInstance] Created ChallengeInstance
44
52
  def create(factor_sid: nil, expiration_date: :unset, details: :unset, hidden_details: :unset, twilio_sandbox_mode: :unset)
@@ -34,6 +34,8 @@ module Twilio
34
34
  # be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
35
35
  # @param [String] channel The verification method to use. Can be:
36
36
  # [`email`](https://www.twilio.com/docs/verify/email), `sms` or `call`.
37
+ # @param [String] custom_friendly_name A custom user defined friendly name that
38
+ # overwrites the existing one in the verification message
37
39
  # @param [String] custom_message The text of a custom message to use for the
38
40
  # verification.
39
41
  # @param [String] send_digits The digits to send after a phone call is answered,
@@ -61,10 +63,11 @@ module Twilio
61
63
  # @param [String] app_hash Your [App
62
64
  # Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`.
63
65
  # @return [VerificationInstance] Created VerificationInstance
64
- def create(to: nil, channel: nil, custom_message: :unset, send_digits: :unset, locale: :unset, custom_code: :unset, amount: :unset, payee: :unset, rate_limits: :unset, channel_configuration: :unset, app_hash: :unset)
66
+ def create(to: nil, channel: nil, custom_friendly_name: :unset, custom_message: :unset, send_digits: :unset, locale: :unset, custom_code: :unset, amount: :unset, payee: :unset, rate_limits: :unset, channel_configuration: :unset, app_hash: :unset)
65
67
  data = Twilio::Values.of({
66
68
  'To' => to,
67
69
  'Channel' => channel,
70
+ 'CustomFriendlyName' => custom_friendly_name,
68
71
  'CustomMessage' => custom_message,
69
72
  'SendDigits' => send_digits,
70
73
  'Locale' => locale,
@@ -12,8 +12,6 @@ module Twilio
12
12
  class V1 < Version
13
13
  class RoomContext < InstanceContext
14
14
  class ParticipantContext < InstanceContext
15
- ##
16
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
17
15
  class SubscribeRulesList < ListResource
18
16
  ##
19
17
  # Initialize the SubscribeRulesList
@@ -71,8 +69,6 @@ module Twilio
71
69
  end
72
70
  end
73
71
 
74
- ##
75
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
76
72
  class SubscribeRulesPage < Page
77
73
  ##
78
74
  # Initialize the SubscribeRulesPage
@@ -107,8 +103,6 @@ module Twilio
107
103
  end
108
104
  end
109
105
 
110
- ##
111
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
112
106
  class SubscribeRulesInstance < InstanceResource
113
107
  ##
114
108
  # Initialize the SubscribeRulesInstance
@@ -31,10 +31,6 @@ module Twilio
31
31
  # Lists DataSessionInstance records from the API as a list.
32
32
  # Unlike stream(), this operation is eager and will load `limit` records into
33
33
  # memory before returning.
34
- # @param [Time] end_ The date that the record ended, given as GMT in [ISO
35
- # 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
36
- # @param [Time] start The date that the Data Session started, given as GMT in [ISO
37
- # 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
38
34
  # @param [Integer] limit Upper limit for the number of records to return. stream()
39
35
  # guarantees to never return more than limit. Default is no limit
40
36
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -42,18 +38,14 @@ module Twilio
42
38
  # but a limit is defined, stream() will attempt to read the limit with the most
43
39
  # efficient page size, i.e. min(limit, 1000)
44
40
  # @return [Array] Array of up to limit results
45
- def list(end_: :unset, start: :unset, limit: nil, page_size: nil)
46
- self.stream(end_: end_, start: start, limit: limit, page_size: page_size).entries
41
+ def list(limit: nil, page_size: nil)
42
+ self.stream(limit: limit, page_size: page_size).entries
47
43
  end
48
44
 
49
45
  ##
50
46
  # Streams DataSessionInstance records from the API as an Enumerable.
51
47
  # This operation lazily loads records as efficiently as possible until the limit
52
48
  # is reached.
53
- # @param [Time] end_ The date that the record ended, given as GMT in [ISO
54
- # 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
55
- # @param [Time] start The date that the Data Session started, given as GMT in [ISO
56
- # 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
57
49
  # @param [Integer] limit Upper limit for the number of records to return. stream()
58
50
  # guarantees to never return more than limit. Default is no limit.
59
51
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -61,10 +53,10 @@ module Twilio
61
53
  # but a limit is defined, stream() will attempt to read the limit with the most
62
54
  # efficient page size, i.e. min(limit, 1000)
63
55
  # @return [Enumerable] Enumerable that will yield up to limit results
64
- def stream(end_: :unset, start: :unset, limit: nil, page_size: nil)
56
+ def stream(limit: nil, page_size: nil)
65
57
  limits = @version.read_limits(limit, page_size)
66
58
 
67
- page = self.page(end_: end_, start: start, page_size: limits[:page_size], )
59
+ page = self.page(page_size: limits[:page_size], )
68
60
 
69
61
  @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
70
62
  end
@@ -86,18 +78,12 @@ module Twilio
86
78
  ##
87
79
  # Retrieve a single page of DataSessionInstance records from the API.
88
80
  # Request is executed immediately.
89
- # @param [Time] end_ The date that the record ended, given as GMT in [ISO
90
- # 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
91
- # @param [Time] start The date that the Data Session started, given as GMT in [ISO
92
- # 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
93
81
  # @param [String] page_token PageToken provided by the API
94
82
  # @param [Integer] page_number Page Number, this value is simply for client state
95
83
  # @param [Integer] page_size Number of records to return, defaults to 50
96
84
  # @return [Page] Page of DataSessionInstance
97
- def page(end_: :unset, start: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
85
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
98
86
  params = Twilio::Values.of({
99
- 'End' => Twilio.serialize_iso8601_datetime(end_),
100
- 'Start' => Twilio.serialize_iso8601_datetime(start),
101
87
  'PageToken' => page_token,
102
88
  'Page' => page_number,
103
89
  'PageSize' => page_size,
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.39.1'
2
+ VERSION = '5.40.2'
3
3
  end
@@ -21,6 +21,48 @@ describe 'Version Action Methods' do
21
21
  expect(actual).to_not eq(nil)
22
22
  end
23
23
 
24
+ describe 'stream' do
25
+ before(:each) do
26
+ @holodeck.mock(
27
+ Twilio::Response.new(
28
+ 200,
29
+ '{
30
+ "next_page_uri": "/2010-04-01/Accounts/AC123/Messages.json?Page=1",
31
+ "messages": [{"body": "payload0"}, {"body": "payload1"}]
32
+ }'
33
+ )
34
+ )
35
+ @holodeck.mock(
36
+ Twilio::Response.new(
37
+ 200,
38
+ '{
39
+ "next_page_uri": "/2010-04-01/Accounts/AC123/Messages.json?Page=2",
40
+ "messages": [{"body": "payload2"}, {"body": "payload3"}]
41
+ }'
42
+ )
43
+ )
44
+ @holodeck.mock(
45
+ Twilio::Response.new(
46
+ 200,
47
+ '{
48
+ "next_page_uri": null,
49
+ "messages": [{"body": "payload4"}]
50
+ }'
51
+ )
52
+ )
53
+ end
54
+
55
+ it 'streams all results' do
56
+ actual = @client.messages.stream
57
+ expect(actual.count).to eq(5)
58
+ end
59
+
60
+ it 'limits results' do
61
+ actual = @client.messages.stream(limit: 3)
62
+ expect(actual.count).to eq(3)
63
+ end
64
+ end
65
+
24
66
  it 'receives create responses' do
25
67
  @holodeck.mock(
26
68
  Twilio::Response.new(
@@ -40,12 +40,12 @@ class Holodeck
40
40
  ANY = Request.new(any: true)
41
41
 
42
42
  def initialize
43
- @response = nil
43
+ @responses = []
44
44
  @requests = []
45
45
  end
46
46
 
47
47
  def mock(response)
48
- @response = response
48
+ @responses << response
49
49
  end
50
50
 
51
51
  def request(host, port, method, url, params = {}, data = {}, headers = {}, auth = nil, _timeout = nil)
@@ -57,7 +57,7 @@ class Holodeck
57
57
  headers: headers,
58
58
  auth: auth
59
59
  )
60
- @response
60
+ @responses.shift
61
61
  end
62
62
 
63
63
  def has_request?(request)
@@ -31,7 +31,7 @@ describe 'Local' do
31
31
  %q[
32
32
  {
33
33
  "end": 0,
34
- "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=0",
34
+ "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
35
35
  "incoming_phone_numbers": [
36
36
  {
37
37
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -46,10 +46,12 @@ describe 'Local' do
46
46
  },
47
47
  "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
48
48
  "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
49
+ "emergency_status": "Active",
50
+ "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
49
51
  "friendly_name": "(808) 925-5327",
50
52
  "identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
51
- "phone_number": "+18089255327",
52
53
  "origin": "origin",
54
+ "phone_number": "+18089255327",
53
55
  "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
54
56
  "sms_application_sid": "",
55
57
  "sms_fallback_method": "POST",
@@ -66,20 +68,17 @@ describe 'Local' do
66
68
  "voice_fallback_url": null,
67
69
  "voice_method": "POST",
68
70
  "voice_url": null,
69
- "emergency_status": "Active",
70
- "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
71
- "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
71
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
72
+ "voice_receive_mode": "voice",
73
+ "status": "in-use"
72
74
  }
73
75
  ],
74
- "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=2",
75
76
  "next_page_uri": null,
76
- "num_pages": 3,
77
77
  "page": 0,
78
- "page_size": 1,
78
+ "page_size": 50,
79
79
  "previous_page_uri": null,
80
80
  "start": 0,
81
- "total": 3,
82
- "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1"
81
+ "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0"
83
82
  }
84
83
  ]
85
84
  ))
@@ -97,17 +96,14 @@ describe 'Local' do
97
96
  %q[
98
97
  {
99
98
  "end": 0,
100
- "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=0",
99
+ "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
101
100
  "incoming_phone_numbers": [],
102
- "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=2",
103
101
  "next_page_uri": null,
104
- "num_pages": 3,
105
102
  "page": 0,
106
- "page_size": 1,
103
+ "page_size": 50,
107
104
  "previous_page_uri": null,
108
105
  "start": 0,
109
- "total": 3,
110
- "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1"
106
+ "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0"
111
107
  }
112
108
  ]
113
109
  ))
@@ -148,35 +144,38 @@ describe 'Local' do
148
144
  "api_version": "2010-04-01",
149
145
  "beta": false,
150
146
  "capabilities": {
151
- "mms": true,
147
+ "voice": true,
152
148
  "sms": false,
153
- "voice": true
149
+ "mms": true,
150
+ "fax": false
154
151
  },
155
152
  "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
156
153
  "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
157
- "friendly_name": "(808) 925-5327",
154
+ "emergency_status": "Active",
155
+ "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
156
+ "friendly_name": "friendly_name",
158
157
  "identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
159
- "phone_number": "+18089255327",
160
158
  "origin": "origin",
159
+ "phone_number": "+18089255327",
161
160
  "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
162
- "sms_application_sid": "",
163
- "sms_fallback_method": "POST",
164
- "sms_fallback_url": "",
165
- "sms_method": "POST",
166
- "sms_url": "",
167
- "status_callback": "",
168
- "status_callback_method": "POST",
161
+ "sms_application_sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
162
+ "sms_fallback_method": "GET",
163
+ "sms_fallback_url": "https://example.com",
164
+ "sms_method": "GET",
165
+ "sms_url": "https://example.com",
166
+ "status_callback": "https://example.com",
167
+ "status_callback_method": "GET",
169
168
  "trunk_sid": null,
170
169
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
171
- "voice_application_sid": "",
172
- "voice_caller_id_lookup": false,
173
- "voice_fallback_method": "POST",
174
- "voice_fallback_url": null,
175
- "voice_method": "POST",
176
- "voice_url": null,
177
- "emergency_status": "Active",
178
- "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
179
- "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
170
+ "voice_application_sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
171
+ "voice_caller_id_lookup": true,
172
+ "voice_fallback_method": "GET",
173
+ "voice_fallback_url": "https://example.com",
174
+ "voice_method": "GET",
175
+ "voice_url": "https://example.com",
176
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
177
+ "voice_receive_mode": "voice",
178
+ "status": "in-use"
180
179
  }
181
180
  ]
182
181
  ))