twilio-ruby 5.32.0 → 5.33.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 +26 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/jwt/task_router.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +22 -3
- data/lib/twilio-ruby/rest/authy/v1/service.rb +14 -5
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb +89 -0
- data/lib/twilio-ruby/rest/bulkexports.rb +54 -0
- data/lib/twilio-ruby/rest/bulkexports/v1.rb +58 -0
- data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +254 -0
- data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +316 -0
- data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +298 -0
- data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +253 -0
- data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +242 -0
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +1 -1
- data/lib/twilio-ruby/rest/client.rb +7 -0
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +1 -1
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +1 -1
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +30 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +247 -0
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +5 -5
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/sip/domain_spec.rb +8 -4
- data/spec/integration/authy/v1/service/entity/factor/challenge_spec.rb +91 -0
- data/spec/integration/bulkexports/v1/export/day_spec.rb +117 -0
- data/spec/integration/bulkexports/v1/export/export_custom_job_spec.rb +129 -0
- data/spec/integration/bulkexports/v1/export/job_spec.rb +80 -0
- data/spec/integration/bulkexports/v1/export_configuration_spec.rb +79 -0
- data/spec/integration/bulkexports/v1/export_spec.rb +45 -0
- data/spec/integration/flex_api/v1/configuration_spec.rb +150 -0
- data/spec/integration/serverless/v1/service/environment/deployment_spec.rb +3 -4
- data/spec/integration/serverless/v1/service/function/function_version/function_version_content_spec.rb +52 -0
- data/spec/integration/serverless/v1/service/function/function_version_spec.rb +4 -1
- metadata +22 -2
@@ -176,6 +176,97 @@ describe 'Challenge' do
|
|
176
176
|
expect(actual).to_not eq(nil)
|
177
177
|
end
|
178
178
|
|
179
|
+
it "can read" do
|
180
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
181
|
+
|
182
|
+
expect {
|
183
|
+
@client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
184
|
+
.entities('identity') \
|
185
|
+
.factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
186
|
+
.challenges.list()
|
187
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
188
|
+
|
189
|
+
values = {}
|
190
|
+
expect(
|
191
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
192
|
+
method: 'get',
|
193
|
+
url: 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Challenges',
|
194
|
+
))).to eq(true)
|
195
|
+
end
|
196
|
+
|
197
|
+
it "receives read_empty responses" do
|
198
|
+
@holodeck.mock(Twilio::Response.new(
|
199
|
+
200,
|
200
|
+
%q[
|
201
|
+
{
|
202
|
+
"challenges": [],
|
203
|
+
"meta": {
|
204
|
+
"page": 0,
|
205
|
+
"page_size": 50,
|
206
|
+
"first_page_url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges?PageSize=50&Page=0",
|
207
|
+
"previous_page_url": null,
|
208
|
+
"url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges?PageSize=50&Page=0",
|
209
|
+
"next_page_url": null,
|
210
|
+
"key": "challenges"
|
211
|
+
}
|
212
|
+
}
|
213
|
+
]
|
214
|
+
))
|
215
|
+
|
216
|
+
actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
217
|
+
.entities('identity') \
|
218
|
+
.factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
219
|
+
.challenges.list()
|
220
|
+
|
221
|
+
expect(actual).to_not eq(nil)
|
222
|
+
end
|
223
|
+
|
224
|
+
it "receives read_full responses" do
|
225
|
+
@holodeck.mock(Twilio::Response.new(
|
226
|
+
200,
|
227
|
+
%q[
|
228
|
+
{
|
229
|
+
"challenges": [
|
230
|
+
{
|
231
|
+
"sid": "YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
232
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
233
|
+
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
234
|
+
"entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
235
|
+
"identity": "ff483d1ff591898a9942916050d2ca3f",
|
236
|
+
"factor_sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
237
|
+
"date_created": "2015-07-30T20:00:00Z",
|
238
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
239
|
+
"date_responded": "2015-07-30T20:00:00Z",
|
240
|
+
"expiration_date": "2015-07-30T20:00:00Z",
|
241
|
+
"status": "pending",
|
242
|
+
"responded_reason": "none",
|
243
|
+
"details": "details",
|
244
|
+
"hidden_details": "hidden_details",
|
245
|
+
"factor_type": "sms",
|
246
|
+
"url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
247
|
+
}
|
248
|
+
],
|
249
|
+
"meta": {
|
250
|
+
"page": 0,
|
251
|
+
"page_size": 50,
|
252
|
+
"first_page_url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges?PageSize=50&Page=0",
|
253
|
+
"previous_page_url": null,
|
254
|
+
"url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges?PageSize=50&Page=0",
|
255
|
+
"next_page_url": null,
|
256
|
+
"key": "challenges"
|
257
|
+
}
|
258
|
+
}
|
259
|
+
]
|
260
|
+
))
|
261
|
+
|
262
|
+
actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
263
|
+
.entities('identity') \
|
264
|
+
.factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
265
|
+
.challenges.list()
|
266
|
+
|
267
|
+
expect(actual).to_not eq(nil)
|
268
|
+
end
|
269
|
+
|
179
270
|
it "can update" do
|
180
271
|
@holodeck.mock(Twilio::Response.new(500, ''))
|
181
272
|
|
@@ -0,0 +1,117 @@
|
|
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 'Day' do
|
12
|
+
it "can fetch" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.bulkexports.v1.exports('resource_type') \
|
17
|
+
.days('day').fetch()
|
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://bulkexports.twilio.com/v1/Exports/resource_type/Days/day',
|
25
|
+
))).to eq(true)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "receives fetch responses" do
|
29
|
+
@holodeck.mock(Twilio::Response.new(
|
30
|
+
200,
|
31
|
+
%q[
|
32
|
+
{
|
33
|
+
"redirect_to": "https://api.bulkexports.s3.amazonaws.com/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
34
|
+
}
|
35
|
+
]
|
36
|
+
))
|
37
|
+
|
38
|
+
actual = @client.bulkexports.v1.exports('resource_type') \
|
39
|
+
.days('day').fetch()
|
40
|
+
|
41
|
+
expect(actual).to_not eq(nil)
|
42
|
+
end
|
43
|
+
|
44
|
+
it "can read" do
|
45
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
46
|
+
|
47
|
+
expect {
|
48
|
+
@client.bulkexports.v1.exports('resource_type') \
|
49
|
+
.days.list()
|
50
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
51
|
+
|
52
|
+
values = {}
|
53
|
+
expect(
|
54
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
55
|
+
method: 'get',
|
56
|
+
url: 'https://bulkexports.twilio.com/v1/Exports/resource_type/Days',
|
57
|
+
))).to eq(true)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "receives read_empty responses" do
|
61
|
+
@holodeck.mock(Twilio::Response.new(
|
62
|
+
200,
|
63
|
+
%q[
|
64
|
+
{
|
65
|
+
"days": [],
|
66
|
+
"meta": {
|
67
|
+
"page": 0,
|
68
|
+
"page_size": 50,
|
69
|
+
"first_page_url": "https://bulkexports.twilio.com/v1/Exports/Calls/Days?PageSize=50&Page=0",
|
70
|
+
"previous_page_url": null,
|
71
|
+
"url": "https://bulkexports.twilio.com/v1/Exports/Calls/Days?PageSize=50&Page=0",
|
72
|
+
"next_page_url": null,
|
73
|
+
"key": "days"
|
74
|
+
}
|
75
|
+
}
|
76
|
+
]
|
77
|
+
))
|
78
|
+
|
79
|
+
actual = @client.bulkexports.v1.exports('resource_type') \
|
80
|
+
.days.list()
|
81
|
+
|
82
|
+
expect(actual).to_not eq(nil)
|
83
|
+
end
|
84
|
+
|
85
|
+
it "receives read_full responses" do
|
86
|
+
@holodeck.mock(Twilio::Response.new(
|
87
|
+
200,
|
88
|
+
%q[
|
89
|
+
{
|
90
|
+
"days": [
|
91
|
+
{
|
92
|
+
"day": "2017-04-01",
|
93
|
+
"size": 100,
|
94
|
+
"resource_type": "Calls",
|
95
|
+
"create_date": "2017-04-02",
|
96
|
+
"friendly_name": "friendly_name"
|
97
|
+
}
|
98
|
+
],
|
99
|
+
"meta": {
|
100
|
+
"page": 0,
|
101
|
+
"page_size": 50,
|
102
|
+
"first_page_url": "https://bulkexports.twilio.com/v1/Exports/Calls/Days?PageSize=50&Page=0",
|
103
|
+
"previous_page_url": null,
|
104
|
+
"url": "https://bulkexports.twilio.com/v1/Exports/Calls/Days?PageSize=50&Page=0",
|
105
|
+
"next_page_url": null,
|
106
|
+
"key": "days"
|
107
|
+
}
|
108
|
+
}
|
109
|
+
]
|
110
|
+
))
|
111
|
+
|
112
|
+
actual = @client.bulkexports.v1.exports('resource_type') \
|
113
|
+
.days.list()
|
114
|
+
|
115
|
+
expect(actual).to_not eq(nil)
|
116
|
+
end
|
117
|
+
end
|
@@ -0,0 +1,129 @@
|
|
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 'ExportCustomJob' do
|
12
|
+
it "can read" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.bulkexports.v1.exports('resource_type') \
|
17
|
+
.export_custom_jobs.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://bulkexports.twilio.com/v1/Exports/resource_type/Jobs',
|
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
|
+
"meta": {
|
34
|
+
"previous_page_url": null,
|
35
|
+
"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Jobs?PageSize=50&Page=0",
|
36
|
+
"page_size": 50,
|
37
|
+
"key": "jobs",
|
38
|
+
"first_page_url": "https://bulkexports.twilio.com/v1/Exports/Messages/Jobs?PageSize=50&Page=0",
|
39
|
+
"next_page_url": null,
|
40
|
+
"page": 0
|
41
|
+
},
|
42
|
+
"jobs": []
|
43
|
+
}
|
44
|
+
]
|
45
|
+
))
|
46
|
+
|
47
|
+
actual = @client.bulkexports.v1.exports('resource_type') \
|
48
|
+
.export_custom_jobs.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
|
+
"meta": {
|
59
|
+
"previous_page_url": null,
|
60
|
+
"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Jobs?PageSize=50&Page=0",
|
61
|
+
"page_size": 50,
|
62
|
+
"key": "jobs",
|
63
|
+
"first_page_url": "https://bulkexports.twilio.com/v1/Exports/Messages/Jobs?PageSize=50&Page=0",
|
64
|
+
"next_page_url": null,
|
65
|
+
"page": 0
|
66
|
+
},
|
67
|
+
"jobs": [
|
68
|
+
{
|
69
|
+
"start_day": "start_day",
|
70
|
+
"job_sid": "JSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
71
|
+
"friendly_name": "friendly_name",
|
72
|
+
"webhook_method": "webhook_method",
|
73
|
+
"details": {},
|
74
|
+
"end_day": "end_day",
|
75
|
+
"webhook_url": "webhook_url",
|
76
|
+
"email": "email",
|
77
|
+
"resource_type": "resource_type"
|
78
|
+
}
|
79
|
+
]
|
80
|
+
}
|
81
|
+
]
|
82
|
+
))
|
83
|
+
|
84
|
+
actual = @client.bulkexports.v1.exports('resource_type') \
|
85
|
+
.export_custom_jobs.list()
|
86
|
+
|
87
|
+
expect(actual).to_not eq(nil)
|
88
|
+
end
|
89
|
+
|
90
|
+
it "can create" do
|
91
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
92
|
+
|
93
|
+
expect {
|
94
|
+
@client.bulkexports.v1.exports('resource_type') \
|
95
|
+
.export_custom_jobs.create()
|
96
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
97
|
+
|
98
|
+
values = {}
|
99
|
+
expect(
|
100
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
101
|
+
method: 'post',
|
102
|
+
url: 'https://bulkexports.twilio.com/v1/Exports/resource_type/Jobs',
|
103
|
+
))).to eq(true)
|
104
|
+
end
|
105
|
+
|
106
|
+
it "receives create responses" do
|
107
|
+
@holodeck.mock(Twilio::Response.new(
|
108
|
+
201,
|
109
|
+
%q[
|
110
|
+
{
|
111
|
+
"start_day": "start_day",
|
112
|
+
"job_sid": "JSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
113
|
+
"friendly_name": "friendly_name",
|
114
|
+
"webhook_method": "webhook_method",
|
115
|
+
"details": {},
|
116
|
+
"end_day": "end_day",
|
117
|
+
"webhook_url": "webhook_url",
|
118
|
+
"email": "email",
|
119
|
+
"resource_type": "resource_type"
|
120
|
+
}
|
121
|
+
]
|
122
|
+
))
|
123
|
+
|
124
|
+
actual = @client.bulkexports.v1.exports('resource_type') \
|
125
|
+
.export_custom_jobs.create()
|
126
|
+
|
127
|
+
expect(actual).to_not eq(nil)
|
128
|
+
end
|
129
|
+
end
|
@@ -0,0 +1,80 @@
|
|
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 'Job' do
|
12
|
+
it "can fetch" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.bulkexports.v1.exports \
|
17
|
+
.jobs('JSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
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://bulkexports.twilio.com/v1/Exports/Jobs/JSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
25
|
+
))).to eq(true)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "receives fetch responses" do
|
29
|
+
@holodeck.mock(Twilio::Response.new(
|
30
|
+
200,
|
31
|
+
%q[
|
32
|
+
{
|
33
|
+
"start_day": "start_day",
|
34
|
+
"job_sid": "JSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
|
+
"url": "https://bulkexports.twilio.com/v1/Exports/Jobs/JSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
|
+
"friendly_name": "friendly_name",
|
37
|
+
"end_day": "end_day",
|
38
|
+
"details": {},
|
39
|
+
"webhook_url": "webhook_url",
|
40
|
+
"webhook_method": "webhook_method",
|
41
|
+
"email": "email",
|
42
|
+
"resource_type": "resource_type"
|
43
|
+
}
|
44
|
+
]
|
45
|
+
))
|
46
|
+
|
47
|
+
actual = @client.bulkexports.v1.exports \
|
48
|
+
.jobs('JSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
49
|
+
|
50
|
+
expect(actual).to_not eq(nil)
|
51
|
+
end
|
52
|
+
|
53
|
+
it "can delete" do
|
54
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
55
|
+
|
56
|
+
expect {
|
57
|
+
@client.bulkexports.v1.exports \
|
58
|
+
.jobs('JSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
59
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
60
|
+
|
61
|
+
values = {}
|
62
|
+
expect(
|
63
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
64
|
+
method: 'delete',
|
65
|
+
url: 'https://bulkexports.twilio.com/v1/Exports/Jobs/JSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
66
|
+
))).to eq(true)
|
67
|
+
end
|
68
|
+
|
69
|
+
it "receives delete responses" do
|
70
|
+
@holodeck.mock(Twilio::Response.new(
|
71
|
+
204,
|
72
|
+
nil,
|
73
|
+
))
|
74
|
+
|
75
|
+
actual = @client.bulkexports.v1.exports \
|
76
|
+
.jobs('JSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
77
|
+
|
78
|
+
expect(actual).to eq(true)
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,79 @@
|
|
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 'ExportConfiguration' do
|
12
|
+
it "can fetch" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.bulkexports.v1.export_configuration('resource_type').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://bulkexports.twilio.com/v1/Exports/resource_type/Configuration',
|
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
|
+
"url": "https://bulkexports.twilio.com/v1/Exports/Calls/Configuration",
|
33
|
+
"enabled": true,
|
34
|
+
"webhook_url": "",
|
35
|
+
"webhook_method": "",
|
36
|
+
"resource_type": "Calls"
|
37
|
+
}
|
38
|
+
]
|
39
|
+
))
|
40
|
+
|
41
|
+
actual = @client.bulkexports.v1.export_configuration('resource_type').fetch()
|
42
|
+
|
43
|
+
expect(actual).to_not eq(nil)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "can update" do
|
47
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
48
|
+
|
49
|
+
expect {
|
50
|
+
@client.bulkexports.v1.export_configuration('resource_type').update()
|
51
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
52
|
+
|
53
|
+
values = {}
|
54
|
+
expect(
|
55
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
56
|
+
method: 'post',
|
57
|
+
url: 'https://bulkexports.twilio.com/v1/Exports/resource_type/Configuration',
|
58
|
+
))).to eq(true)
|
59
|
+
end
|
60
|
+
|
61
|
+
it "receives update responses" do
|
62
|
+
@holodeck.mock(Twilio::Response.new(
|
63
|
+
200,
|
64
|
+
%q[
|
65
|
+
{
|
66
|
+
"url": "https://bulkexports.twilio.com/v1/Exports/Calls/Configuration",
|
67
|
+
"enabled": true,
|
68
|
+
"webhook_url": "",
|
69
|
+
"resource_type": "Calls",
|
70
|
+
"webhook_method": ""
|
71
|
+
}
|
72
|
+
]
|
73
|
+
))
|
74
|
+
|
75
|
+
actual = @client.bulkexports.v1.export_configuration('resource_type').update()
|
76
|
+
|
77
|
+
expect(actual).to_not eq(nil)
|
78
|
+
end
|
79
|
+
end
|