twilio-ruby 5.31.4 → 5.31.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -0
- data/.rubocop_todo.yml +0 -11
- data/CHANGES.md +38 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +27 -1
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -1
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
- data/lib/twilio-ruby/rest/messaging.rb +0 -15
- data/lib/twilio-ruby/rest/messaging/v1.rb +0 -22
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb +322 -0
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +49 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +427 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +224 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +387 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +239 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/test_user.rb +215 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +10 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +7 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +14 -0
- data/lib/twilio-ruby/rest/verify/v2/service.rb +5 -3
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +5 -4
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/call_spec.rb +30 -10
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +29 -0
- data/spec/integration/api/v2010/account/notification_spec.rb +1 -1
- data/spec/integration/api/v2010/account_spec.rb +45 -0
- data/spec/integration/flex_api/v1/configuration_spec.rb +3 -0
- data/spec/integration/numbers/v2/regulatory_compliance/regulation_spec.rb +183 -0
- data/spec/integration/studio/v2/flow/execution/execution_context_spec.rb +51 -0
- data/spec/integration/studio/v2/flow/execution/execution_step/execution_step_context_spec.rb +54 -0
- data/spec/integration/studio/v2/flow/execution/execution_step_spec.rb +101 -0
- data/spec/integration/studio/v2/flow/execution_spec.rb +169 -0
- data/spec/integration/studio/v2/flow/test_user_spec.rb +86 -0
- data/spec/integration/studio/v2/flow_spec.rb +16 -4
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics_spec.rb +6 -0
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics_spec.rb +2 -0
- data/spec/integration/taskrouter/v1/workspace/task_spec.rb +4 -0
- data/twilio-ruby.gemspec +1 -1
- metadata +22 -19
- data/lib/twilio-ruby/rest/messaging/v1/session.rb +0 -513
- data/lib/twilio-ruby/rest/messaging/v1/session/message.rb +0 -439
- data/lib/twilio-ruby/rest/messaging/v1/session/participant.rb +0 -458
- data/lib/twilio-ruby/rest/messaging/v1/session/webhook.rb +0 -444
- data/lib/twilio-ruby/rest/messaging/v1/webhook.rb +0 -299
- data/spec/integration/messaging/v1/session/message_spec.rb +0 -238
- data/spec/integration/messaging/v1/session/participant_spec.rb +0 -256
- data/spec/integration/messaging/v1/session/webhook_spec.rb +0 -300
- data/spec/integration/messaging/v1/session_spec.rb +0 -227
- data/spec/integration/messaging/v1/webhook_spec.rb +0 -94
@@ -429,6 +429,7 @@ module Twilio
|
|
429
429
|
'addons' => payload['addons'],
|
430
430
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
431
431
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
432
|
+
'task_queue_entered_date' => Twilio.deserialize_iso8601_datetime(payload['task_queue_entered_date']),
|
432
433
|
'priority' => payload['priority'].to_i,
|
433
434
|
'reason' => payload['reason'],
|
434
435
|
'sid' => payload['sid'],
|
@@ -467,7 +468,7 @@ module Twilio
|
|
467
468
|
end
|
468
469
|
|
469
470
|
##
|
470
|
-
# @return [String] The number of seconds since the
|
471
|
+
# @return [String] The number of seconds since the Task was created
|
471
472
|
def age
|
472
473
|
@properties['age']
|
473
474
|
end
|
@@ -502,6 +503,12 @@ module Twilio
|
|
502
503
|
@properties['date_updated']
|
503
504
|
end
|
504
505
|
|
506
|
+
##
|
507
|
+
# @return [Time] The ISO 8601 date and time in GMT when the Task entered the TaskQueue.
|
508
|
+
def task_queue_entered_date
|
509
|
+
@properties['task_queue_entered_date']
|
510
|
+
end
|
511
|
+
|
505
512
|
##
|
506
513
|
# @return [String] Retrieve the list of all Tasks in the Workspace with the specified priority
|
507
514
|
def priority
|
@@ -509,7 +516,7 @@ module Twilio
|
|
509
516
|
end
|
510
517
|
|
511
518
|
##
|
512
|
-
# @return [String] The reason the
|
519
|
+
# @return [String] The reason the Task was canceled or completed
|
513
520
|
def reason
|
514
521
|
@properties['reason']
|
515
522
|
end
|
@@ -545,7 +552,7 @@ module Twilio
|
|
545
552
|
end
|
546
553
|
|
547
554
|
##
|
548
|
-
# @return [String] The amount of time in seconds that the
|
555
|
+
# @return [String] The amount of time in seconds that the Task is allowed to live
|
549
556
|
def timeout
|
550
557
|
@properties['timeout']
|
551
558
|
end
|
data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb
CHANGED
@@ -170,6 +170,7 @@ module Twilio
|
|
170
170
|
'task_queue_sid' => payload['task_queue_sid'],
|
171
171
|
'wait_duration_until_accepted' => payload['wait_duration_until_accepted'],
|
172
172
|
'wait_duration_until_canceled' => payload['wait_duration_until_canceled'],
|
173
|
+
'wait_duration_in_queue_until_accepted' => payload['wait_duration_in_queue_until_accepted'],
|
173
174
|
'tasks_canceled' => payload['tasks_canceled'].to_i,
|
174
175
|
'tasks_completed' => payload['tasks_completed'].to_i,
|
175
176
|
'tasks_deleted' => payload['tasks_deleted'].to_i,
|
@@ -283,6 +284,12 @@ module Twilio
|
|
283
284
|
@properties['wait_duration_until_canceled']
|
284
285
|
end
|
285
286
|
|
287
|
+
##
|
288
|
+
# @return [Hash] The relative wait duration statistics for Tasks accepted while in the TaskQueue
|
289
|
+
def wait_duration_in_queue_until_accepted
|
290
|
+
@properties['wait_duration_in_queue_until_accepted']
|
291
|
+
end
|
292
|
+
|
286
293
|
##
|
287
294
|
# @return [String] The total number of Tasks canceled in the TaskQueue
|
288
295
|
def tasks_canceled
|
data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb
CHANGED
@@ -143,6 +143,8 @@ module Twilio
|
|
143
143
|
'activity_statistics' => payload['activity_statistics'],
|
144
144
|
'longest_task_waiting_age' => payload['longest_task_waiting_age'].to_i,
|
145
145
|
'longest_task_waiting_sid' => payload['longest_task_waiting_sid'],
|
146
|
+
'longest_relative_task_age_in_queue' => payload['longest_relative_task_age_in_queue'].to_i,
|
147
|
+
'longest_relative_task_sid_in_queue' => payload['longest_relative_task_sid_in_queue'],
|
146
148
|
'task_queue_sid' => payload['task_queue_sid'],
|
147
149
|
'tasks_by_priority' => payload['tasks_by_priority'],
|
148
150
|
'tasks_by_status' => payload['tasks_by_status'],
|
@@ -197,6 +199,18 @@ module Twilio
|
|
197
199
|
@properties['longest_task_waiting_sid']
|
198
200
|
end
|
199
201
|
|
202
|
+
##
|
203
|
+
# @return [String] The relative age in the TaskQueue for the longest waiting Task.
|
204
|
+
def longest_relative_task_age_in_queue
|
205
|
+
@properties['longest_relative_task_age_in_queue']
|
206
|
+
end
|
207
|
+
|
208
|
+
##
|
209
|
+
# @return [String] The SID of the Task waiting in the TaskQueue the longest.
|
210
|
+
def longest_relative_task_sid_in_queue
|
211
|
+
@properties['longest_relative_task_sid_in_queue']
|
212
|
+
end
|
213
|
+
|
200
214
|
##
|
201
215
|
# @return [String] The SID of the TaskQueue from which these statistics were calculated
|
202
216
|
def task_queue_sid
|
@@ -41,8 +41,10 @@ module Twilio
|
|
41
41
|
# use in phone calls. Applies only to TTS languages.
|
42
42
|
# @param [Boolean] psd2_enabled Whether to pass PSD2 transaction parameters when
|
43
43
|
# starting a verification.
|
44
|
-
# @param [Boolean] do_not_share_warning_enabled Whether to add a
|
45
|
-
# at the end of an SMS.
|
44
|
+
# @param [Boolean] do_not_share_warning_enabled Whether to add a security warning
|
45
|
+
# at the end of an SMS verification body. Disabled by default and applies only to
|
46
|
+
# SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share
|
47
|
+
# this code with anyone; our employees will never ask for the code`
|
46
48
|
# @return [ServiceInstance] Newly created ServiceInstance
|
47
49
|
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)
|
48
50
|
data = Twilio::Values.of({
|
@@ -448,7 +450,7 @@ module Twilio
|
|
448
450
|
end
|
449
451
|
|
450
452
|
##
|
451
|
-
# @return [Boolean] Whether to add a
|
453
|
+
# @return [Boolean] Whether to add a security warning at the end of an SMS.
|
452
454
|
def do_not_share_warning_enabled
|
453
455
|
@properties['do_not_share_warning_enabled']
|
454
456
|
end
|
@@ -52,14 +52,15 @@ module Twilio
|
|
52
52
|
# @param [String] payee The payee of the associated PSD2 compliant transaction.
|
53
53
|
# Requires the PSD2 Service flag enabled.
|
54
54
|
# @param [Hash] rate_limits The custom key-value pairs of Programmable Rate
|
55
|
-
# Limits. Keys
|
56
|
-
#
|
57
|
-
#
|
55
|
+
# Limits. Keys correspond to `unique_name` fields defined when [creating your Rate
|
56
|
+
# Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated
|
57
|
+
# value pairs represent values in the request that you are rate limiting on. You
|
58
|
+
# may include multiple Rate Limit values in each request.
|
58
59
|
# @param [Hash] channel_configuration
|
59
60
|
# [`email`](https://www.twilio.com/docs/verify/email) channel configuration in
|
60
61
|
# json format. Must include 'from' and 'from_name'.
|
61
62
|
# @param [String] app_hash Your [App
|
62
|
-
# Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be
|
63
|
+
# 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
64
|
# @return [VerificationInstance] Newly created VerificationInstance
|
64
65
|
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)
|
65
66
|
data = Twilio::Values.of({
|
data/lib/twilio-ruby/version.rb
CHANGED
@@ -61,7 +61,9 @@ describe 'Call' do
|
|
61
61
|
},
|
62
62
|
"to": "+14158675309",
|
63
63
|
"to_formatted": "(415) 867-5309",
|
64
|
-
"
|
64
|
+
"trunk_sid": null,
|
65
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
|
66
|
+
"queue_time": "1000"
|
65
67
|
}
|
66
68
|
]
|
67
69
|
))
|
@@ -107,7 +109,9 @@ describe 'Call' do
|
|
107
109
|
},
|
108
110
|
"to": "+14158675309",
|
109
111
|
"to_formatted": "(415) 867-5309",
|
110
|
-
"
|
112
|
+
"trunk_sid": null,
|
113
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
|
114
|
+
"queue_time": "1000"
|
111
115
|
}
|
112
116
|
]
|
113
117
|
))
|
@@ -197,7 +201,9 @@ describe 'Call' do
|
|
197
201
|
},
|
198
202
|
"to": "+13051913581",
|
199
203
|
"to_formatted": "(305) 191-3581",
|
200
|
-
"
|
204
|
+
"trunk_sid": "TRdeadbeefdeadbeefdeadbeefdeadbeef",
|
205
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
|
206
|
+
"queue_time": "1000"
|
201
207
|
}
|
202
208
|
]
|
203
209
|
))
|
@@ -261,7 +267,9 @@ describe 'Call' do
|
|
261
267
|
},
|
262
268
|
"to": "+13051913581",
|
263
269
|
"to_formatted": "(305) 191-3581",
|
264
|
-
"
|
270
|
+
"trunk_sid": "TRdeadbeefdeadbeefdeadbeefdeadbeef",
|
271
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
|
272
|
+
"queue_time": "1000"
|
265
273
|
},
|
266
274
|
{
|
267
275
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -294,7 +302,9 @@ describe 'Call' do
|
|
294
302
|
},
|
295
303
|
"to": "+13051913580",
|
296
304
|
"to_formatted": "(305) 191-3580",
|
297
|
-
"
|
305
|
+
"trunk_sid": "TRdeadbeefdeadbeefdeadbeefdeadbeef",
|
306
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",
|
307
|
+
"queue_time": "1000"
|
298
308
|
}
|
299
309
|
],
|
300
310
|
"end": 1,
|
@@ -352,7 +362,9 @@ describe 'Call' do
|
|
352
362
|
},
|
353
363
|
"to": "+13051913581",
|
354
364
|
"to_formatted": "(305) 191-3581",
|
355
|
-
"
|
365
|
+
"trunk_sid": "TRdeadbeefdeadbeefdeadbeefdeadbeef",
|
366
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
|
367
|
+
"queue_time": "1000"
|
356
368
|
},
|
357
369
|
{
|
358
370
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -385,7 +397,9 @@ describe 'Call' do
|
|
385
397
|
},
|
386
398
|
"to": "+13051913580",
|
387
399
|
"to_formatted": "(305) 191-3580",
|
388
|
-
"
|
400
|
+
"trunk_sid": "TRdeadbeefdeadbeefdeadbeefdeadbeef",
|
401
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",
|
402
|
+
"queue_time": "1000"
|
389
403
|
}
|
390
404
|
],
|
391
405
|
"end": 3,
|
@@ -529,7 +543,9 @@ describe 'Call' do
|
|
529
543
|
},
|
530
544
|
"to": "+14158675309",
|
531
545
|
"to_formatted": "(415) 867-5309",
|
532
|
-
"
|
546
|
+
"trunk_sid": null,
|
547
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
|
548
|
+
"queue_time": "1000"
|
533
549
|
}
|
534
550
|
]
|
535
551
|
))
|
@@ -575,7 +591,9 @@ describe 'Call' do
|
|
575
591
|
},
|
576
592
|
"to": "+14158675309",
|
577
593
|
"to_formatted": "(415) 867-5309",
|
578
|
-
"
|
594
|
+
"trunk_sid": null,
|
595
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
|
596
|
+
"queue_time": "1000"
|
579
597
|
}
|
580
598
|
]
|
581
599
|
))
|
@@ -621,7 +639,9 @@ describe 'Call' do
|
|
621
639
|
},
|
622
640
|
"to": "+14158675309",
|
623
641
|
"to_formatted": "(415) 867-5309",
|
624
|
-
"
|
642
|
+
"trunk_sid": null,
|
643
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
|
644
|
+
"queue_time": "1000"
|
625
645
|
}
|
626
646
|
]
|
627
647
|
))
|
@@ -264,6 +264,35 @@ describe 'Participant' do
|
|
264
264
|
expect(actual).to_not eq(nil)
|
265
265
|
end
|
266
266
|
|
267
|
+
it "receives create_with_friendly_name_byoc responses" do
|
268
|
+
@holodeck.mock(Twilio::Response.new(
|
269
|
+
201,
|
270
|
+
%q[
|
271
|
+
{
|
272
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
273
|
+
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
274
|
+
"conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
275
|
+
"date_created": "Fri, 18 Feb 2011 21:07:19 +0000",
|
276
|
+
"date_updated": "Fri, 18 Feb 2011 21:07:19 +0000",
|
277
|
+
"end_conference_on_exit": false,
|
278
|
+
"muted": false,
|
279
|
+
"hold": false,
|
280
|
+
"status": "complete",
|
281
|
+
"start_conference_on_enter": true,
|
282
|
+
"coaching": false,
|
283
|
+
"call_sid_to_coach": null,
|
284
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
285
|
+
}
|
286
|
+
]
|
287
|
+
))
|
288
|
+
|
289
|
+
actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
290
|
+
.conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
291
|
+
.participants.create(from: '+15017122661', to: '+15558675310')
|
292
|
+
|
293
|
+
expect(actual).to_not eq(nil)
|
294
|
+
end
|
295
|
+
|
267
296
|
it "can delete" do
|
268
297
|
@holodeck.mock(Twilio::Response.new(500, ''))
|
269
298
|
|
@@ -43,7 +43,7 @@ describe 'Notification' do
|
|
43
43
|
"request_method": "get",
|
44
44
|
"request_url": "https://voiceforms4000.appspot.com/twiml/9436/question/0",
|
45
45
|
"request_variables": "AccountSid=ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&CallStatus=in-progress&ToZip=94937&ToCity=INVERNESS&ToState=CA&Called=%2B14156694923&To=%2B14156694923&ToCountry=US&CalledZip=94937&Direction=inbound&ApiVersion=2010-04-01&Caller=%2B17378742833&CalledCity=INVERNESS&CalledCountry=US&CallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&CalledState=CA&From=%2B17378742833",
|
46
|
-
"response_body": "
|
46
|
+
"response_body": "Response body from your webhook URL as a string.",
|
47
47
|
"response_headers": "Date=Mon%2C+13+Sep+2010+20%3A02%3A00+GMT&Content-Length=466&Connection=close&Content-Type=text%2Fhtml%3B+charset%3DUTF-8&Server=Google+Frontend",
|
48
48
|
"sid": "NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
49
49
|
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
@@ -283,4 +283,49 @@ describe 'Account' do
|
|
283
283
|
|
284
284
|
expect(actual).to_not eq(nil)
|
285
285
|
end
|
286
|
+
|
287
|
+
it "receives update_with_numeric_status responses" do
|
288
|
+
@holodeck.mock(Twilio::Response.new(
|
289
|
+
200,
|
290
|
+
%q[
|
291
|
+
{
|
292
|
+
"auth_token": "auth_token",
|
293
|
+
"date_created": "Thu, 30 Jul 2015 20:00:00 +0000",
|
294
|
+
"date_updated": "Thu, 30 Jul 2015 20:00:00 +0000",
|
295
|
+
"friendly_name": "friendly_name",
|
296
|
+
"owner_account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
297
|
+
"sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
298
|
+
"status": "active",
|
299
|
+
"subresource_uris": {
|
300
|
+
"available_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json",
|
301
|
+
"calls": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json",
|
302
|
+
"conferences": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences.json",
|
303
|
+
"incoming_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json",
|
304
|
+
"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
|
305
|
+
"outgoing_caller_ids": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json",
|
306
|
+
"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
|
307
|
+
"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",
|
308
|
+
"addresses": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json",
|
309
|
+
"signing_keys": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json",
|
310
|
+
"connect_apps": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json",
|
311
|
+
"sip": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP.json",
|
312
|
+
"authorized_connect_apps": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json",
|
313
|
+
"usage": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage.json",
|
314
|
+
"keys": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json",
|
315
|
+
"applications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json",
|
316
|
+
"short_codes": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json",
|
317
|
+
"queues": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json",
|
318
|
+
"messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json",
|
319
|
+
"balance": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Balance.json"
|
320
|
+
},
|
321
|
+
"type": "Full",
|
322
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
323
|
+
}
|
324
|
+
]
|
325
|
+
))
|
326
|
+
|
327
|
+
actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
328
|
+
|
329
|
+
expect(actual).to_not eq(nil)
|
330
|
+
end
|
286
331
|
end
|
@@ -98,6 +98,7 @@ describe 'Configuration' do
|
|
98
98
|
"chat_service_instance_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
99
99
|
"ui_language": "en",
|
100
100
|
"ui_attributes": {},
|
101
|
+
"ui_dependencies": {},
|
101
102
|
"ui_version": "1.0",
|
102
103
|
"service_version": "1.0",
|
103
104
|
"call_recording_enabled": true,
|
@@ -244,6 +245,7 @@ describe 'Configuration' do
|
|
244
245
|
"chat_service_instance_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
245
246
|
"ui_language": "en",
|
246
247
|
"ui_attributes": {},
|
248
|
+
"ui_dependencies": {},
|
247
249
|
"ui_version": "1.0",
|
248
250
|
"service_version": "1.0",
|
249
251
|
"call_recording_enabled": true,
|
@@ -390,6 +392,7 @@ describe 'Configuration' do
|
|
390
392
|
"chat_service_instance_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
391
393
|
"ui_language": "en",
|
392
394
|
"ui_attributes": {},
|
395
|
+
"ui_dependencies": {},
|
393
396
|
"ui_version": "1.0",
|
394
397
|
"service_version": "1.0",
|
395
398
|
"call_recording_enabled": true,
|
@@ -0,0 +1,183 @@
|
|
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 'Regulation' do
|
12
|
+
it "can read" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.numbers.v2.regulatory_compliance \
|
17
|
+
.regulations.list()
|
18
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
19
|
+
|
20
|
+
values = {}
|
21
|
+
expect(
|
22
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
23
|
+
method: 'get',
|
24
|
+
url: 'https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations',
|
25
|
+
))).to eq(true)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "receives read_empty responses" do
|
29
|
+
@holodeck.mock(Twilio::Response.new(
|
30
|
+
200,
|
31
|
+
%q[
|
32
|
+
{
|
33
|
+
"results": [],
|
34
|
+
"meta": {
|
35
|
+
"page": 0,
|
36
|
+
"page_size": 50,
|
37
|
+
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?IsoCountry=US&EndUserType=business&NumberType=mobile&PageSize=50&Page=0",
|
38
|
+
"previous_page_url": null,
|
39
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?IsoCountry=US&EndUserType=business&NumberType=mobile&PageSize=50&Page=0",
|
40
|
+
"next_page_url": null,
|
41
|
+
"key": "results"
|
42
|
+
}
|
43
|
+
}
|
44
|
+
]
|
45
|
+
))
|
46
|
+
|
47
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
48
|
+
.regulations.list()
|
49
|
+
|
50
|
+
expect(actual).to_not eq(nil)
|
51
|
+
end
|
52
|
+
|
53
|
+
it "receives read_full responses" do
|
54
|
+
@holodeck.mock(Twilio::Response.new(
|
55
|
+
200,
|
56
|
+
%q[
|
57
|
+
{
|
58
|
+
"results": [
|
59
|
+
{
|
60
|
+
"sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
61
|
+
"friendly_name": "Australia: Local - Individual",
|
62
|
+
"iso_country": "AU",
|
63
|
+
"number_type": "local",
|
64
|
+
"end_user_type": "individual",
|
65
|
+
"requirements": {
|
66
|
+
"end_user": [
|
67
|
+
{
|
68
|
+
"name": "Individual",
|
69
|
+
"type": "individual",
|
70
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/individual",
|
71
|
+
"fields": [
|
72
|
+
"first_name",
|
73
|
+
"last_name"
|
74
|
+
]
|
75
|
+
}
|
76
|
+
],
|
77
|
+
"supporting_document": [
|
78
|
+
[
|
79
|
+
{
|
80
|
+
"name": "Address",
|
81
|
+
"type": "document",
|
82
|
+
"description": "The physical location of the individual or business. Must be within locality or region covered by the phone numbers prefix; a PO Box is not acceptable where a local address is required.",
|
83
|
+
"accepted_documents": [
|
84
|
+
{
|
85
|
+
"name": "Address Validation",
|
86
|
+
"type": "address",
|
87
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/DocumentTypes/address",
|
88
|
+
"fields": []
|
89
|
+
}
|
90
|
+
]
|
91
|
+
}
|
92
|
+
]
|
93
|
+
]
|
94
|
+
},
|
95
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
96
|
+
}
|
97
|
+
],
|
98
|
+
"meta": {
|
99
|
+
"page": 0,
|
100
|
+
"page_size": 50,
|
101
|
+
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?PageSize=50&Page=0",
|
102
|
+
"previous_page_url": null,
|
103
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?PageSize=50&Page=0",
|
104
|
+
"next_page_url": null,
|
105
|
+
"key": "results"
|
106
|
+
}
|
107
|
+
}
|
108
|
+
]
|
109
|
+
))
|
110
|
+
|
111
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
112
|
+
.regulations.list()
|
113
|
+
|
114
|
+
expect(actual).to_not eq(nil)
|
115
|
+
end
|
116
|
+
|
117
|
+
it "can fetch" do
|
118
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
119
|
+
|
120
|
+
expect {
|
121
|
+
@client.numbers.v2.regulatory_compliance \
|
122
|
+
.regulations('RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
123
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
124
|
+
|
125
|
+
values = {}
|
126
|
+
expect(
|
127
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
128
|
+
method: 'get',
|
129
|
+
url: 'https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
130
|
+
))).to eq(true)
|
131
|
+
end
|
132
|
+
|
133
|
+
it "receives fetch responses" do
|
134
|
+
@holodeck.mock(Twilio::Response.new(
|
135
|
+
200,
|
136
|
+
%q[
|
137
|
+
{
|
138
|
+
"sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
139
|
+
"friendly_name": "Australia: Local - Individual",
|
140
|
+
"iso_country": "AU",
|
141
|
+
"number_type": "local",
|
142
|
+
"end_user_type": "individual",
|
143
|
+
"requirements": {
|
144
|
+
"end_user": [
|
145
|
+
{
|
146
|
+
"name": "Individual",
|
147
|
+
"type": "individual",
|
148
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/individual",
|
149
|
+
"fields": [
|
150
|
+
"first_name",
|
151
|
+
"last_name"
|
152
|
+
]
|
153
|
+
}
|
154
|
+
],
|
155
|
+
"supporting_document": [
|
156
|
+
[
|
157
|
+
{
|
158
|
+
"name": "Address",
|
159
|
+
"type": "document",
|
160
|
+
"description": "The physical location of the individual or business. Must be within locality or region covered by the phone numbers prefix; a PO Box is not acceptable where a local address is required.",
|
161
|
+
"accepted_documents": [
|
162
|
+
{
|
163
|
+
"name": "Address Validation",
|
164
|
+
"type": "address",
|
165
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/DocumentTypes/address",
|
166
|
+
"fields": []
|
167
|
+
}
|
168
|
+
]
|
169
|
+
}
|
170
|
+
]
|
171
|
+
]
|
172
|
+
},
|
173
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
174
|
+
}
|
175
|
+
]
|
176
|
+
))
|
177
|
+
|
178
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
179
|
+
.regulations('RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
180
|
+
|
181
|
+
expect(actual).to_not eq(nil)
|
182
|
+
end
|
183
|
+
end
|