twilio-ruby 5.40.2 → 5.40.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +15 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/framework/version.rb +2 -1
  5. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +12 -3
  6. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +12 -3
  7. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +12 -3
  8. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +12 -3
  9. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +12 -3
  10. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +12 -3
  11. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +12 -3
  12. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +2 -1
  13. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +8 -2
  14. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -2
  15. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +8 -1
  16. data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +3 -1
  17. data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +2 -1
  18. data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +8 -4
  19. data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +11 -4
  20. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +13 -6
  21. data/lib/twilio-ruby/rest/conversations.rb +0 -16
  22. data/lib/twilio-ruby/rest/conversations/v1.rb +0 -24
  23. data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +17 -7
  24. data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +262 -0
  25. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +6 -6
  26. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +13 -10
  27. data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +22 -16
  28. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +42 -36
  29. data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +14 -11
  30. data/lib/twilio-ruby/rest/conversations/v1/credential.rb +1 -1
  31. data/lib/twilio-ruby/rest/conversations/v1/role.rb +4 -2
  32. data/lib/twilio-ruby/rest/conversations/v1/service.rb +1 -1
  33. data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +28 -25
  34. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +30 -18
  35. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +315 -0
  36. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +10 -10
  37. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +23 -20
  38. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +32 -26
  39. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +52 -46
  40. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +24 -21
  41. data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +13 -11
  42. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +23 -23
  43. data/lib/twilio-ruby/rest/conversations/v1/user.rb +14 -14
  44. data/lib/twilio-ruby/rest/events.rb +10 -1
  45. data/lib/twilio-ruby/rest/events/v1.rb +17 -1
  46. data/lib/twilio-ruby/rest/events/v1/event_type.rb +8 -8
  47. data/lib/twilio-ruby/rest/events/v1/schema.rb +226 -0
  48. data/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +290 -0
  49. data/lib/twilio-ruby/rest/events/v1/subscription.rb +28 -8
  50. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +3 -109
  51. data/lib/twilio-ruby/rest/fax/v1/fax.rb +2 -1
  52. data/lib/twilio-ruby/rest/messaging/v1/service.rb +6 -3
  53. data/lib/twilio-ruby/rest/notify/v1/credential.rb +12 -6
  54. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +10 -2
  55. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +10 -5
  56. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +6 -3
  57. data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb +1 -4
  58. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +3 -1
  59. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +6 -2
  60. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +1 -4
  61. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +6 -2
  62. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +19 -26
  63. data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +2 -1
  64. data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +2 -1
  65. data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +201 -0
  66. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -1
  67. data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -3
  68. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +18 -9
  69. data/lib/twilio-ruby/rest/video/v1/room.rb +2 -1
  70. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +1 -4
  71. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +2 -1
  72. data/lib/twilio-ruby/version.rb +1 -1
  73. data/spec/framework/version_spec.rb +11 -0
  74. data/spec/integration/conversations/v1/{webhook_spec.rb → configuration/webhook_spec.rb} +12 -8
  75. data/spec/integration/conversations/v1/configuration_spec.rb +4 -2
  76. data/spec/integration/conversations/v1/{notification_spec.rb → service/configuration/notification_spec.rb} +12 -4
  77. data/spec/integration/events/v1/schema/schema_version_spec.rb +126 -0
  78. data/spec/integration/events/v1/schema_spec.rb +46 -0
  79. data/spec/integration/events/v1/subscription/subscribed_event_spec.rb +0 -121
  80. data/spec/integration/events/v1/subscription_spec.rb +38 -0
  81. data/spec/integration/trunking/v1/trunk/recording_spec.rb +79 -0
  82. metadata +17 -8
  83. data/lib/twilio-ruby/rest/conversations/v1/notification.rb +0 -310
  84. data/lib/twilio-ruby/rest/conversations/v1/webhook.rb +0 -262
@@ -61,7 +61,9 @@ module Twilio
61
61
  # [`email`](https://www.twilio.com/docs/verify/email) channel configuration in
62
62
  # json format. Must include 'from' and 'from_name'.
