twilio-ruby 5.34.0 → 5.38.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +126 -0
  3. data/README.md +24 -3
  4. data/lib/twilio-ruby.rb +1 -1
  5. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +87 -87
  6. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +14 -0
  7. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +47 -9
  8. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +71 -71
  9. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +29 -29
  10. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +38 -3
  11. data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +12 -12
  12. data/lib/twilio-ruby/rest/autopilot.rb +6 -0
  13. data/lib/twilio-ruby/rest/autopilot/v1.rb +7 -0
  14. data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +0 -16
  15. data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +12 -3
  16. data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +198 -0
  17. data/lib/twilio-ruby/rest/client.rb +35 -15
  18. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +28 -3
  19. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +27 -4
  20. data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +2 -1
  21. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
  22. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +6 -3
  23. data/lib/twilio-ruby/rest/monitor/v1/alert.rb +8 -8
  24. data/lib/twilio-ruby/rest/notify/v1/service.rb +20 -1
  25. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +26 -0
  26. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +324 -0
  27. data/lib/twilio-ruby/rest/preview.rb +6 -0
  28. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +7 -0
  29. data/lib/twilio-ruby/rest/preview/trusted_comms/brands_information.rb +193 -0
  30. data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +26 -0
  31. data/lib/twilio-ruby/rest/{autopilot/v1/assistant/export_assistant.rb → preview/trusted_comms/business/brand.rb} +88 -71
  32. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +266 -0
  33. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +194 -0
  34. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +7 -0
  35. data/lib/twilio-ruby/rest/supersim.rb +18 -0
  36. data/lib/twilio-ruby/rest/supersim/v1.rb +30 -0
  37. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +63 -16
  38. data/lib/twilio-ruby/rest/supersim/v1/network.rb +315 -0
  39. data/lib/twilio-ruby/rest/{authy/v1/service.rb → supersim/v1/network_access_profile.rb} +95 -121
  40. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +352 -0
  41. data/lib/twilio-ruby/rest/verify.rb +9 -0
  42. data/lib/twilio-ruby/rest/verify/v2.rb +16 -0
  43. data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/form.rb +8 -8
  44. data/lib/twilio-ruby/rest/verify/v2/service.rb +74 -3
  45. data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/service/entity.rb +32 -8
  46. data/lib/twilio-ruby/rest/verify/v2/service/entity/access_token.rb +141 -0
  47. data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/service/entity/factor.rb +8 -8
  48. data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/service/entity/factor/challenge.rb +8 -8
  49. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -3
  50. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +425 -0
  51. data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +8 -4
  52. data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +8 -4
  53. data/lib/twilio-ruby/rest/voice.rb +36 -0
  54. data/lib/twilio-ruby/rest/voice/v1.rb +64 -0
  55. data/lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb +513 -0
  56. data/lib/twilio-ruby/rest/voice/v1/connection_policy.rb +379 -0
  57. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +458 -0
  58. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +366 -0
  59. data/lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb +346 -0
  60. data/lib/twilio-ruby/util/configuration.rb +9 -1
  61. data/lib/twilio-ruby/version.rb +1 -1
  62. data/spec/integration/api/v2010/account/call_spec.rb +5 -5
  63. data/spec/integration/api/v2010/account/conference/participant_spec.rb +177 -0
  64. data/spec/integration/api/v2010/account/conference_spec.rb +42 -14
  65. data/spec/integration/api/v2010/account/outgoing_caller_id_spec.rb +8 -14
  66. data/spec/integration/api/v2010/account/sip/domain_spec.rb +12 -4
  67. data/spec/integration/api/v2010/account/token_spec.rb +23 -11
  68. data/spec/integration/api/v2010/account/validation_request_spec.rb +1 -1
  69. data/spec/integration/autopilot/v1/assistant/query_spec.rb +4 -4
  70. data/spec/integration/autopilot/v1/assistant_spec.rb +4 -8
  71. data/spec/integration/autopilot/v1/restore_assistant_spec.rb +53 -0
  72. data/spec/integration/conversations/v1/conversation/participant_spec.rb +7 -0
  73. data/spec/integration/conversations/v1/conversation_spec.rb +16 -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/trusted_comms/brands_information_spec.rb +44 -0
  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/environment/log_spec.rb +1 -0
  83. data/spec/integration/supersim/v1/fleet_spec.rb +16 -7
  84. data/spec/integration/supersim/v1/network_access_profile/network_access_profile_network_spec.rb +179 -0
  85. data/spec/integration/supersim/v1/network_access_profile_spec.rb +223 -0
  86. data/spec/integration/supersim/v1/network_spec.rb +139 -0
  87. data/spec/integration/supersim/v1/sim_spec.rb +78 -6
  88. data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +13 -13
  89. data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +23 -23
  90. data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +28 -28
  91. data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +17 -17
  92. data/spec/integration/trunking/v1/trunk_spec.rb +33 -33
  93. data/spec/integration/{authy/v1 → verify/v2}/form_spec.rb +4 -4
  94. data/spec/integration/verify/v2/service/entity/access_token_spec.rb +46 -0
  95. data/spec/integration/{authy/v1 → verify/v2}/service/entity/factor/challenge_spec.rb +73 -73
  96. data/spec/integration/{authy/v1 → verify/v2}/service/entity/factor_spec.rb +54 -54
  97. data/spec/integration/verify/v2/service/entity_spec.rb +204 -0
  98. data/spec/integration/verify/v2/service/webhook_spec.rb +262 -0
  99. data/spec/integration/verify/v2/service_spec.rb +32 -4
  100. data/spec/integration/voice/v1/byoc_trunk_spec.rb +250 -0
  101. data/spec/integration/voice/v1/connection_policy/connection_policy_target_spec.rb +246 -0
  102. data/spec/integration/voice/v1/connection_policy_spec.rb +226 -0
  103. data/spec/integration/voice/v1/ip_record_spec.rb +223 -0
  104. data/spec/integration/voice/v1/source_ip_mapping_spec.rb +219 -0
  105. data/spec/rest/client_spec.rb +168 -58
  106. data/spec/util/configuration_spec.rb +12 -0
  107. data/twilio-ruby.gemspec +1 -1
  108. metadata +63 -23
  109. data/lib/twilio-ruby/rest/authy.rb +0 -55
  110. data/lib/twilio-ruby/rest/authy/v1.rb +0 -59
  111. data/spec/integration/authy/v1/service/entity_spec.rb +0 -201
  112. data/spec/integration/authy/v1/service_spec.rb +0 -231
  113. data/spec/integration/autopilot/v1/assistant/export_assistant_spec.rb +0 -49
