twilio-ruby 5.19.0 → 5.20.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 +4 -4
- data/CHANGES.md +13 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api.rb +16 -13
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +85 -88
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +135 -146
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +21 -17
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +14 -8
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +150 -166
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +174 -79
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +147 -160
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +174 -79
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +174 -79
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +147 -160
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +174 -79
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +51 -51
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +246 -251
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +31 -26
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +34 -26
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +109 -112
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +108 -112
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +108 -112
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +21 -11
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +7 -6
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +7 -6
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +32 -25
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +36 -36
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +2 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +70 -66
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb +10 -10
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping.rb +14 -14
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb +26 -23
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping.rb +26 -23
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping.rb +12 -12
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.rb +26 -23
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +11 -9
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +2 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +56 -47
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +59 -47
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +76 -74
- data/lib/twilio-ruby/rest/authy.rb +8 -8
- data/lib/twilio-ruby/rest/authy/v1.rb +15 -15
- data/lib/twilio-ruby/rest/client.rb +16 -13
- data/lib/twilio-ruby/rest/messaging.rb +15 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +23 -0
- data/lib/twilio-ruby/rest/messaging/v1/session.rb +482 -0
- data/lib/twilio-ruby/rest/messaging/v1/session/message.rb +434 -0
- data/lib/twilio-ruby/rest/messaging/v1/session/participant.rb +458 -0
- data/lib/twilio-ruby/rest/messaging/v1/webhook.rb +285 -0
- data/lib/twilio-ruby/rest/preview.rb +8 -8
- data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +3 -2
- data/lib/twilio-ruby/rest/video.rb +9 -9
- data/lib/twilio-ruby/rest/video/v1.rb +16 -16
- data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -6
- data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +37 -21
- data/lib/twilio-ruby/rest/video/v1/recording.rb +12 -3
- data/lib/twilio-ruby/security/request_validator.rb +2 -2
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/messaging/v1/session/message_spec.rb +238 -0
- data/spec/integration/messaging/v1/session/participant_spec.rb +256 -0
- data/spec/integration/messaging/v1/session_spec.rb +223 -0
- data/spec/integration/messaging/v1/webhook_spec.rb +92 -0
- data/spec/integration/video/v1/composition_hook_spec.rb +1 -1
- data/spec/security/request_validator_spec.rb +5 -7
- metadata +14 -2
@@ -0,0 +1,92 @@
|
|
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 fetch" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.messaging.v1.webhooks().fetch()
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
values = {}
|
20
|
+
expect(
|
21
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
22
|
+
method: 'get',
|
23
|
+
url: 'https://messaging.twilio.com/v1/Sessions/Webhooks',
|
24
|
+
))).to eq(true)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "receives fetch responses" do
|
28
|
+
@holodeck.mock(Twilio::Response.new(
|
29
|
+
200,
|
30
|
+
%q[
|
31
|
+
{
|
32
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
33
|
+
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"pre_webhook_url": "http://pre.url",
|
35
|
+
"post_webhook_url": "http://post.url",
|
36
|
+
"webhook_method": "GET",
|
37
|
+
"webhook_filters": [
|
38
|
+
"onMessageSend",
|
39
|
+
"onSessionAdded"
|
40
|
+
],
|
41
|
+
"pre_webhook_retry_count": 1,
|
42
|
+
"post_webhook_retry_count": 2,
|
43
|
+
"url": "https://messaging.twilio.com/v1/Sessions/Webhooks"
|
44
|
+
}
|
45
|
+
]
|
46
|
+
))
|
47
|
+
|
48
|
+
actual = @client.messaging.v1.webhooks().fetch()
|
49
|
+
|
50
|
+
expect(actual).to_not eq(nil)
|
51
|
+
end
|
52
|
+
|
53
|
+
it "can update" do
|
54
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
55
|
+
|
56
|
+
expect {
|
57
|
+
@client.messaging.v1.webhooks().update()
|
58
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
59
|
+
|
60
|
+
values = {}
|
61
|
+
expect(
|
62
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
63
|
+
method: 'post',
|
64
|
+
url: 'https://messaging.twilio.com/v1/Sessions/Webhooks',
|
65
|
+
))).to eq(true)
|
66
|
+
end
|
67
|
+
|
68
|
+
it "receives update responses" do
|
69
|
+
@holodeck.mock(Twilio::Response.new(
|
70
|
+
200,
|
71
|
+
%q[
|
72
|
+
{
|
73
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
74
|
+
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
75
|
+
"pre_webhook_url": "http://pre.url",
|
76
|
+
"post_webhook_url": "http://post.url",
|
77
|
+
"webhook_method": "GET",
|
78
|
+
"webhook_filters": [
|
79
|
+
"onSessionAdded"
|
80
|
+
],
|
81
|
+
"pre_webhook_retry_count": 1,
|
82
|
+
"post_webhook_retry_count": 2,
|
83
|
+
"url": "https://messaging.twilio.com/v1/Sessions/Webhooks"
|
84
|
+
}
|
85
|
+
]
|
86
|
+
))
|
87
|
+
|
88
|
+
actual = @client.messaging.v1.webhooks().update()
|
89
|
+
|
90
|
+
expect(actual).to_not eq(nil)
|
91
|
+
end
|
92
|
+
end
|
@@ -137,7 +137,7 @@ describe 'CompositionHook' do
|
|
137
137
|
"composition_hooks": [
|
138
138
|
{
|
139
139
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
140
|
-
"friendly_name": "My
|
140
|
+
"friendly_name": "My Special Hook1",
|
141
141
|
"enabled": true,
|
142
142
|
"date_created": "2015-07-30T20:00:00Z",
|
143
143
|
"date_updated": "2015-07-30T20:01:33Z",
|
@@ -40,9 +40,7 @@ describe Twilio::Security::RequestValidator do
|
|
40
40
|
|
41
41
|
let(:body) { '{"property": "value", "boolean": true}' }
|
42
42
|
|
43
|
-
let(:body_hash) { '
|
44
|
-
|
45
|
-
let(:body_hash_encoded) { body_hash.gsub('+', '%2B').gsub('=', '%3D') }
|
43
|
+
let(:body_hash) { '0a1ff7634d9ab3b95db5c9a2dfe9416e41502b283a80c7cf19632632f96e6620' }
|
46
44
|
|
47
45
|
let(:params) do
|
48
46
|
{
|
@@ -70,13 +68,13 @@ describe Twilio::Security::RequestValidator do
|
|
70
68
|
end
|
71
69
|
|
72
70
|
it 'should validate requests with body correctly' do
|
73
|
-
url_with_hash = "#{url}&bodySHA256=#{
|
74
|
-
expect(validator.validate(url_with_hash, body, '
|
71
|
+
url_with_hash = "#{url}&bodySHA256=#{body_hash}"
|
72
|
+
expect(validator.validate(url_with_hash, body, 'a9nBmqA0ju/hNViExpshrM61xv4=')).to eq(true)
|
75
73
|
end
|
76
74
|
|
77
75
|
it 'should validate with no other GET parameters' do
|
78
|
-
url_with_hash = "https://mycompany.com/myapp.php?bodySHA256=#{
|
79
|
-
expect(validator.validate(url_with_hash, body, '
|
76
|
+
url_with_hash = "https://mycompany.com/myapp.php?bodySHA256=#{body_hash}"
|
77
|
+
expect(validator.validate(url_with_hash, body, 'y77kIzt2vzLz71DgmJGsen2scGs=')).to eq(true)
|
80
78
|
end
|
81
79
|
|
82
80
|
it 'should fail validation with body but no signature' do
|
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.20.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-
|
11
|
+
date: 2019-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -328,6 +328,10 @@ files:
|
|
328
328
|
- lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb
|
329
329
|
- lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb
|
330
330
|
- lib/twilio-ruby/rest/messaging/v1/service/short_code.rb
|
331
|
+
- lib/twilio-ruby/rest/messaging/v1/session.rb
|
332
|
+
- lib/twilio-ruby/rest/messaging/v1/session/message.rb
|
333
|
+
- lib/twilio-ruby/rest/messaging/v1/session/participant.rb
|
334
|
+
- lib/twilio-ruby/rest/messaging/v1/webhook.rb
|
331
335
|
- lib/twilio-ruby/rest/monitor.rb
|
332
336
|
- lib/twilio-ruby/rest/monitor/v1.rb
|
333
337
|
- lib/twilio-ruby/rest/monitor/v1/alert.rb
|
@@ -659,6 +663,10 @@ files:
|
|
659
663
|
- spec/integration/messaging/v1/service/phone_number_spec.rb
|
660
664
|
- spec/integration/messaging/v1/service/short_code_spec.rb
|
661
665
|
- spec/integration/messaging/v1/service_spec.rb
|
666
|
+
- spec/integration/messaging/v1/session/message_spec.rb
|
667
|
+
- spec/integration/messaging/v1/session/participant_spec.rb
|
668
|
+
- spec/integration/messaging/v1/session_spec.rb
|
669
|
+
- spec/integration/messaging/v1/webhook_spec.rb
|
662
670
|
- spec/integration/monitor/v1/alert_spec.rb
|
663
671
|
- spec/integration/monitor/v1/event_spec.rb
|
664
672
|
- spec/integration/notify/v1/credential_spec.rb
|
@@ -994,6 +1002,10 @@ test_files:
|
|
994
1002
|
- spec/integration/messaging/v1/service/phone_number_spec.rb
|
995
1003
|
- spec/integration/messaging/v1/service/short_code_spec.rb
|
996
1004
|
- spec/integration/messaging/v1/service_spec.rb
|
1005
|
+
- spec/integration/messaging/v1/session/message_spec.rb
|
1006
|
+
- spec/integration/messaging/v1/session/participant_spec.rb
|
1007
|
+
- spec/integration/messaging/v1/session_spec.rb
|
1008
|
+
- spec/integration/messaging/v1/webhook_spec.rb
|
997
1009
|
- spec/integration/monitor/v1/alert_spec.rb
|
998
1010
|
- spec/integration/monitor/v1/event_spec.rb
|
999
1011
|
- spec/integration/notify/v1/credential_spec.rb
|