twilio-ruby 5.34.0 → 5.34.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +32 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +38 -3
  5. data/lib/twilio-ruby/rest/autopilot.rb +6 -0
  6. data/lib/twilio-ruby/rest/autopilot/v1.rb +7 -0
  7. data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +198 -0
  8. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +26 -0
  9. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +324 -0
  10. data/lib/twilio-ruby/rest/supersim.rb +8 -0
  11. data/lib/twilio-ruby/rest/supersim/v1.rb +15 -0
  12. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +44 -10
  13. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +337 -0
  14. data/lib/twilio-ruby/rest/verify/v2/service.rb +22 -3
  15. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -3
  16. data/lib/twilio-ruby/rest/voice.rb +36 -0
  17. data/lib/twilio-ruby/rest/voice/v1.rb +64 -0
  18. data/lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb +513 -0
  19. data/lib/twilio-ruby/rest/voice/v1/connection_policy.rb +379 -0
  20. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +458 -0
  21. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +366 -0
  22. data/lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb +346 -0
  23. data/lib/twilio-ruby/version.rb +1 -1
  24. data/spec/integration/api/v2010/account/sip/domain_spec.rb +12 -4
  25. data/spec/integration/api/v2010/account/token_spec.rb +23 -11
  26. data/spec/integration/autopilot/v1/restore_assistant_spec.rb +53 -0
  27. data/spec/integration/numbers/v2/regulatory_compliance/bundle/evaluation_spec.rb +623 -0
  28. data/spec/integration/numbers/v2/regulatory_compliance/bundle_spec.rb +4 -0
  29. data/spec/integration/supersim/v1/fleet_spec.rb +8 -4
  30. data/spec/integration/supersim/v1/network_access_profile_spec.rb +208 -0
  31. data/spec/integration/verify/v2/service_spec.rb +4 -0
  32. data/spec/integration/voice/v1/byoc_trunk_spec.rb +250 -0
  33. data/spec/integration/voice/v1/connection_policy/connection_policy_target_spec.rb +246 -0
  34. data/spec/integration/voice/v1/connection_policy_spec.rb +226 -0
  35. data/spec/integration/voice/v1/ip_record_spec.rb +223 -0
  36. data/spec/integration/voice/v1/source_ip_mapping_spec.rb +219 -0
  37. data/twilio-ruby.gemspec +1 -1
  38. metadata +28 -3
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.34.0'
2
+ VERSION = '5.34.1'
3
3
  end
@@ -54,7 +54,9 @@ describe 'Domain' do
54
54
  "voice_status_callback_url": null,
55
55
  "voice_url": "https://dundermifflin.example.com/twilio/app.php",
56
56
  "emergency_calling_enabled": true,
57
- "secure": true
57
+ "secure": true,
58
+ "byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
59
+ "emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
58
60
  }
59
61
  ],
60
62
  "start": 0,
@@ -145,7 +147,9 @@ describe 'Domain' do
145
147
  "voice_status_callback_url": null,
146
148
  "voice_url": "https://dundermifflin.example.com/twilio/app.php",
147
149
  "emergency_calling_enabled": true,
148
- "secure": true
150
+ "secure": true,
151
+ "byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
152
+ "emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
149
153
  }
150
154
  ]
151
155
  ))
@@ -200,7 +204,9 @@ describe 'Domain' do
200
204
  "voice_status_callback_url": null,
201
205
  "voice_url": "https://dundermifflin.example.com/twilio/app.php",
202
206
  "emergency_calling_enabled": true,
203
- "secure": true
207
+ "secure": true,
208
+ "byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
209
+ "emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
204
210
  }
205
211
  ]
206
212
  ))
@@ -255,7 +261,9 @@ describe 'Domain' do
255
261
  "voice_status_callback_url": null,
256
262
  "voice_url": "https://dundermifflin.example.com/twilio/app.php",
257
263
  "emergency_calling_enabled": true,
258
- "secure": true
264
+ "secure": true,
265
+ "byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
266
+ "emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
259
267
  }
260
268
  ]
261
269
  ))
@@ -30,24 +30,36 @@ describe 'Token' do
30
30
  201,