@@ -0,0 +1,262 @@
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 'Webhook' do
12
+ it "can create" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
17
+ .webhooks.create(friendly_name: 'friendly_name', event_types: ['event_types'], webhook_url: 'webhook_url')
18
+ }.to raise_exception(Twilio::REST::TwilioError)
19
+
20
+ values = {
21
+ 'FriendlyName' => 'friendly_name',
22
+ 'EventTypes' => Twilio.serialize_list(['event_types']) { |e| e },
23
+ 'WebhookUrl' => 'webhook_url',
24
+ }
25
+ expect(
26
+ @holodeck.has_request?(Holodeck::Request.new(
27
+ method: 'post',
28
+ url: 'https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks',
29
+ data: values,
30
+ ))).to eq(true)
31
+ end
32
+
33
+ it "receives create responses" do
34
+ @holodeck.mock(Twilio::Response.new(
35
+ 201,
36
+ %q[
37
+ {
38
+ "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/YWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
39
+ "sid": "YWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
41
+ "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
42
+ "friendly_name": "name",
43
+ "event_types": [
44
+ "factor.deleted",
45
+ "factor.verified"
46
+ ],
47
+ "webhook_method": "POST",
48
+ "webhook_url": "https://owlbank.twilio.com",
49
+ "status": "enabled",
50
+ "date_created": "2015-07-30T20:00:00Z",
51
+ "date_updated": "2015-07-30T20:00:00Z"
52
+ }
53
+ ]
54
+ ))
55
+
56
+ actual = @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
57
+ .webhooks.create(friendly_name: 'friendly_name', event_types: ['event_types'], webhook_url: 'webhook_url')
58
+
59
+ expect(actual).to_not eq(nil)
60
+ end
61
+
62
+ it "can update" do
63
+ @holodeck.mock(Twilio::Response.new(500, ''))
64
+
65
+ expect {
66
+ @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
67
+ .webhooks('YWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
68
+ }.to raise_exception(Twilio::REST::TwilioError)
69
+
70
+ values = {}
71
+ expect(
72
+ @holodeck.has_request?(Holodeck::Request.new(
73
+ method: 'post',
74
+ url: 'https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks/YWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
75
+ ))).to eq(true)
76
+ end
77
+
78
+ it "receives update responses" do
79
+ @holodeck.mock(Twilio::Response.new(
80
+ 200,
81
+ %q[
82
+ {
83
+ "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/YWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
84
+ "sid": "YWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
85
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
86
+ "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
87
+ "friendly_name": "name",
88
+ "event_types": [
89
+ "factor.deleted",
90
+ "factor.verified"
91
+ ],
92
+ "webhook_method": "POST",
93
+ "webhook_url": "https://owlbank.twilio.com",
94
+ "status": "disabled",
95
+ "date_created": "2015-07-30T20:00:00Z",
96
+ "date_updated": "2015-07-30T20:00:00Z"
97
+ }
98
+ ]
99
+ ))
100
+
101
+ actual = @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
102
+ .webhooks('YWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
103
+
104
+ expect(actual).to_not eq(nil)
105
+ end
106
+
107
+ it "can delete" do
108
+ @holodeck.mock(Twilio::Response.new(500, ''))
109
+
110
+ expect {
111
+ @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
112
+ .webhooks('YWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
113
+ }.to raise_exception(Twilio::REST::TwilioError)
114
+
115
+ values = {}
116
+ expect(
117
+ @holodeck.has_request?(Holodeck::Request.new(
118
+ method: 'delete',
119
+ url: 'https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks/YWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
120
+ ))).to eq(true)
121
+ end
122
+
123
+ it "receives delete responses" do
124
+ @holodeck.mock(Twilio::Response.new(
125
+ 204,
126
+ nil,
127
+ ))
128
+
129
+ actual = @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
130
+ .webhooks('YWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
131
+
132
+ expect(actual).to eq(true)
133
+ end
134
+
135
+ it "can fetch" do
136
+ @holodeck.mock(Twilio::Response.new(500, ''))
137
+
138
+ expect {
139
+ @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
140
+ .webhooks('YWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
141
+ }.to raise_exception(Twilio::REST::TwilioError)
142
+
143
+ values = {}
144
+ expect(
145
+ @holodeck.has_request?(Holodeck::Request.new(
146
+ method: 'get',
147
+ url: 'https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks/YWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
148
+ ))).to eq(true)
149
+ end
150
+
151
+ it "receives fetch responses" do
152
+ @holodeck.mock(Twilio::Response.new(
153
+ 200,
154
+ %q[
155
+ {
156
+ "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/YWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
157
+ "sid": "YWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
158
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
159
+ "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
160
+ "friendly_name": "name",
161
+ "event_types": [
162
+ "factor.deleted",
163
+ "factor.verified"
164
+ ],
165
+ "webhook_method": "POST",
166
+ "webhook_url": "https://owlbank.twilio.com",
167
+ "status": "enabled",
168
+ "date_created": "2015-07-30T20:00:00Z",
169
+ "date_updated": "2015-07-30T20:00:00Z"
170
+ }
171
+ ]
172
+ ))
173
+
174
+ actual = @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
175
+ .webhooks('YWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
176
+
177
+ expect(actual).to_not eq(nil)
178
+ end
179
+
180
+ it "can read" do
181
+ @holodeck.mock(Twilio::Response.new(500, ''))
182
+
183
+ expect {
184
+ @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
185
+ .webhooks.list()
186
+ }.to raise_exception(Twilio::REST::TwilioError)
187
+
188
+ values = {}
189
+ expect(
190
+ @holodeck.has_request?(Holodeck::Request.new(
191
+ method: 'get',
192
+ url: 'https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks',
193
+ ))).to eq(true)
194
+ end
195
+
196
+ it "receives read_empty responses" do
197
+ @holodeck.mock(Twilio::Response.new(
198
+ 200,
199
+ %q[
200
+ {
201
+ "webhooks": [],
202
+ "meta": {
203
+ "page": 0,
204
+ "page_size": 50,
205
+ "first_page_url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=50&Page=0",
206
+ "previous_page_url": null,
207
+ "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=50&Page=0",
208
+ "next_page_url": null,
209
+ "key": "webhooks"
210
+ }
211
+ }
212
+ ]
213
+ ))
214
+
215
+ actual = @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
216
+ .webhooks.list()
217
+
218
+ expect(actual).to_not eq(nil)
219
+ end
220
+
221
+ it "receives read_full responses" do
222
+ @holodeck.mock(Twilio::Response.new(
223
+ 200,
224
+ %q[
225
+ {
226
+ "webhooks": [
227
+ {
228
+ "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/YWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
229
+ "sid": "YWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
230
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
231
+ "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
232
+ "friendly_name": "name",
233
+ "event_types": [
234
+ "factor.deleted",
235
+ "factor.verified"
236
+ ],
237
+ "webhook_method": "POST",
238
+ "webhook_url": "https://owlbank.twilio.com",
239
+ "status": "enabled",
240
+ "date_created": "2015-07-30T20:00:00Z",
241
+ "date_updated": "2015-07-30T20:00:00Z"
242
+ }
243
+ ],
244
+ "meta": {
245
+ "page": 0,
246
+ "page_size": 50,
247
+ "first_page_url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=50&Page=0",
248
+ "previous_page_url": null,
249
+ "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=50&Page=0",
250
+ "next_page_url": null,
251
+ "key": "webhooks"
252
+ }
253
+ }
254
+ ]
255
+ ))
256
+
257
+ actual = @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
258
+ .webhooks.list()
259
+
260
+ expect(actual).to_not eq(nil)
261
+ end
262
+ end
@@ -41,6 +41,11 @@ describe 'Service' do
41
41
  "tts_name": "name",
42
42
  "mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
43
43
  "do_not_share_warning_enabled": false,
44
+ "custom_code_enabled": true,
45
+ "push": {
46
+ "include_date": true,
47
+ "notify_service_sid": null
48
+ },
44
49
  "date_created": "2015-07-30T20:00:00Z",
45
50
  "date_updated": "2015-07-30T20:00:00Z",
46
51
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -48,7 +53,9 @@ describe 'Service' do
48
53
  "verification_checks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/VerificationCheck",
49
54
  "verifications": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications",
50
55
  "rate_limits": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits",
51
- "messaging_configurations": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations"
56
+ "messaging_configurations": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations",
57
+ "entities": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities",
58
+ "webhooks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
52
59
  }
53
60
  }
54
61
  ]
@@ -90,6 +97,11 @@ describe 'Service' do
90
97
  "tts_name": "name",
91
98
  "mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
92
99
  "do_not_share_warning_enabled": false,
100
+ "custom_code_enabled": true,
101
+ "push": {
102
+ "include_date": true,
103
+ "notify_service_sid": null
104
+ },
93
105
  "date_created": "2015-07-30T20:00:00Z",
94
106
  "date_updated": "2015-07-30T20:00:00Z",
95
107
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -97,7 +109,9 @@ describe 'Service' do
97
109
  "verification_checks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/VerificationCheck",
98
110
  "verifications": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications",
99
111
  "rate_limits": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits",
100
- "messaging_configurations": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations"
112
+ "messaging_configurations": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations",
113
+ "entities": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities",
114
+ "webhooks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
101
115
  }
102
116
  }
103
117
  ]