63
63
  # @param [String] app_hash Your [App
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`.
64
+ # Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string)
65
+ # to be appended at the end of your verification SMS body. Applies only to SMS.
66
+ # Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`.
65
67
  # @return [VerificationInstance] Created VerificationInstance
66
68
  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)
67
69
  data = Twilio::Values.of({
@@ -152,7 +152,9 @@ module Twilio
152
152
  # used as composition sources.
153
153
  # @param [Hash] video_layout An object that describes the video layout of the
154
154
  # composition in terms of regions. See [Specifying Video
155
- # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request
155
+ # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts)
156
+ # for more info. Please, be aware that either video_layout or audio_sources have
157
+ # to be provided to get a valid creation request
156
158
  # @param [String] audio_sources An array of track names from the same group room
157
159
  # to merge into the new composition. Can include zero or more track names. The new
158
160
  # composition includes all audio sources specified in `audio_sources` except for
@@ -185,7 +187,8 @@ module Twilio
185
187
  # Note that the `resolution` imposes an aspect ratio to the resulting composition.
186
188
  # When the original video tracks are constrained by the aspect ratio, they are
187
189
  # scaled to fit. See [Specifying Video
188
- # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
190
+ # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts)
191
+ # for more info.
189
192
  # @param [composition.Format] format The container format of the composition's
190
193
  # media files. Can be: `mp4` or `webm` and the default is `webm`. If you specify
191
194
  # `mp4` or `webm`, you must also specify one or more `audio_sources` and/or a
@@ -202,7 +205,8 @@ module Twilio
202
205
  # enabled are shorter when the Room is created and no Participant joins for a
203
206
  # while as well as if all the Participants leave the room and join later, because
204
207
  # those gaps will be removed. See [Specifying Video
205
- # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
208
+ # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts)
209
+ # for more info.
206
210
  # @return [CompositionInstance] Created CompositionInstance
207
211
  def create(room_sid: nil, video_layout: :unset, audio_sources: :unset, audio_sources_excluded: :unset, resolution: :unset, format: :unset, status_callback: :unset, status_callback_method: :unset, trim: :unset)
208
212
  data = Twilio::Values.of({
@@ -165,7 +165,8 @@ module Twilio
165
165
  # account. When `false`, the composition hook will never be triggered.
166
166
  # @param [Hash] video_layout An object that describes the video layout of the
167
167
  # composition hook in terms of regions. See [Specifying Video
168
- # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
168
+ # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts)
169
+ # for more info.
169
170
  # @param [String] audio_sources An array of track names from the same group room
170
171
  # to merge into the compositions created by the composition hook. Can include zero
171
172
  # or more track names. A composition triggered by the composition hook includes
@@ -199,7 +200,8 @@ module Twilio
199
200
  # Note that the `resolution` imposes an aspect ratio to the resulting composition.
200
201
  # When the original video tracks are constrained by the aspect ratio, they are
201
202
  # scaled to fit. See [Specifying Video
202
- # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
203
+ # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts)
204
+ # for more info.
203
205
  # @param [composition_hook.Format] format The container format of the media files
204
206
  # used by the compositions created by the composition hook. Can be: `mp4` or
205
207
  # `webm` and the default is `webm`. If `mp4` or `webm`, `audio_sources` must have
@@ -217,7 +219,8 @@ module Twilio
217
219
  # and no Participant joins for a while as well as if all the Participants leave
218
220
  # the room and join later, because those gaps will be removed. See [Specifying
219
221
  # Video
220
- # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
222
+ # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts)
223
+ # for more info.
221
224
  # @return [CompositionHookInstance] Created CompositionHookInstance
222
225
  def create(friendly_name: nil, enabled: :unset, video_layout: :unset, audio_sources: :unset, audio_sources_excluded: :unset, resolution: :unset, format: :unset, status_callback: :unset, status_callback_method: :unset, trim: :unset)
223
226
  data = Twilio::Values.of({
@@ -318,7 +321,8 @@ module Twilio
318
321
  # account. When `false`, the composition hook never triggers.
319
322
  # @param [Hash] video_layout A JSON object that describes the video layout of the
320
323
  # composition hook in terms of regions. See [Specifying Video
321
- # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
324
+ # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts)
325
+ # for more info.
322
326
  # @param [String] audio_sources An array of track names from the same group room
323
327
  # to merge into the compositions created by the composition hook. Can include zero
324
328
  # or more track names. A composition triggered by the composition hook includes
@@ -340,7 +344,8 @@ module Twilio
340
344
  # and no Participant joins for a while as well as if all the Participants leave
341
345
  # the room and join later, because those gaps will be removed. See [Specifying
342
346
  # Video
343
- # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
347
+ # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts)
348
+ # for more info.
344
349
  # @param [composition_hook.Format] format The container format of the media files
345
350
  # used by the compositions created by the composition hook. Can be: `mp4` or
346
351
  # `webm` and the default is `webm`. If `mp4` or `webm`, `audio_sources` must have
@@ -364,7 +369,8 @@ module Twilio
364
369
  # Note that the `resolution` imposes an aspect ratio to the resulting composition.
365
370
  # When the original video tracks are constrained by the aspect ratio, they are
366
371
  # scaled to fit. See [Specifying Video
367
- # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
372
+ # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts)
373
+ # for more info.
368
374
  # @param [String] status_callback The URL we should call using the
369
375
  # `status_callback_method` to send status information to your application on every
370
376
  # composition event. If not provided, status callback events will not be
@@ -567,7 +573,8 @@ module Twilio
567
573
  # account. When `false`, the composition hook never triggers.
568
574
  # @param [Hash] video_layout A JSON object that describes the video layout of the
569
575
  # composition hook in terms of regions. See [Specifying Video
570
- # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
576
+ # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts)
577
+ # for more info.
571
578
  # @param [String] audio_sources An array of track names from the same group room
572
579
  # to merge into the compositions created by the composition hook. Can include zero
573
580
  # or more track names. A composition triggered by the composition hook includes
@@ -589,7 +596,8 @@ module Twilio
589
596
  # and no Participant joins for a while as well as if all the Participants leave
590
597
  # the room and join later, because those gaps will be removed. See [Specifying
591
598
  # Video
592
- # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
599
+ # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts)
600
+ # for more info.
593
601
  # @param [composition_hook.Format] format The container format of the media files
594
602
  # used by the compositions created by the composition hook. Can be: `mp4` or
595
603
  # `webm` and the default is `webm`. If `mp4` or `webm`, `audio_sources` must have
@@ -613,7 +621,8 @@ module Twilio
613
621
  # Note that the `resolution` imposes an aspect ratio to the resulting composition.
614
622
  # When the original video tracks are constrained by the aspect ratio, they are
615
623
  # scaled to fit. See [Specifying Video
616
- # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
624
+ # Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts)
625
+ # for more info.
617
626
  # @param [String] status_callback The URL we should call using the
618
627
  # `status_callback_method` to send status information to your application on every
619
628
  # composition event. If not provided, status callback events will not be
@@ -56,7 +56,8 @@ module Twilio
56
56
  # ***This feature is not available in `peer-to-peer` rooms***
57
57
  # @param [String] media_region The region for the media server in Group Rooms.
58
58
  # Can be: one of the [available Media
59
- # Regions](https://www.twilio.com/docs/video/ip-address-whitelisting#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.***
59
+ # Regions](https://www.twilio.com/docs/video/ip-address-whitelisting#group-rooms-media-servers).
60
+ # ***This feature is not available in `peer-to-peer` rooms.***
60
61
  # @return [RoomInstance] Created RoomInstance
61
62
  def create(enable_turn: :unset, type: :unset, unique_name: :unset, status_callback: :unset, status_callback_method: :unset, max_participants: :unset, record_participants_on_connect: :unset, video_codecs: :unset, media_region: :unset)
62
63
  data = Twilio::Values.of({
@@ -48,12 +48,9 @@ module Twilio
48
48
 
49
49
  ##
50
50
  # Access the settings
51
- # @return [SettingsList]
52
- # @return [SettingsContext]
51
+ # @return [SettingsContext] SettingsContext
53
52
  def settings
54
53
  return SettingsContext.new(@version, )
55
-
56
- @settings ||= SettingsList.new(@version, )
57
54
  end
58
55
 
59
56
  ##
@@ -135,7 +135,8 @@ module Twilio
135
135
  # non-home networks in the United States. The metering period begins the day of
136
136
  # activation and ends on the same day in the following month. Can be up to 2TB.
137
137
  # See [national
138
- # roaming](https://www.twilio.com/docs/wireless/api/rateplan-resource#national-roaming) for more info.
138
+ # roaming](https://www.twilio.com/docs/wireless/api/rateplan-resource#national-roaming)
139
+ # for more info.
139
140
  # @param [String] international_roaming_data_limit The total data usage (download
140
141
  # and upload combined) in Megabytes that the Network allows during one month when
141
142
  # roaming outside the United States. Can be up to 2TB.
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.40.2'
2
+ VERSION = '5.40.3'
3
3
  end
@@ -21,6 +21,17 @@ describe 'Version Action Methods' do
21
21
  expect(actual).to_not eq(nil)
22
22
  end
23
23
 
24
+ it 'handles redirect fetch responses' do
25
+ @holodeck.mock(
26
+ Twilio::Response.new(
27
+ 307,
28
+ '{"phone_number": "+15108675310"}'
29
+ )
30
+ )
31
+ actual = @client.lookups.v1.phone_numbers('+15017122661').fetch
32
+ expect(actual).to_not eq(nil)
33
+ end
34
+
24
35
  describe 'stream' do
25
36
  before(:each) do
26
37
  @holodeck.mock(
@@ -13,13 +13,14 @@ describe 'Webhook' do
13
13
  @holodeck.mock(Twilio::Response.new(500, ''))
14
14
 
15
15
  expect {
16
- @client.conversations.v1.webhooks().fetch()
16
+ @client.conversations.v1.configuration \
17
+ .webhooks().fetch()
17
18
  }.to raise_exception(Twilio::REST::TwilioError)
18
19
 
19
20
  expect(
20
21
  @holodeck.has_request?(Holodeck::Request.new(
21
22
  method: 'get',
22
- url: 'https://conversations.twilio.com/v1/Conversations/Webhooks',
23
+ url: 'https://conversations.twilio.com/v1/Configuration/Webhooks',
23
24
  ))).to eq(true)
24
25
  end
25
26
 
@@ -37,12 +38,13 @@ describe 'Webhook' do
37
38
  "onConversationUpdated"
38
39
  ],
39
40
  "target": "webhook",
40
- "url": "https://conversations.twilio.com/v1/Conversations/Webhooks"
41
+ "url": "https://conversations.twilio.com/v1/Configuration/Webhooks"
41
42
  }
42
43
  ]
43
44
  ))
44
45
 
45
- actual = @client.conversations.v1.webhooks().fetch()
46
+ actual = @client.conversations.v1.configuration \
47
+ .webhooks().fetch()
46
48
 
47
49
  expect(actual).to_not eq(nil)
48
50
  end
@@ -51,13 +53,14 @@ describe 'Webhook' do
51
53
  @holodeck.mock(Twilio::Response.new(500, ''))
52
54
 
53
55
  expect {
54
- @client.conversations.v1.webhooks().update()
56
+ @client.conversations.v1.configuration \
57
+ .webhooks().update()
55
58
  }.to raise_exception(Twilio::REST::TwilioError)
56
59
 
57
60
  expect(
58
61
  @holodeck.has_request?(Holodeck::Request.new(
59
62
  method: 'post',
60
- url: 'https://conversations.twilio.com/v1/Conversations/Webhooks',
63
+ url: 'https://conversations.twilio.com/v1/Configuration/Webhooks',
61
64
  ))).to eq(true)
62
65
  end
63
66
 
@@ -74,12 +77,13 @@ describe 'Webhook' do
74
77
  "onConversationUpdated"
75
78
  ],
76
79
  "target": "webhook",
77
- "url": "https://conversations.twilio.com/v1/Conversations/Webhooks"
80
+ "url": "https://conversations.twilio.com/v1/Configuration/Webhooks"
78
81
  }
79
82
  ]
80
83
  ))