31
31
  %q[
32
32
  {
33
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
- "date_created": "Fri, 24 Jul 2015 18:43:58 +0000",
35
- "date_updated": "Fri, 24 Jul 2015 18:43:58 +0000",
33
+ "username": "dc2d2894d5a9023620c467b0e71cfa6a35457e6679785ed6ae9856fe5bdfa269",
36
34
  "ice_servers": [
37
35
  {
38
- "url": "stun:global.stun:3478?transport=udp",
39
- "urls": "stun:global.stun:3478?transport=udp"
36
+ "url": "stun:global.stun.twilio.com:3478?transport=udp",
37
+ "urls": "stun:global.stun.twilio.com:3478?transport=udp"
38
+ },
39
+ {
40
+ "username": "dc2d2894d5a9023620c467b0e71cfa6a35457e6679785ed6ae9856fe5bdfa269",
41
+ "credential": "tE2DajzSJwnsSbc123",
42
+ "url": "turn:global.turn.twilio.com:3478?transport=udp",
43
+ "urls": "turn:global.turn.twilio.com:3478?transport=udp"
40
44
  },
41
45
  {
42
- "credential": "5SR2x8mZK1lTFJW3NVgLGw6UM9C0dja4jI/Hdw3xr+w=",
43
- "url": "turn:global.turn:3478?transport=udp",
44
- "urls": "turn:global.turn:3478?transport=udp",
45
- "username": "cda92e5006c7810494639fc466ecc80182cef8183fdf400f84c4126f3b59d0bb"
46
+ "username": "dc2d2894d5a9023620c467b0e71cfa6a35457e6679785ed6ae9856fe5bdfa269",
47
+ "credential": "tE2DajzSJwnsSbc123",
48
+ "url": "turn:global.turn.twilio.com:3478?transport=tcp",
49
+ "urls": "turn:global.turn.twilio.com:3478?transport=tcp"
50
+ },
51
+ {
52
+ "username": "dc2d2894d5a9023620c467b0e71cfa6a35457e6679785ed6ae9856fe5bdfa269",
53
+ "credential": "tE2DajzSJwnsSbc123",
54
+ "url": "turn:global.turn.twilio.com:443?transport=tcp",
55
+ "urls": "turn:global.turn.twilio.com:443?transport=tcp"
46
56
  }
47
57
  ],
48
- "password": "5SR2x8mZK1lTFJW3NVgLGw6UM9C0dja4jI/Hdw3xr+w=",
58
+ "date_updated": "Fri, 01 May 2020 01:42:57 +0000",
59
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
49
60
  "ttl": "86400",
50
- "username": "cda92e5006c7810494639fc466ecc80182cef8183fdf400f84c4126f3b59d0bb"
61
+ "date_created": "Fri, 01 May 2020 01:42:57 +0000",
62
+ "password": "tE2DajzSJwnsSbc123"
51
63
  }
52
64
  ]
53
65
  ))