@@ -176,6 +190,11 @@ describe 'Service' do
176
190
  "tts_name": "name",
177
191
  "mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
178
192
  "do_not_share_warning_enabled": false,
193
+ "custom_code_enabled": true,
194
+ "push": {
195
+ "include_date": true,
196
+ "notify_service_sid": null
197
+ },
179
198
  "date_created": "2015-07-30T20:00:00Z",
180
199
  "date_updated": "2015-07-30T20:00:00Z",
181
200
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -183,7 +202,9 @@ describe 'Service' do
183
202
  "verification_checks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/VerificationCheck",
184
203
  "verifications": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications",
185
204
  "rate_limits": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits",
186
- "messaging_configurations": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations"
205
+ "messaging_configurations": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations",
206
+ "entities": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities",
207
+ "webhooks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
187
208
  }
188
209
  }
189
210
  ]
@@ -227,6 +248,11 @@ describe 'Service' do
227
248
  "tts_name": "name",
228
249
  "mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
229
250
  "do_not_share_warning_enabled": false,
251
+ "custom_code_enabled": true,
252
+ "push": {
253
+ "include_date": true,
254
+ "notify_service_sid": null
255
+ },
230
256
  "date_created": "2015-07-30T20:00:00Z",
231
257
  "date_updated": "2015-07-30T20:00:00Z",