81
84
 
82
- actual = @client.conversations.v1.webhooks().update()
85
+ actual = @client.conversations.v1.configuration \
86
+ .webhooks().update()
83
87
 
84
88
  expect(actual).to_not eq(nil)
85
89
  end
@@ -35,7 +35,8 @@ describe 'Configuration' do
35
35
  "default_closed_timer": "PT10M",
36
36
  "url": "https://conversations.twilio.com/v1/Configuration",
37
37
  "links": {
38
- "service": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration"
38
+ "service": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration",
39
+ "webhooks": "https://conversations.twilio.com/v1/Configuration/Webhooks"
39
40
  }
40
41
  }
41
42
  ]
@@ -72,7 +73,8 @@ describe 'Configuration' do
72
73
  "default_closed_timer": "PT10M",
73
74
  "url": "https://conversations.twilio.com/v1/Configuration",
74
75
  "links": {
75
- "service": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration"
76
+ "service": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration",
77
+ "webhooks": "https://conversations.twilio.com/v1/Configuration/Webhooks"
76
78
  }
77
79
  }
78
80
  ]
@@ -13,7 +13,9 @@ describe 'Notification' do
13
13
  @holodeck.mock(Twilio::Response.new(500, ''))
14
14
 
15
15
  expect {
16
- @client.conversations.v1.notifications('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
16
+ @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
17
+ .configuration \
18
+ .notifications().update()
17
19
  }.to raise_exception(Twilio::REST::TwilioError)
18
20
 
19
21
  expect(
@@ -52,7 +54,9 @@ describe 'Notification' do
52
54
  ]
53
55
  ))
