twilio-ruby 5.28.0 → 5.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +11 -6
- data/CHANGES.md +33 -0
- data/README.md +3 -2
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +18 -20
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +7 -6
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +7 -6
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +6 -4
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +0 -14
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +6 -4
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +9 -6
- data/lib/twilio-ruby/rest/authy.rb +8 -8
- data/lib/twilio-ruby/rest/authy/v1.rb +15 -15
- data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +6 -3
- data/lib/twilio-ruby/rest/flex_api.rb +15 -15
- data/lib/twilio-ruby/rest/flex_api/v1.rb +20 -20
- data/lib/twilio-ruby/rest/messaging.rb +9 -9
- data/lib/twilio-ruby/rest/messaging/v1.rb +13 -13
- data/lib/twilio-ruby/rest/preview.rb +20 -20
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +38 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +298 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +232 -0
- data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
- data/lib/twilio-ruby/rest/preview/trusted_comms.rb +14 -14
- data/lib/twilio-ruby/rest/preview/trusted_comms/branded_call.rb +40 -5
- data/lib/twilio-ruby/rest/preview/trusted_comms/cps.rb +7 -7
- data/lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb +51 -51
- data/lib/twilio-ruby/rest/preview/trusted_comms/device.rb +10 -10
- data/lib/twilio-ruby/rest/preview/trusted_comms/phone_call.rb +96 -19
- data/lib/twilio-ruby/rest/sync/v1/service.rb +3 -3
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +8 -2
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +10 -6
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +10 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +271 -176
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +282 -137
- data/lib/twilio-ruby/rest/video.rb +9 -9
- data/lib/twilio-ruby/rest/video/v1.rb +15 -15
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +2 -1
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +9 -7
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb +3 -3
- data/lib/twilio-ruby/rest/wireless.rb +6 -6
- data/lib/twilio-ruby/rest/wireless/v1.rb +8 -8
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +5 -4
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +4 -5
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +114 -98
- data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +4 -4
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +16 -10
- data/lib/twilio-ruby/security/request_validator.rb +61 -8
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/message_spec.rb +4 -4
- data/spec/integration/api/v2010/account/notification_spec.rb +0 -28
- data/spec/integration/conversations/v1/conversation/participant_spec.rb +27 -0
- data/spec/integration/preview/bulk_exports/export/export_custom_job_spec.rb +129 -0
- data/spec/integration/preview/bulk_exports/export/job_spec.rb +77 -0
- data/spec/integration/preview/trusted_comms/branded_call_spec.rb +6 -1
- data/spec/integration/preview/trusted_comms/cps_spec.rb +1 -1
- data/spec/integration/preview/trusted_comms/current_call_spec.rb +10 -10
- data/spec/integration/preview/trusted_comms/device_spec.rb +1 -1
- data/spec/integration/preview/trusted_comms/phone_call_spec.rb +15 -4
- data/spec/integration/wireless/v1/sim_spec.rb +84 -0
- data/spec/security/request_validator_spec.rb +41 -0
- metadata +9 -4
@@ -32,13 +32,18 @@ describe 'BrandedCall' do
|
|
32
32
|
{
|
33
33
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
34
|
"bg_color": "#fff",
|
35
|
+
"brand_sid": "BZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
|
+
"branded_channel_sid": "BWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
+
"business_sid": "BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
+
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
39
|
"caller": "Owl Bank",
|
36
40
|
"created_at": "2019-05-01T20:00:00Z",
|
37
41
|
"font_color": "#000",
|
38
42
|
"from": "+15000000000",
|
39
43
|
"logo": "https://www.twilio.com/marketing/bundles/company/img/logos/red/twilio-logo-red.png",
|
44
|
+
"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
40
45
|
"reason": "Hello Jhon, your appointment has been confirmed.",
|
41
|
-
"sid": "
|
46
|
+
"sid": "CQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
42
47
|
"status": "unknown",
|
43
48
|
"to": "+573000000000",
|
44
49
|
"use_case": "conversational",
|
@@ -29,20 +29,20 @@ describe 'CurrentCall' do
|
|
29
29
|
200,
|
30
30
|
%q[
|
31
31
|
{
|
32
|
-
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
33
|
-
"from": "+1500123",
|
34
|
-
"to": "+1500456",
|
35
|
-
"status": "ringing",
|
36
|
-
"reason": "Hello Jhon, your bank appointment has been confirmed.",
|
37
|
-
"created_at": "2019-05-01T20:00:00Z",
|
38
|
-
"caller": "Owl Bank",
|
39
|
-
"logo": "https://www.twilio.com/marketing/bundles/company/img/logos/red/twilio-logo-red.png",
|
40
32
|
"bg_color": "#fff",
|
33
|
+
"caller": "Owl Bank",
|
34
|
+
"created_at": "2019-05-01T20:00:00Z",
|
41
35
|
"font_color": "#f22f46",
|
42
|
-
"
|
36
|
+
"from": "+1500123",
|
37
|
+
"logo": "https://www.twilio.com/marketing/bundles/company/img/logos/red/twilio-logo-red.png",
|
43
38
|
"manager": "Twilio",
|
39
|
+
"reason": "Hello Jhon, your bank appointment has been confirmed.",
|
44
40
|
"shield_img": "https://www.twilio.com/marketing/bundles/company/img/badges/red/twilio-badge-red.png",
|
45
|
-
"
|
41
|
+
"sid": "CQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
42
|
+
"status": "ringing",
|
43
|
+
"to": "+1500456",
|
44
|
+
"url": "https://preview.twilio.com/TrustedComms/CurrentCall",
|
45
|
+
"use_case": "conversational"
|
46
46
|
}
|
47
47
|
]
|
48
48
|
))
|
@@ -30,9 +30,9 @@ describe 'Device' do
|
|
30
30
|
201,
|
31
31
|
%q[
|
32
32
|
{
|
33
|
-
"sid": "DDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
33
|
"binding_sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
34
|
"phone_number": "+573000000000",
|
35
|
+
"sid": "DDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
36
|
"url": "https://preview.twilio.com/TrustedComms/Devices"
|
37
37
|
}
|
38
38
|
]
|
@@ -30,13 +30,24 @@ describe 'PhoneCall' do
|
|
30
30
|
201,
|
31
31
|
%q[
|
32
32
|
{
|
33
|
-
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
33
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"bg_color": "#fff",
|
35
|
+
"brand_sid": "BZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
|
+
"branded_channel_sid": "BWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
+
"business_sid": "BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
+
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
39
|
+
"caller": "Owl Bank",
|
40
|
+
"created_at": "2019-05-01T20:00:00Z",
|
41
|
+
"font_color": "#000",
|
35
42
|
"from": "+15000000000",
|
36
|
-
"
|
43
|
+
"logo": "https://www.twilio.com/marketing/bundles/company/img/logos/red/twilio-logo-red.png",
|
44
|
+
"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
45
|
"reason": "Hello Jhon, your appointment has been confirmed.",
|
38
|
-
"
|
39
|
-
"
|
46
|
+
"sid": "CQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
47
|
+
"status": "unknown",
|
48
|
+
"to": "+573000000000",
|
49
|
+
"url": "https://preview.twilio.com/TrustedComms/Business/PhoneCalls",
|
50
|
+
"use_case": "conversational"
|
40
51
|
}
|
41
52
|
]
|
42
53
|
))
|
@@ -197,6 +197,90 @@ describe 'Sim' do
|
|
197
197
|
"iccid": "iccid",
|
198
198
|
"e_id": "e_id",
|
199
199
|
"status": "new",
|
200
|
+
"reset_status": null,
|
201
|
+
"sms_fallback_method": "http_method",
|
202
|
+
"sms_fallback_url": "http://www.example.com",
|
203
|
+
"sms_method": "http_method",
|
204
|
+
"sms_url": "http://www.example.com",
|
205
|
+
"voice_fallback_method": "http_method",
|
206
|
+
"voice_fallback_url": "http://www.example.com",
|
207
|
+
"voice_method": "http_method",
|
208
|
+
"voice_url": "http://www.example.com",
|
209
|
+
"url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
210
|
+
"ip_address": "192.168.1.30"
|
211
|
+
}
|
212
|
+
]
|
213
|
+
))
|
214
|
+
|
215
|
+
actual = @client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
216
|
+
|
217
|
+
expect(actual).to_not eq(nil)
|
218
|
+
end
|
219
|
+
|
220
|
+
it "receives update_move_to_subaccount responses" do
|
221
|
+
@holodeck.mock(Twilio::Response.new(
|
222
|
+
200,
|
223
|
+
%q[
|
224
|
+
{
|
225
|
+
"account_sid": "ACbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
226
|
+
"unique_name": "unique_name",
|
227
|
+
"commands_callback_method": "http_method",
|
228
|
+
"commands_callback_url": "http://www.example.com",
|
229
|
+
"date_created": "2015-07-30T20:00:00Z",
|
230
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
231
|
+
"friendly_name": "friendly_name",
|
232
|
+
"links": {
|
233
|
+
"data_sessions": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions",
|
234
|
+
"rate_plan": "https://wireless.twilio.com/v1/RatePlans/WPbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
235
|
+
"usage_records": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords"
|
236
|
+
},
|
237
|
+
"rate_plan_sid": "WPbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
238
|
+
"sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
239
|
+
"iccid": "iccid",
|
240
|
+
"e_id": "e_id",
|
241
|
+
"status": "new",
|
242
|
+
"reset_status": null,
|
243
|
+
"sms_fallback_method": "http_method",
|
244
|
+
"sms_fallback_url": "http://www.example.com",
|
245
|
+
"sms_method": "http_method",
|
246
|
+
"sms_url": "http://www.example.com",
|
247
|
+
"voice_fallback_method": "http_method",
|
248
|
+
"voice_fallback_url": "http://www.example.com",
|
249
|
+
"voice_method": "http_method",
|
250
|
+
"voice_url": "http://www.example.com",
|
251
|
+
"url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
252
|
+
"ip_address": "192.168.1.30"
|
253
|
+
}
|
254
|
+
]
|
255
|
+
))
|
256
|
+
|
257
|
+
actual = @client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
258
|
+
|
259
|
+
expect(actual).to_not eq(nil)
|
260
|
+
end
|
261
|
+
|
262
|
+
it "receives update_reset_connectivity responses" do
|
263
|
+
@holodeck.mock(Twilio::Response.new(
|
264
|
+
200,
|
265
|
+
%q[
|
266
|
+
{
|
267
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
268
|
+
"unique_name": "unique_name",
|
269
|
+
"commands_callback_method": "http_method",
|
270
|
+
"commands_callback_url": "http://www.example.com",
|
271
|
+
"date_created": "2015-07-30T20:00:00Z",
|
272
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
273
|
+
"friendly_name": "friendly_name",
|
274
|
+
"links": {
|
275
|
+
"data_sessions": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions",
|
276
|
+
"rate_plan": "https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
277
|
+
"usage_records": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords"
|
278
|
+
},
|
279
|
+
"rate_plan_sid": "WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
280
|
+
"sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
281
|
+
"iccid": "iccid",
|
282
|
+
"e_id": "e_id",
|
283
|
+
"status": "active",
|
200
284
|
"reset_status": "resetting",
|
201
285
|
"sms_fallback_method": "http_method",
|
202
286
|
"sms_fallback_url": "http://www.example.com",
|
@@ -80,5 +80,46 @@ describe Twilio::Security::RequestValidator do
|
|
80
80
|
it 'should fail validation with body but no signature' do
|
81
81
|
expect(validator.validate(url, body, default_signature)).to eq(false)
|
82
82
|
end
|
83
|
+
|
84
|
+
it 'should validate https urls with ports by stripping them' do
|
85
|
+
url_with_port = url.sub('.com', '.com:1234')
|
86
|
+
expect(validator.validate(url_with_port, params, default_signature)).to eq(true)
|
87
|
+
end
|
88
|
+
|
89
|
+
it 'should validate http urls with ports' do
|
90
|
+
http_url_with_port = url.sub('.com', '.com:1234')
|
91
|
+
http_url_with_port = http_url_with_port.sub('https', 'http')
|
92
|
+
signature = 'Zmvh+3yNM1Phv2jhDCwEM3q5ebU=' # hash of http url with port 1234
|
93
|
+
expect(validator.validate(http_url_with_port, params, signature)).to eq(true)
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'should validate https urls without ports by adding standard port 443' do
|
97
|
+
signature = 'kvajT1Ptam85bY51eRf/AJRuM3w=' # hash of https url with port 443
|
98
|
+
expect(validator.validate(url, params, signature)).to eq(true)
|
99
|
+
end
|
100
|
+
|
101
|
+
it 'should validate http urls without ports by adding standard port 80' do
|
102
|
+
http_url = url.sub('https', 'http')
|
103
|
+
signature = '0ZXoZLH/DfblKGATFgpif+LLRf4=' # hash of http url with port 80
|
104
|
+
expect(validator.validate(http_url, params, signature)).to eq(true)
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'should validate urls with credentials' do
|
108
|
+
url_with_creds = 'https://user:pass@mycompany.com/myapp.php?foo=1&bar=2'
|
109
|
+
signature = 'CukzLTc1tT5dXEDIHm/tKBanW10=' # expected hash of the url
|
110
|
+
expect(validator.validate(url_with_creds, params, signature)).to eq(true)
|
111
|
+
end
|
112
|
+
|
113
|
+
it 'should validate urls with just username' do
|
114
|
+
url_with_creds = 'https://user@mycompany.com/myapp.php?foo=1&bar=2'
|
115
|
+
signature = '2YRLlVAflCqxaNicjMpJcSTgzSs=' # expected hash of the url
|
116
|
+
expect(validator.validate(url_with_creds, params, signature)).to eq(true)
|
117
|
+
end
|
118
|
+
|
119
|
+
it 'should validate urls with credentials by adding port' do
|
120
|
+
url_with_creds = 'https://user:pass@mycompany.com/myapp.php?foo=1&bar=2'
|
121
|
+
signature = 'ZQFR1PTIZXF2MXB8ZnKCvnnA+rI=' # expected hash of the url with port 443
|
122
|
+
expect(validator.validate(url_with_creds, params, signature)).to eq(true)
|
123
|
+
end
|
83
124
|
end
|
84
125
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.29.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Twilio API Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -366,6 +366,8 @@ files:
|
|
366
366
|
- lib/twilio-ruby/rest/preview/bulk_exports.rb
|
367
367
|
- lib/twilio-ruby/rest/preview/bulk_exports/export.rb
|
368
368
|
- lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb
|
369
|
+
- lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb
|
370
|
+
- lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb
|
369
371
|
- lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb
|
370
372
|
- lib/twilio-ruby/rest/preview/deployed_devices.rb
|
371
373
|
- lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb
|
@@ -729,6 +731,8 @@ files:
|
|
729
731
|
- spec/integration/preview/acc_security/service/verification_spec.rb
|
730
732
|
- spec/integration/preview/acc_security/service_spec.rb
|
731
733
|
- spec/integration/preview/bulk_exports/export/day_spec.rb
|
734
|
+
- spec/integration/preview/bulk_exports/export/export_custom_job_spec.rb
|
735
|
+
- spec/integration/preview/bulk_exports/export/job_spec.rb
|
732
736
|
- spec/integration/preview/bulk_exports/export_configuration_spec.rb
|
733
737
|
- spec/integration/preview/bulk_exports/export_spec.rb
|
734
738
|
- spec/integration/preview/deployed_devices/fleet/certificate_spec.rb
|
@@ -921,8 +925,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
921
925
|
- !ruby/object:Gem::Version
|
922
926
|
version: '0'
|
923
927
|
requirements: []
|
924
|
-
|
925
|
-
rubygems_version: 2.5.2.3
|
928
|
+
rubygems_version: 3.0.3
|
926
929
|
signing_key:
|
927
930
|
specification_version: 4
|
928
931
|
summary: The official library for communicating with the Twilio REST API, building
|
@@ -1102,6 +1105,8 @@ test_files:
|
|
1102
1105
|
- spec/integration/preview/acc_security/service/verification_spec.rb
|
1103
1106
|
- spec/integration/preview/acc_security/service_spec.rb
|
1104
1107
|
- spec/integration/preview/bulk_exports/export/day_spec.rb
|
1108
|
+
- spec/integration/preview/bulk_exports/export/export_custom_job_spec.rb
|
1109
|
+
- spec/integration/preview/bulk_exports/export/job_spec.rb
|
1105
1110
|
- spec/integration/preview/bulk_exports/export_configuration_spec.rb
|
1106
1111
|
- spec/integration/preview/bulk_exports/export_spec.rb
|
1107
1112
|
- spec/integration/preview/deployed_devices/fleet/certificate_spec.rb
|