232
258
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -234,7 +260,9 @@ describe 'Service' do
234
260
  "verification_checks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/VerificationCheck",
235
261
  "verifications": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications",
236
262
  "rate_limits": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits",
237
- "messaging_configurations": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations"
263
+ "messaging_configurations": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations",
264
+ "entities": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities",
265
+ "webhooks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
238
266
  }
239
267
  }
240
268
  ]
@@ -0,0 +1,250 @@
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 'ByocTrunk' do
12
+ it "can create" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.voice.v1.byoc_trunks.create()
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {}
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'post',
23
+ url: 'https://voice.twilio.com/v1/ByocTrunks',
24
+ ))).to eq(true)
25
+ end
26
+
27
+ it "receives create responses" do
28
+ @holodeck.mock(Twilio::Response.new(
29
+ 201,
30
+ %q[
31
+ {
32
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
+ "sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
+ "friendly_name": "friendly_name",
35
+ "voice_url": "https://byoc.example.com/twilio/app",
36
+ "voice_method": "POST",
37
+ "voice_fallback_method": "POST",
38
+ "voice_fallback_url": "https://byoc.example.com/twilio/fallback",
39
+ "status_callback_method": "POST",
40
+ "status_callback_url": "https://byoc.example.com/twilio/status_callback",
41
+ "cnam_lookup_enabled": false,
42
+ "connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
43
+ "from_domain_sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
44
+ "date_created": "2020-03-18T23:31:36Z",
45
+ "date_updated": "2020-03-18T23:31:36Z",
46
+ "url": "https://voice.twilio.com/v1/ByocTrunks/BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
47
+ }
48
+ ]
49
+ ))
50
+
51
+ actual = @client.voice.v1.byoc_trunks.create()
52
+
53
+ expect(actual).to_not eq(nil)
54
+ end
55
+
56
+ it "can fetch" do
57
+ @holodeck.mock(Twilio::Response.new(500, ''))
58
+
59
+ expect {
60
+ @client.voice.v1.byoc_trunks('BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
61
+ }.to raise_exception(Twilio::REST::TwilioError)
62
+
63
+ values = {}
64
+ expect(
65
+ @holodeck.has_request?(Holodeck::Request.new(
66
+ method: 'get',
67
+ url: 'https://voice.twilio.com/v1/ByocTrunks/BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
68
+ ))).to eq(true)
69
+ end
70
+
71
+ it "receives fetch responses" do
72
+ @holodeck.mock(Twilio::Response.new(
73
+ 200,
74
+ %q[
75
+ {
76
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
77
+ "sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
78
+ "friendly_name": "friendly_name",
79
+ "voice_url": "https://byoc.example.com/twilio/app",
80
+ "voice_method": "POST",
81
+ "voice_fallback_method": "POST",
82
+ "voice_fallback_url": "https://byoc.example.com/twilio/fallback",
83
+ "status_callback_method": "POST",
84
+ "status_callback_url": "https://byoc.example.com/twilio/status_callback",
85
+ "cnam_lookup_enabled": false,
86
+ "connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
87
+ "from_domain_sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
88
+ "date_created": "2020-03-18T23:31:36Z",
89
+ "date_updated": "2020-03-18T23:31:37Z",
90
+ "url": "https://voice.twilio.com/v1/ByocTrunks/BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
91
+ }
92
+ ]
93
+ ))
94
+
95
+ actual = @client.voice.v1.byoc_trunks('BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
96
+
97
+ expect(actual).to_not eq(nil)
98
+ end
99
+
100
+ it "can read" do
101
+ @holodeck.mock(Twilio::Response.new(500, ''))
102
+
103
+ expect {
104
+ @client.voice.v1.byoc_trunks.list()
105
+ }.to raise_exception(Twilio::REST::TwilioError)
106
+
107
+ values = {}
108
+ expect(
109
+ @holodeck.has_request?(Holodeck::Request.new(
110
+ method: 'get',
111
+ url: 'https://voice.twilio.com/v1/ByocTrunks',
112
+ ))).to eq(true)
113
+ end
114
+
115
+ it "receives read_full responses" do
116
+ @holodeck.mock(Twilio::Response.new(
117
+ 200,
118
+ %q[
119
+ {
120
+ "meta": {
121
+ "page": 0,
122
+ "page_size": 50,
123
+ "first_page_url": "https://voice.twilio.com/v1/ByocTrunks?PageSize=50&Page=0",
124
+ "previous_page_url": null,
125
+ "url": "https://voice.twilio.com/v1/ByocTrunks?PageSize=50&Page=0",
126
+ "next_page_url": null,
127
+ "key": "byoc_trunks"
128
+ },
129
+ "byoc_trunks": [
130
+ {
131
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
132
+ "sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
133
+ "friendly_name": "friendly_name",
134
+ "voice_url": "https://byoc.example.com/twilio/app",
135
+ "voice_method": "POST",
136
+ "voice_fallback_method": "POST",
137
+ "voice_fallback_url": "https://byoc.example.com/twilio/fallback",
138
+ "status_callback_method": "POST",
139
+ "status_callback_url": "https://byoc.example.com/twilio/status_callback",
140
+ "cnam_lookup_enabled": false,
141
+ "connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
142
+ "from_domain_sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
143
+ "date_created": "2020-03-18T23:31:36Z",
144
+ "date_updated": "2020-03-18T23:31:37Z",
145
+ "url": "https://voice.twilio.com/v1/ByocTrunks/BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
146
+ }
147
+ ]
148
+ }
149
+ ]
150
+ ))
151
+
152
+ actual = @client.voice.v1.byoc_trunks.list()
153
+
154
+ expect(actual).to_not eq(nil)
155
+ end
156
+
157
+ it "receives read_empty responses" do
158
+ @holodeck.mock(Twilio::Response.new(
159
+ 200,
160
+ %q[
161
+ {
162
+ "meta": {
163
+ "page": 0,
164
+ "page_size": 50,
165
+ "first_page_url": "https://voice.twilio.com/v1/ByocTrunks?PageSize=50&Page=0",
166
+ "previous_page_url": null,
167
+ "url": "https://voice.twilio.com/v1/ByocTrunks?PageSize=50&Page=0",
168
+ "next_page_url": null,
169
+ "key": "byoc_trunks"
170
+ },
171
+ "byoc_trunks": []
172
+ }
173
+ ]
174
+ ))
175
+
176
+ actual = @client.voice.v1.byoc_trunks.list()
177
+
178
+ expect(actual).to_not eq(nil)
179
+ end
180
+
181
+ it "can update" do
182
+ @holodeck.mock(Twilio::Response.new(500, ''))
183
+
184
+ expect {
185
+ @client.voice.v1.byoc_trunks('BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
186
+ }.to raise_exception(Twilio::REST::TwilioError)
187
+
188
+ values = {}
189
+ expect(
190
+ @holodeck.has_request?(Holodeck::Request.new(
191
+ method: 'post',
192
+ url: 'https://voice.twilio.com/v1/ByocTrunks/BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
193
+ ))).to eq(true)
194
+ end
195
+
196
+ it "receives update responses" do
197
+ @holodeck.mock(Twilio::Response.new(
198
+ 200,
199
+ %q[
200
+ {
201
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
202
+ "sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
203
+ "friendly_name": "update_name",
204
+ "voice_url": "https://byoc.example.com/twilio_updated/app",
205
+ "voice_method": "GET",
206
+ "voice_fallback_method": "GET",
207
+ "voice_fallback_url": "https://byoc.example.com/twilio_updated/fallback",
208
+ "status_callback_method": "GET",
209
+ "status_callback_url": "https://byoc.example.com/twilio_updated/status_callback",
210
+ "cnam_lookup_enabled": true,
211
+ "connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
212
+ "from_domain_sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
213
+ "date_created": "2020-03-18T23:31:36Z",
214
+ "date_updated": "2020-03-18T23:31:37Z",
215
+ "url": "https://voice.twilio.com/v1/ByocTrunks/BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
216
+ }
217
+ ]
218
+ ))
219
+
220
+ actual = @client.voice.v1.byoc_trunks('BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
221
+
222
+ expect(actual).to_not eq(nil)
223
+ end
224
+
225
+ it "can delete" do
226
+ @holodeck.mock(Twilio::Response.new(500, ''))
227
+
228
+ expect {
229
+ @client.voice.v1.byoc_trunks('BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
230
+ }.to raise_exception(Twilio::REST::TwilioError)
231
+
232
+ values = {}
233
+ expect(
234
+ @holodeck.has_request?(Holodeck::Request.new(
235
+ method: 'delete',
236
+ url: 'https://voice.twilio.com/v1/ByocTrunks/BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
237
+ ))).to eq(true)
238
+ end
239
+
240
+ it "receives delete responses" do
241
+ @holodeck.mock(Twilio::Response.new(
242
+ 204,
243
+ nil,
244
+ ))
245
+
246
+ actual = @client.voice.v1.byoc_trunks('BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
247
+
248
+ expect(actual).to eq(true)
249
+ end
250
+ end