@@ -0,0 +1,53 @@
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 'RestoreAssistant' do
12
+ it "can update" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.autopilot.v1.restore_assistant.update(assistant: 'UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {'Assistant' => 'UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', }
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'post',
23
+ url: 'https://autopilot.twilio.com/v1/Assistants/Restore',
24
+ data: values,
25
+ ))).to eq(true)
26
+ end
27
+
28
+ it "receives update responses" do
29
+ @holodeck.mock(Twilio::Response.new(
30
+ 200,
31
+ %q[
32
+ {
33
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
+ "sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35
+ "date_created": "2017-07-04T08:34:00Z",
36
+ "date_updated": "2017-07-04T08:34:00Z",
37
+ "unique_name": "so-so-unique",
38
+ "friendly_name": "so so friendly",
39
+ "needs_model_build": false,
40
+ "latest_model_build_sid": null,
41
+ "log_queries": true,
42
+ "development_stage": "in-development",
43
+ "callback_url": "https://example.com/callback_url",
44
+ "callback_events": "model_build_completed model_build_failed"
45
+ }
46
+ ]
47
+ ))
48
+
49
+ actual = @client.autopilot.v1.restore_assistant.update(assistant: 'UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
50
+
51
+ expect(actual).to_not eq(nil)
52
+ end
53
+ end
@@ -0,0 +1,623 @@
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 'Evaluation' do
12
+ it "can create" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.numbers.v2.regulatory_compliance \
17
+ .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
18
+ .evaluations.create()
19
+ }.to raise_exception(Twilio::REST::TwilioError)
20
+
21
+ values = {}
22
+ expect(
23
+ @holodeck.has_request?(Holodeck::Request.new(
24
+ method: 'post',
25
+ url: 'https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Evaluations',
26
+ ))).to eq(true)
27
+ end
28
+
29
+ it "receives create responses" do
30
+ @holodeck.mock(Twilio::Response.new(
31
+ 201,
32
+ %q[
33
+ {
34
+ "sid": "ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
36
+ "regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
37
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
38
+ "status": "noncompliant",
39
+ "date_created": "2020-04-28T18:14:01Z",
40
+ "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations/ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
41
+ "results": [
42
+ {
43
+ "friendly_name": "Business",
44
+ "object_type": "business",
45
+ "passed": false,
46
+ "failure_reason": "A Business End-User is missing. Please add one to the regulatory bundle.",
47
+ "error_code": 22214,
48
+ "valid": [],
49
+ "invalid": [
50
+ {
51
+ "friendly_name": "Business Name",
52
+ "object_field": "business_name",
53
+ "failure_reason": "The Business Name is missing. Please enter in a Business Name on the Business information.",
54
+ "error_code": 22215
55
+ },
56
+ {
57
+ "friendly_name": "Business Registration Number",
58
+ "object_field": "business_registration_number",
59
+ "failure_reason": "The Business Registration Number is missing. Please enter in a Business Registration Number on the Business information.",
60
+ "error_code": 22215
61
+ },
62
+ {
63
+ "friendly_name": "First Name",
64
+ "object_field": "first_name",
65
+ "failure_reason": "The First Name is missing. Please enter in a First Name on the Business information.",
66
+ "error_code": 22215
67
+ },
68
+ {
69
+ "friendly_name": "Last Name",
70
+ "object_field": "last_name",
71
+ "failure_reason": "The Last Name is missing. Please enter in a Last Name on the Business information.",
72
+ "error_code": 22215
73
+ }
74
+ ],
75
+ "requirement_friendly_name": "Business",
76
+ "requirement_name": "business_info"
77
+ },
78
+ {
79
+ "friendly_name": "Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative",
80
+ "object_type": "commercial_registrar_excerpt",
81
+ "passed": false,
82
+ "failure_reason": "An Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative is missing. Please add one to the regulatory bundle.",
83
+ "error_code": 22216,
84
+ "valid": [],
85
+ "invalid": [
86
+ {
87
+ "friendly_name": "Business Name",
88
+ "object_field": "business_name",
89
+ "failure_reason": "The Business Name is missing. Or, it does not match the Business Name you entered within Business information. Please enter in the Business Name shown on the Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative or make sure both Business Name fields use the same exact inputs.",
90
+ "error_code": 22217
91
+ }
92
+ ],
93
+ "requirement_friendly_name": "Business Name",
94
+ "requirement_name": "business_name_info"
95
+ },
96
+ {
97
+ "friendly_name": "Excerpt from the commercial register showing French address",
98
+ "object_type": "commercial_registrar_excerpt",
99
+ "passed": false,
100
+ "failure_reason": "An Excerpt from the commercial register showing French address is missing. Please add one to the regulatory bundle.",
101
+ "error_code": 22216,
102
+ "valid": [],
103
+ "invalid": [
104
+ {
105
+ "friendly_name": "Address sid(s)",
106
+ "object_field": "address_sids",
107
+ "failure_reason": "The Address is missing. Please enter in the address shown on the Excerpt from the commercial register showing French address.",
108
+ "error_code": 22219
109
+ }
110
+ ],
111
+ "requirement_friendly_name": "Business Address (Proof of Address)",
112
+ "requirement_name": "business_address_proof_info"
113
+ },
114
+ {
115
+ "friendly_name": "Excerpt from the commercial register (Extrait K-bis)",
116
+ "object_type": "commercial_registrar_excerpt",
117
+ "passed": false,
118
+ "failure_reason": "An Excerpt from the commercial register (Extrait K-bis) is missing. Please add one to the regulatory bundle.",
119
+ "error_code": 22216,
120
+ "valid": [],
121
+ "invalid": [
122
+ {
123
+ "friendly_name": "Document Number",
124
+ "object_field": "document_number",
125
+ "failure_reason": "The Document Number is missing. Please enter in the Document Number shown on the Excerpt from the commercial register (Extrait K-bis).",
126
+ "error_code": 22217
127
+ }
128
+ ],
129
+ "requirement_friendly_name": "Business Registration Number",
130
+ "requirement_name": "business_reg_no_info"
131
+ },
132
+ {
133
+ "friendly_name": "Government-issued ID",
134
+ "object_type": "government_issued_document",
135
+ "passed": false,
136
+ "failure_reason": "A Government-issued ID is missing. Please add one to the regulatory bundle.",
137
+ "error_code": 22216,
138
+ "valid": [],
139
+ "invalid": [
140
+ {
141
+ "friendly_name": "First Name",
142
+ "object_field": "first_name",
143
+ "failure_reason": "The First Name is missing. Or, it does not match the First Name you entered within Business information. Please enter in the First Name shown on the Government-issued ID or make sure both First Name fields use the same exact inputs.",
144
+ "error_code": 22217
145
+ },
146
+ {
147
+ "friendly_name": "Last Name",
148
+ "object_field": "last_name",
149
+ "failure_reason": "The Last Name is missing. Or, it does not match the Last Name you entered within Business information. Please enter in the Last Name shown on the Government-issued ID or make sure both Last Name fields use the same exact inputs.",
150
+ "error_code": 22217
151
+ }
152
+ ],
153
+ "requirement_friendly_name": "Name of Authorized Representative",
154
+ "requirement_name": "name_of_auth_rep_info"
155
+ },
156
+ {
157
+ "friendly_name": "Executed Copy of Power of Attorney",
158
+ "object_type": "power_of_attorney",
159
+ "passed": false,
160
+ "failure_reason": "An Executed Copy of Power of Attorney is missing. Please add one to the regulatory bundle.",
161
+ "error_code": 22216,
162
+ "valid": [],
163
+ "invalid": [],
164
+ "requirement_friendly_name": "Power of Attorney",
165
+ "requirement_name": "power_of_attorney_info"
166
+ },
167
+ {
168
+ "friendly_name": "Government-issued ID",
169
+ "object_type": "government_issued_document",
170
+ "passed": false,
171
+ "failure_reason": "A Government-issued ID is missing. Please add one to the regulatory bundle.",
172
+ "error_code": 22216,
173
+ "valid": [],
174
+ "invalid": [
175
+ {
176
+ "friendly_name": "First Name",
177
+ "object_field": "first_name",
178
+ "failure_reason": "The First Name is missing on the Governnment-Issued ID.",
179
+ "error_code": 22217
180
+ },
181
+ {
182
+ "friendly_name": "Last Name",
183
+ "object_field": "last_name",
184
+ "failure_reason": "The Last Name is missing on the Government-issued ID",
185
+ "error_code": 22217
186
+ }
187
+ ],
188
+ "requirement_friendly_name": "Name of Person granted the Power of Attorney",
189
+ "requirement_name": "name_in_power_of_attorney_info"
190
+ }
191
+ ]
192
+ }
193
+ ]
194
+ ))
195
+
196
+ actual = @client.numbers.v2.regulatory_compliance \
197
+ .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
198
+ .evaluations.create()
199
+
200
+ expect(actual).to_not eq(nil)
201
+ end
202
+
203
+ it "can read" do
204
+ @holodeck.mock(Twilio::Response.new(500, ''))
205
+
206
+ expect {
207
+ @client.numbers.v2.regulatory_compliance \
208
+ .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
209
+ .evaluations.list()
210
+ }.to raise_exception(Twilio::REST::TwilioError)
211
+
212
+ values = {}
213
+ expect(
214
+ @holodeck.has_request?(Holodeck::Request.new(
215
+ method: 'get',
216
+ url: 'https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Evaluations',
217
+ ))).to eq(true)
218
+ end
219
+
220
+ it "receives read_empty responses" do
221
+ @holodeck.mock(Twilio::Response.new(
222
+ 200,
223
+ %q[
224
+ {
225
+ "results": [],
226
+ "meta": {
227
+ "page": 0,
228
+ "page_size": 50,
229
+ "first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations?PageSize=50&Page=0",
230
+ "previous_page_url": null,
231
+ "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations?PageSize=50&Page=0",
232
+ "next_page_url": null,
233
+ "key": "results"
234
+ }
235
+ }
236
+ ]
237
+ ))
238
+
239
+ actual = @client.numbers.v2.regulatory_compliance \
240
+ .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
241
+ .evaluations.list()
242
+
243
+ expect(actual).to_not eq(nil)
244
+ end
245
+
246
+ it "receives read_full responses" do
247
+ @holodeck.mock(Twilio::Response.new(
248
+ 200,
249
+ %q[
250
+ {
251
+ "results": [
252
+ {
253
+ "sid": "ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
254
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
255
+ "regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
256
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
257
+ "status": "noncompliant",
258
+ "date_created": "2020-04-28T18:14:01Z",
259
+ "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations/ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
260
+ "results": [
261
+ {
262
+ "friendly_name": "Business",
263
+ "object_type": "business",
264
+ "passed": false,
265
+ "failure_reason": "A Business End-User is missing. Please add one to the regulatory bundle.",
266
+ "error_code": 22214,
267
+ "valid": [],
268
+ "invalid": [
269
+ {
270
+ "friendly_name": "Business Name",
271
+ "object_field": "business_name",
272
+ "failure_reason": "The Business Name is missing. Please enter in a Business Name on the Business information.",
273
+ "error_code": 22215
274
+ },
275
+ {
276
+ "friendly_name": "Business Registration Number",
277
+ "object_field": "business_registration_number",
278
+ "failure_reason": "The Business Registration Number is missing. Please enter in a Business Registration Number on the Business information.",
279
+ "error_code": 22215
280
+ },
281
+ {
282
+ "friendly_name": "First Name",
283
+ "object_field": "first_name",
284
+ "failure_reason": "The First Name is missing. Please enter in a First Name on the Business information.",
285
+ "error_code": 22215
286
+ },
287
+ {
288
+ "friendly_name": "Last Name",
289
+ "object_field": "last_name",
290
+ "failure_reason": "The Last Name is missing. Please enter in a Last Name on the Business information.",
291
+ "error_code": 22215
292
+ }
293
+ ],
294
+ "requirement_friendly_name": "Business",
295
+ "requirement_name": "business_info"
296
+ },
297
+ {
298
+ "friendly_name": "Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative",
299
+ "object_type": "commercial_registrar_excerpt",
300
+ "passed": false,
301
+ "failure_reason": "An Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative is missing. Please add one to the regulatory bundle.",
302
+ "error_code": 22216,
303
+ "valid": [],
304
+ "invalid": [
305
+ {
306
+ "friendly_name": "Business Name",
307
+ "object_field": "business_name",
308
+ "failure_reason": "The Business Name is missing. Or, it does not match the Business Name you entered within Business information. Please enter in the Business Name shown on the Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative or make sure both Business Name fields use the same exact inputs.",
309
+ "error_code": 22217
310
+ }
311
+ ],
312
+ "requirement_friendly_name": "Business Name",
313
+ "requirement_name": "business_name_info"
314
+ },
315
+ {
316
+ "friendly_name": "Excerpt from the commercial register showing French address",
317
+ "object_type": "commercial_registrar_excerpt",
318
+ "passed": false,
319
+ "failure_reason": "An Excerpt from the commercial register showing French address is missing. Please add one to the regulatory bundle.",
320
+ "error_code": 22216,
321
+ "valid": [],
322
+ "invalid": [
323
+ {
324
+ "friendly_name": "Address sid(s)",
325
+ "object_field": "address_sids",
326
+ "failure_reason": "The Address is missing. Please enter in the address shown on the Excerpt from the commercial register showing French address.",
327
+ "error_code": 22219
328
+ }
329
+ ],
330
+ "requirement_friendly_name": "Business Address (Proof of Address)",
331
+ "requirement_name": "business_address_proof_info"
332
+ },
333
+ {
334
+ "friendly_name": "Excerpt from the commercial register (Extrait K-bis)",
335
+ "object_type": "commercial_registrar_excerpt",
336
+ "passed": false,
337
+ "failure_reason": "An Excerpt from the commercial register (Extrait K-bis) is missing. Please add one to the regulatory bundle.",
338
+ "error_code": 22216,
339
+ "valid": [],
340
+ "invalid": [
341
+ {
342
+ "friendly_name": "Document Number",
343
+ "object_field": "document_number",
344
+ "failure_reason": "The Document Number is missing. Please enter in the Document Number shown on the Excerpt from the commercial register (Extrait K-bis).",
345
+ "error_code": 22217
346
+ }
347
+ ],
348
+ "requirement_friendly_name": "Business Registration Number",
349
+ "requirement_name": "business_reg_no_info"
350
+ },
351
+ {
352
+ "friendly_name": "Government-issued ID",
353
+ "object_type": "government_issued_document",
354
+ "passed": false,
355
+ "failure_reason": "A Government-issued ID is missing. Please add one to the regulatory bundle.",
356
+ "error_code": 22216,
357
+ "valid": [],
358
+ "invalid": [
359
+ {
360
+ "friendly_name": "First Name",
361
+ "object_field": "first_name",
362
+ "failure_reason": "The First Name is missing. Or, it does not match the First Name you entered within Business information. Please enter in the First Name shown on the Government-issued ID or make sure both First Name fields use the same exact inputs.",
363
+ "error_code": 22217
364
+ },
365
+ {
366
+ "friendly_name": "Last Name",
367
+ "object_field": "last_name",
368
+ "failure_reason": "The Last Name is missing. Or, it does not match the Last Name you entered within Business information. Please enter in the Last Name shown on the Government-issued ID or make sure both Last Name fields use the same exact inputs.",
369
+ "error_code": 22217
370
+ }
371
+ ],
372
+ "requirement_friendly_name": "Name of Authorized Representative",
373
+ "requirement_name": "name_of_auth_rep_info"
374
+ },
375
+ {
376
+ "friendly_name": "Executed Copy of Power of Attorney",
377
+ "object_type": "power_of_attorney",
378
+ "passed": false,
379
+ "failure_reason": "An Executed Copy of Power of Attorney is missing. Please add one to the regulatory bundle.",
380
+ "error_code": 22216,
381
+ "valid": [],
382
+ "invalid": [],
383
+ "requirement_friendly_name": "Power of Attorney",
384
+ "requirement_name": "power_of_attorney_info"
385
+ },
386
+ {
387
+ "friendly_name": "Government-issued ID",
388
+ "object_type": "government_issued_document",
389
+ "passed": false,
390
+ "failure_reason": "A Government-issued ID is missing. Please add one to the regulatory bundle.",
391
+ "error_code": 22216,
392
+ "valid": [],
393
+ "invalid": [
394
+ {
395
+ "friendly_name": "First Name",
396
+ "object_field": "first_name",
397
+ "failure_reason": "The First Name is missing on the Governnment-Issued ID.",
398
+ "error_code": 22217
399
+ },
400
+ {
401
+ "friendly_name": "Last Name",
402
+ "object_field": "last_name",
403
+ "failure_reason": "The Last Name is missing on the Government-issued ID",
404
+ "error_code": 22217
405
+ }
406
+ ],
407
+ "requirement_friendly_name": "Name of Person granted the Power of Attorney",
408
+ "requirement_name": "name_in_power_of_attorney_info"
409
+ }
410
+ ]
411
+ }
412
+ ],
413
+ "meta": {
414
+ "page": 0,
415
+ "page_size": 50,
416
+ "first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations?PageSize=50&Page=0",
417
+ "previous_page_url": null,
418
+ "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations?PageSize=50&Page=0",
419
+ "next_page_url": null,
420
+ "key": "results"
421
+ }
422
+ }
423
+ ]
424
+ ))
425
+
426
+ actual = @client.numbers.v2.regulatory_compliance \
427
+ .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
428
+ .evaluations.list()
429
+
430
+ expect(actual).to_not eq(nil)
431
+ end
432
+
433
+ it "can fetch" do
434
+ @holodeck.mock(Twilio::Response.new(500, ''))
435
+
436
+ expect {
437
+ @client.numbers.v2.regulatory_compliance \
438
+ .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
439
+ .evaluations('ELXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
440
+ }.to raise_exception(Twilio::REST::TwilioError)
441
+
442
+ values = {}
443
+ expect(
444
+ @holodeck.has_request?(Holodeck::Request.new(
445
+ method: 'get',
446
+ url: 'https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Evaluations/ELXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
447
+ ))).to eq(true)
448
+ end
449
+
450
+ it "receives fetch responses" do
451
+ @holodeck.mock(Twilio::Response.new(
452
+ 200,
453
+ %q[
454
+ {
455
+ "sid": "ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
456
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
457
+ "regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
458
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
459
+ "status": "noncompliant",
460
+ "date_created": "2020-04-28T18:14:01Z",
461
+ "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations/ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
462
+ "results": [
463
+ {
464
+ "friendly_name": "Business",
465
+ "object_type": "business",
466
+ "passed": false,
467
+ "failure_reason": "A Business End-User is missing. Please add one to the regulatory bundle.",
468
+ "error_code": 22214,
469
+ "valid": [],
470
+ "invalid": [
471
+ {
472
+ "friendly_name": "Business Name",
473
+ "object_field": "business_name",
474
+ "failure_reason": "The Business Name is missing. Please enter in a Business Name on the Business information.",
475
+ "error_code": 22215
476
+ },
477
+ {
478
+ "friendly_name": "Business Registration Number",
479
+ "object_field": "business_registration_number",
480
+ "failure_reason": "The Business Registration Number is missing. Please enter in a Business Registration Number on the Business information.",
481
+ "error_code": 22215
482
+ },
483
+ {
484
+ "friendly_name": "First Name",
485
+ "object_field": "first_name",
486
+ "failure_reason": "The First Name is missing. Please enter in a First Name on the Business information.",
487
+ "error_code": 22215
488
+ },
489
+ {
490
+ "friendly_name": "Last Name",
491
+ "object_field": "last_name",
492
+ "failure_reason": "The Last Name is missing. Please enter in a Last Name on the Business information.",
493
+ "error_code": 22215
494
+ }
495
+ ],
496
+ "requirement_friendly_name": "Business",
497
+ "requirement_name": "business_info"
498
+ },
499
+ {
500
+ "friendly_name": "Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative",
501
+ "object_type": "commercial_registrar_excerpt",
502
+ "passed": false,
503
+ "failure_reason": "An Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative is missing. Please add one to the regulatory bundle.",
504
+ "error_code": 22216,
505
+ "valid": [],
506
+ "invalid": [
507
+ {
508
+ "friendly_name": "Business Name",
509
+ "object_field": "business_name",
510
+ "failure_reason": "The Business Name is missing. Or, it does not match the Business Name you entered within Business information. Please enter in the Business Name shown on the Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative or make sure both Business Name fields use the same exact inputs.",
511
+ "error_code": 22217
512
+ }
513
+ ],
514
+ "requirement_friendly_name": "Business Name",
515
+ "requirement_name": "business_name_info"
516
+ },
517
+ {
518
+ "friendly_name": "Excerpt from the commercial register showing French address",
519
+ "object_type": "commercial_registrar_excerpt",
520
+ "passed": false,
521
+ "failure_reason": "An Excerpt from the commercial register showing French address is missing. Please add one to the regulatory bundle.",
522
+ "error_code": 22216,
523
+ "valid": [],
524
+ "invalid": [
525
+ {
526
+ "friendly_name": "Address sid(s)",
527
+ "object_field": "address_sids",
528
+ "failure_reason": "The Address is missing. Please enter in the address shown on the Excerpt from the commercial register showing French address.",
529
+ "error_code": 22219
530
+ }
531
+ ],
532
+ "requirement_friendly_name": "Business Address (Proof of Address)",
533
+ "requirement_name": "business_address_proof_info"
534
+ },
535
+ {
536
+ "friendly_name": "Excerpt from the commercial register (Extrait K-bis)",
537
+ "object_type": "commercial_registrar_excerpt",
538
+ "passed": false,
539
+ "failure_reason": "An Excerpt from the commercial register (Extrait K-bis) is missing. Please add one to the regulatory bundle.",
540
+ "error_code": 22216,
541
+ "valid": [],
542
+ "invalid": [
543
+ {
544
+ "friendly_name": "Document Number",
545
+ "object_field": "document_number",
546
+ "failure_reason": "The Document Number is missing. Please enter in the Document Number shown on the Excerpt from the commercial register (Extrait K-bis).",
547
+ "error_code": 22217
548
+ }
549
+ ],
550
+ "requirement_friendly_name": "Business Registration Number",
551
+ "requirement_name": "business_reg_no_info"
552
+ },
553
+ {
554
+ "friendly_name": "Government-issued ID",
555
+ "object_type": "government_issued_document",
556
+ "passed": false,
557
+ "failure_reason": "A Government-issued ID is missing. Please add one to the regulatory bundle.",
558
+ "error_code": 22216,
559
+ "valid": [],
560
+ "invalid": [
561
+ {
562
+ "friendly_name": "First Name",
563
+ "object_field": "first_name",
564
+ "failure_reason": "The First Name is missing. Or, it does not match the First Name you entered within Business information. Please enter in the First Name shown on the Government-issued ID or make sure both First Name fields use the same exact inputs.",
565
+ "error_code": 22217
566
+ },
567
+ {
568
+ "friendly_name": "Last Name",
569
+ "object_field": "last_name",
570
+ "failure_reason": "The Last Name is missing. Or, it does not match the Last Name you entered within Business information. Please enter in the Last Name shown on the Government-issued ID or make sure both Last Name fields use the same exact inputs.",
571
+ "error_code": 22217
572
+ }
573
+ ],
574
+ "requirement_friendly_name": "Name of Authorized Representative",
575
+ "requirement_name": "name_of_auth_rep_info"
576
+ },
577
+ {
578
+ "friendly_name": "Executed Copy of Power of Attorney",
579
+ "object_type": "power_of_attorney",
580
+ "passed": false,
581
+ "failure_reason": "An Executed Copy of Power of Attorney is missing. Please add one to the regulatory bundle.",
582
+ "error_code": 22216,
583
+ "valid": [],
584
+ "invalid": [],
585
+ "requirement_friendly_name": "Power of Attorney",
586
+ "requirement_name": "power_of_attorney_info"
587
+ },
588
+ {
589
+ "friendly_name": "Government-issued ID",
590
+ "object_type": "government_issued_document",
591
+ "passed": false,
592
+ "failure_reason": "A Government-issued ID is missing. Please add one to the regulatory bundle.",
593
+ "error_code": 22216,
594
+ "valid": [],
595
+ "invalid": [
596
+ {
597
+ "friendly_name": "First Name",
598
+ "object_field": "first_name",
599
+ "failure_reason": "The First Name is missing on the Governnment-Issued ID.",
600
+ "error_code": 22217
601
+ },
602
+ {
603
+ "friendly_name": "Last Name",
604
+ "object_field": "last_name",
605
+ "failure_reason": "The Last Name is missing on the Government-issued ID",
606
+ "error_code": 22217
607
+ }
608
+ ],
609
+ "requirement_friendly_name": "Name of Person granted the Power of Attorney",
610
+ "requirement_name": "name_in_power_of_attorney_info"
611
+ }
612
+ ]
613
+ }
614
+ ]
615
+ ))
616
+
617
+ actual = @client.numbers.v2.regulatory_compliance \
618
+ .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
619
+ .evaluations('ELXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
620
+
621
+ expect(actual).to_not eq(nil)
622
+ end
623
+ end