twilio-ruby 5.37.0 → 5.38.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +32 -9
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +41 -5
- data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +0 -16
- data/lib/twilio-ruby/rest/client.rb +0 -7
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +28 -3
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +8 -8
- data/lib/twilio-ruby/rest/verify/v2/service.rb +26 -0
- data/lib/twilio-ruby/rest/{authy/v1/service/entity.rb → verify/v2/service/webhook.rb} +154 -108
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +60 -0
- data/spec/integration/autopilot/v1/assistant_spec.rb +4 -8
- data/spec/integration/conversations/v1/conversation_spec.rb +16 -0
- data/spec/integration/verify/v2/service/webhook_spec.rb +262 -0
- data/spec/integration/verify/v2/service_spec.rb +8 -4
- metadata +5 -22
- data/lib/twilio-ruby/rest/authy.rb +0 -55
- data/lib/twilio-ruby/rest/authy/v1.rb +0 -59
- data/lib/twilio-ruby/rest/authy/v1/form.rb +0 -197
- data/lib/twilio-ruby/rest/authy/v1/service.rb +0 -404
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor.rb +0 -500
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb +0 -494
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb +0 -222
- data/spec/integration/authy/v1/form_spec.rb +0 -48
- data/spec/integration/authy/v1/service/entity/factor/challenge_spec.rb +0 -353
- data/spec/integration/authy/v1/service/entity/factor_spec.rb +0 -298
- data/spec/integration/authy/v1/service/entity_spec.rb +0 -201
- data/spec/integration/authy/v1/service_spec.rb +0 -231
- data/spec/integration/autopilot/v1/assistant/export_assistant_spec.rb +0 -49
data/lib/twilio-ruby/version.rb
CHANGED
@@ -361,6 +361,36 @@ describe 'Participant' do
|
|
361
361
|
expect(actual).to_not eq(nil)
|
362
362
|
end
|
363
363
|
|
364
|
+
it "receives create_with_friendly_name_jitter_buffer_size responses" do
|
365
|
+
@holodeck.mock(Twilio::Response.new(
|
366
|
+
201,
|
367
|
+
%q[
|
368
|
+
{
|
369
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
370
|
+
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
371
|
+
"label": null,
|
372
|
+
"conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
373
|
+
"date_created": "Fri, 18 Feb 2011 21:07:19 +0000",
|
374
|
+
"date_updated": "Fri, 18 Feb 2011 21:07:19 +0000",
|
375
|
+
"end_conference_on_exit": false,
|
376
|
+
"muted": false,
|
377
|
+
"hold": false,
|
378
|
+
"status": "complete",
|
379
|
+
"start_conference_on_enter": true,
|
380
|
+
"coaching": false,
|
381
|
+
"call_sid_to_coach": null,
|
382
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
383
|
+
}
|
384
|
+
]
|
385
|
+
))
|
386
|
+
|
387
|
+
actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
388
|
+
.conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
389
|
+
.participants.create(from: '+15017122661', to: '+15558675310')
|
390
|
+
|
391
|
+
expect(actual).to_not eq(nil)
|
392
|
+
end
|
393
|
+
|
364
394
|
it "receives create_with_friendly_name_byoc responses" do
|
365
395
|
@holodeck.mock(Twilio::Response.new(
|
366
396
|
201,
|
@@ -391,6 +421,36 @@ describe 'Participant' do
|
|
391
421
|
expect(actual).to_not eq(nil)
|
392
422
|
end
|
393
423
|
|
424
|
+
it "receives create_with_friendly_name_caller_id responses" do
|
425
|
+
@holodeck.mock(Twilio::Response.new(
|
426
|
+
201,
|
427
|
+
%q[
|
428
|
+
{
|
429
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
430
|
+
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
431
|
+
"conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
432
|
+
"date_created": "Fri, 18 Feb 2011 21:07:19 +0000",
|
433
|
+
"date_updated": "Fri, 18 Feb 2011 21:07:19 +0000",
|
434
|
+
"end_conference_on_exit": false,
|
435
|
+
"muted": false,
|
436
|
+
"hold": false,
|
437
|
+
"status": "complete",
|
438
|
+
"start_conference_on_enter": true,
|
439
|
+
"coaching": false,
|
440
|
+
"call_sid_to_coach": null,
|
441
|
+
"label": null,
|
442
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
443
|
+
}
|
444
|
+
]
|
445
|
+
))
|
446
|
+
|
447
|
+
actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
448
|
+
.conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
449
|
+
.participants.create(from: '+15017122661', to: '+15558675310')
|
450
|
+
|
451
|
+
expect(actual).to_not eq(nil)
|
452
|
+
end
|
453
|
+
|
394
454
|
it "can delete" do
|
395
455
|
@holodeck.mock(Twilio::Response.new(500, ''))
|
396
456
|
|
@@ -47,8 +47,7 @@ describe 'Assistant' do
|
|
47
47
|
"style_sheet": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/StyleSheet",
|
48
48
|
"defaults": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Defaults",
|
49
49
|
"dialogues": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Dialogues",
|
50
|
-
"webhooks": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
|
51
|
-
"export_assistant": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Export"
|
50
|
+
"webhooks": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
|
52
51
|
},
|
53
52
|
"url": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
54
53
|
"callback_url": "https://example.com/callback_url",
|
@@ -126,8 +125,7 @@ describe 'Assistant' do
|
|
126
125
|
"style_sheet": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/StyleSheet",
|
127
126
|
"defaults": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Defaults",
|
128
127
|
"dialogues": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Dialogues",
|
129
|
-
"webhooks": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
|
130
|
-
"export_assistant": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Export"
|
128
|
+
"webhooks": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
|
131
129
|
},
|
132
130
|
"url": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
133
131
|
"callback_url": "https://example.com/callback_url",
|
@@ -190,8 +188,7 @@ describe 'Assistant' do
|
|
190
188
|
"style_sheet": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/StyleSheet",
|
191
189
|
"defaults": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Defaults",
|
192
190
|
"dialogues": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Dialogues",
|
193
|
-
"webhooks": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
|
194
|
-
"export_assistant": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Export"
|
191
|
+
"webhooks": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
|
195
192
|
},
|
196
193
|
"url": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
197
194
|
"callback_url": "https://example.com/callback_url",
|
@@ -243,8 +240,7 @@ describe 'Assistant' do
|
|
243
240
|
"style_sheet": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/StyleSheet",
|
244
241
|
"defaults": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Defaults",
|
245
242
|
"dialogues": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Dialogues",
|
246
|
-
"webhooks": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
|
247
|
-
"export_assistant": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Export"
|
243
|
+
"webhooks": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
|
248
244
|
},
|
249
245
|
"url": "https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
250
246
|
"callback_url": "https://example.com/callback_url",
|
@@ -38,6 +38,10 @@ describe 'Conversation' do
|
|
38
38
|
"date_created": "2015-12-16T22:18:37Z",
|
39
39
|
"date_updated": "2015-12-16T22:18:38Z",
|
40
40
|
"state": "inactive",
|
41
|
+
"timers": {
|
42
|
+
"date_inactive": "2015-12-16T22:19:38Z",
|
43
|
+
"date_closed": "2015-12-16T22:28:38Z"
|
44
|
+
},
|
41
45
|
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
42
46
|
"links": {
|
43
47
|
"participants": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants",
|
@@ -82,6 +86,10 @@ describe 'Conversation' do
|
|
82
86
|
"date_created": "2015-12-16T22:18:37Z",
|
83
87
|
"date_updated": "2015-12-16T22:18:38Z",
|
84
88
|
"state": "inactive",
|
89
|
+
"timers": {
|
90
|
+
"date_inactive": "2015-12-16T22:19:38Z",
|
91
|
+
"date_closed": "2015-12-16T22:28:38Z"
|
92
|
+
},
|
85
93
|
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
86
94
|
"links": {
|
87
95
|
"participants": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants",
|
@@ -152,6 +160,10 @@ describe 'Conversation' do
|
|
152
160
|
"date_created": "2015-12-16T22:18:37Z",
|
153
161
|
"date_updated": "2015-12-16T22:18:38Z",
|
154
162
|
"state": "active",
|
163
|
+
"timers": {
|
164
|
+
"date_inactive": "2015-12-16T22:19:38Z",
|
165
|
+
"date_closed": "2015-12-16T22:28:38Z"
|
166
|
+
},
|
155
167
|
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
156
168
|
"links": {
|
157
169
|
"participants": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants",
|
@@ -198,6 +210,10 @@ describe 'Conversation' do
|
|
198
210
|
"date_created": "2015-12-16T22:18:37Z",
|
199
211
|
"date_updated": "2015-12-16T22:18:38Z",
|
200
212
|
"state": "active",
|
213
|
+
"timers": {
|
214
|
+
"date_inactive": "2015-12-16T22:19:38Z",
|
215
|
+
"date_closed": "2015-12-16T22:28:38Z"
|
216
|
+
},
|
201
217
|
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
202
218
|
"links": {
|
203
219
|
"participants": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants",
|
@@ -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
|
@@ -54,7 +54,8 @@ describe 'Service' do
|
|
54
54
|
"verifications": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications",
|
55
55
|
"rate_limits": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits",
|
56
56
|
"messaging_configurations": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations",
|
57
|
-
"entities": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities"
|
57
|
+
"entities": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities",
|
58
|
+
"webhooks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
|
58
59
|
}
|
59
60
|
}
|
60
61
|
]
|
@@ -109,7 +110,8 @@ describe 'Service' do
|
|
109
110
|
"verifications": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications",
|
110
111
|
"rate_limits": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits",
|
111
112
|
"messaging_configurations": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations",
|
112
|
-
"entities": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities"
|
113
|
+
"entities": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities",
|
114
|
+
"webhooks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
|
113
115
|
}
|
114
116
|
}
|
115
117
|
]
|
@@ -201,7 +203,8 @@ describe 'Service' do
|
|
201
203
|
"verifications": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications",
|
202
204
|
"rate_limits": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits",
|
203
205
|
"messaging_configurations": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations",
|
204
|
-
"entities": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities"
|
206
|
+
"entities": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities",
|
207
|
+
"webhooks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
|
205
208
|
}
|
206
209
|
}
|
207
210
|
]
|
@@ -258,7 +261,8 @@ describe 'Service' do
|
|
258
261
|
"verifications": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications",
|
259
262
|
"rate_limits": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits",
|
260
263
|
"messaging_configurations": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations",
|
261
|
-
"entities": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities"
|
264
|
+
"entities": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities",
|
265
|
+
"webhooks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
|
262
266
|
}
|
263
267
|
}
|
264
268
|
]
|