54
56
 
55
- actual = @client.conversations.v1.notifications('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
57
+ actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
58
+ .configuration \
59
+ .notifications().update()
56
60
 
57
61
  expect(actual).to_not eq(nil)
58
62
  end
@@ -61,7 +65,9 @@ describe 'Notification' do
61
65
  @holodeck.mock(Twilio::Response.new(500, ''))
62
66
 
63
67
  expect {
64
- @client.conversations.v1.notifications('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
68
+ @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
69
+ .configuration \
70
+ .notifications().fetch()
65
71
  }.to raise_exception(Twilio::REST::TwilioError)
66
72
 
67
73
  expect(
@@ -100,7 +106,9 @@ describe 'Notification' do
100
106
  ]
101
107
  ))
102
108
 
103
- actual = @client.conversations.v1.notifications('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
109
+ actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
110
+ .configuration \
111
+ .notifications().fetch()
104
112
 
105
113
  expect(actual).to_not eq(nil)
106
114
  end
@@ -0,0 +1,126 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require 'spec_helper.rb'
10
+
11
+ describe 'Version' do
12
+ it "can read" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.events.v1.schemas('id') \
17
+ .versions.list()
18
+ }.to raise_exception(Twilio::REST::TwilioError)
19
+
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'get',
23
+ url: 'https://events.twilio.com/v1/Schemas/id/Versions',
24
+ ))).to eq(true)
25
+ end
26
+
27
+ it "receives read_empty responses" do
28
+ @holodeck.mock(Twilio::Response.new(
29
+ 200,
30
+ %q[
31
+ {
32
+ "schema_versions": [],
33
+ "meta": {
34
+ "page": 0,
35
+ "page_size": 10,
36
+ "first_page_url": "https://events.twilio.com/v1/Schemas/DataTaps.TestEventSchema/Versions?PageSize=10&Page=0",
37
+ "previous_page_url": null,
38
+ "url": "https://events.twilio.com/v1/Schemas/DataTaps.TestEventSchema/Versions?PageSize=10&Page=0",
39
+ "next_page_url": null,
40
+ "key": "schema_versions"
41
+ }
42
+ }
43
+ ]
44
+ ))
45
+
46
+ actual = @client.events.v1.schemas('id') \
47
+ .versions.list()
48
+
49
+ expect(actual).to_not eq(nil)
50
+ end
51
+
52
+ it "receives read_results responses" do
53
+ @holodeck.mock(Twilio::Response.new(
54
+ 200,
55
+ %q[
56
+ {
57
+ "schema_versions": [
58
+ {
59
+ "id": "DataTaps.TestEventSchema",
60
+ "schema_version": 1,
61
+ "date_created": "2015-07-30T20:00:00Z",
62
+ "url": "https://events.twilio.com/v1/Schemas/DataTaps.TestEventSchema/Versions/1",
63
+ "raw": "https://events-schemas.twilio.com/DataTaps.TestEventSchema/1"
64
+ },
65
+ {
66
+ "id": "DataTaps.TestEventSchema",
67
+ "schema_version": 2,
68
+ "date_created": "2015-07-30T20:00:00Z",
69
+ "url": "https://events.twilio.com/v1/Schemas/DataTaps.TestEventSchema/Versions/2",
70
+ "raw": "https://events-schemas.twilio.com/DataTaps.TestEventSchema/2"
71
+ }
72
+ ],
73
+ "meta": {
74
+ "page": 0,
75
+ "page_size": 50,
76
+ "first_page_url": "https://events.twilio.com/v1/Schemas/DataTaps.TestEventSchema/Versions?PageSize=50&Page=0",
77
+ "previous_page_url": null,
78
+ "url": "https://events.twilio.com/v1/Schemas/DataTaps.TestEventSchema/Versions?PageSize=50&Page=0",
79
+ "next_page_url": null,
80
+ "key": "schema_versions"
81
+ }
82
+ }
83
+ ]
84
+ ))
85
+
86
+ actual = @client.events.v1.schemas('id') \
87
+ .versions.list()
88
+
89
+ expect(actual).to_not eq(nil)
90
+ end
91
+
92
+ it "can fetch" do
93
+ @holodeck.mock(Twilio::Response.new(500, ''))
94
+
95
+ expect {
96
+ @client.events.v1.schemas('id') \
97
+ .versions(1).fetch()
98
+ }.to raise_exception(Twilio::REST::TwilioError)
99
+
100
+ expect(
101
+ @holodeck.has_request?(Holodeck::Request.new(
102
+ method: 'get',
103
+ url: 'https://events.twilio.com/v1/Schemas/id/Versions/1',
104
+ ))).to eq(true)
105
+ end
106
+
107
+ it "receives fetch responses" do
108
+ @holodeck.mock(Twilio::Response.new(
109
+ 200,
110
+ %q[
111
+ {
112
+ "id": "DataTaps.TestEventSchema",
113
+ "schema_version": 1,
114
+ "date_created": "2015-07-30T20:00:00Z",
115
+ "url": "https://events.twilio.com/v1/Schemas/DataTaps.TestEventSchema/Versions/1",
116
+ "raw": "https://events-schemas.twilio.com/DataTaps.TestEventSchema/1"
117
+ }
118
+ ]
119
+ ))
120
+
121
+ actual = @client.events.v1.schemas('id') \
122
+ .versions(1).fetch()
123
+
124
+ expect(actual).to_not eq(nil)
125
+ end
126
+ end
@@ -0,0 +1,46 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require 'spec_helper.rb'
10
+
11
+ describe 'Schema' do
12
+ it "can fetch" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.events.v1.schemas('id').fetch()
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ expect(
20
+ @holodeck.has_request?(Holodeck::Request.new(
21
+ method: 'get',
22
+ url: 'https://events.twilio.com/v1/Schemas/id',
23
+ ))).to eq(true)
24
+ end
25
+
26
+ it "receives fetch responses" do
27
+ @holodeck.mock(Twilio::Response.new(
28
+ 200,
29
+ %q[
30
+ {
31
+ "id": "DataTaps.TestEventSchema",
32
+ "url": "https://events.twilio.com/v1/Schemas/DataTaps.TestEventSchema",
33
+ "last_created": "2018-07-30T20:00:00Z",
34
+ "last_version": 1,
35
+ "links": {
36
+ "versions": "https://events.twilio.com/v1/Schemas/DataTaps.TestEventSchema/Versions"
37
+ }
38
+ }
39
+ ]
40
+ ))
41
+
42
+ actual = @client.events.v1.schemas('id').fetch()
43
+
44
+ expect(actual).to_not eq(nil)
45
+ end
46
+ end