twilio-ruby 5.31.5 → 5.31.6
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/.rubocop.yml +1 -0
- data/CHANGES.md +31 -0
- data/Gemfile +0 -9
- data/Makefile +5 -14
- data/README.md +2 -2
- data/Rakefile +0 -54
- data/githooks/pre-commit +0 -0
- data/lib/twilio-ruby/rest/authy/v1/service.rb +12 -2
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor.rb +0 -7
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb +0 -7
- data/lib/twilio-ruby/rest/client.rb +7 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +1 -1
- data/lib/twilio-ruby/rest/preview.rb +0 -6
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +8 -2
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +113 -8
- data/lib/twilio-ruby/rest/preview/trusted_comms.rb +0 -7
- data/lib/twilio-ruby/rest/serverless/v1/service.rb +23 -4
- data/lib/twilio-ruby/rest/supersim.rb +70 -0
- data/lib/twilio-ruby/rest/supersim/v1.rb +80 -0
- data/lib/twilio-ruby/rest/supersim/v1/command.rb +381 -0
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +390 -0
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +380 -0
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +274 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +4 -3
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/call/payment_spec.rb +3 -3
- data/spec/integration/api/v2010/account/message_spec.rb +1 -1
- data/spec/integration/authy/v1/service/entity/factor/challenge_spec.rb +0 -5
- data/spec/integration/authy/v1/service/entity/factor_spec.rb +0 -4
- data/spec/integration/authy/v1/service_spec.rb +4 -0
- data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +9 -3
- data/spec/integration/preview/bulk_exports/export/day_spec.rb +67 -8
- data/spec/integration/serverless/v1/service_spec.rb +3 -0
- data/spec/integration/supersim/v1/command_spec.rb +186 -0
- data/spec/integration/supersim/v1/fleet_spec.rb +208 -0
- data/spec/integration/supersim/v1/sim_spec.rb +231 -0
- data/spec/integration/supersim/v1/usage_record_spec.rb +203 -0
- data/spec/integration/verify/v2/service/verification_spec.rb +42 -30
- data/spec/integration/video/v1/room/room_participant/room_participant_subscribe_rule_spec.rb +1 -1
- data/spec/integration/voice/v1/dialing_permissions/settings_spec.rb +1 -1
- data/twilio-ruby.gemspec +5 -0
- metadata +86 -5
- data/lib/twilio-ruby/rest/preview/trusted_comms/device.rb +0 -146
- data/spec/integration/preview/trusted_comms/device_spec.rb +0 -45
@@ -9,6 +9,38 @@
|
|
9
9
|
require 'spec_helper.rb'
|
10
10
|
|
11
11
|
describe 'Day' do
|
12
|
+
it "can fetch" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.preview.bulk_exports.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://preview.twilio.com/BulkExports/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://com.twilio.dev-us1.exports.s3.amazonaws.com/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
34
|
+
}
|
35
|
+
]
|
36
|
+
))
|
37
|
+
|
38
|
+
actual = @client.preview.bulk_exports.exports('resource_type') \
|
39
|
+
.days('day').fetch()
|
40
|
+
|
41
|
+
expect(actual).to_not eq(nil)
|
42
|
+
end
|
43
|
+
|
12
44
|
it "can read" do
|
13
45
|
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
46
|
|
@@ -25,26 +57,53 @@ describe 'Day' do
|
|
25
57
|
))).to eq(true)
|
26
58
|
end
|
27
59
|
|
28
|
-
it "receives
|
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://preview.twilio.com/BulkExports/Exports/Calls/Days?PageSize=50&Page=0",
|
70
|
+
"previous_page_url": null,
|
71
|
+
"url": "https://preview.twilio.com/BulkExports/Exports/Calls/Days?PageSize=50&Page=0",
|
72
|
+
"next_page_url": null,
|
73
|
+
"key": "days"
|
74
|
+
}
|
75
|
+
}
|
76
|
+
]
|
77
|
+
))
|
78
|
+
|
79
|
+
actual = @client.preview.bulk_exports.exports('resource_type') \
|
80
|
+
.days.list()
|
81
|
+
|
82
|
+
expect(actual).to_not eq(nil)
|
83
|
+
end
|
84
|
+
|
85
|
+
it "receives read_full responses" do
|
29
86
|
@holodeck.mock(Twilio::Response.new(
|
30
87
|
200,
|
31
88
|
%q[
|
32
89
|
{
|
33
90
|
"days": [
|
34
91
|
{
|
35
|
-
"day": "2017-
|
36
|
-
"size":
|
37
|
-
"resource_type": "Calls"
|
92
|
+
"day": "2017-04-01",
|
93
|
+
"size": 100,
|
94
|
+
"resource_type": "Calls",
|
95
|
+
"create_date": "2017-04-02",
|
96
|
+
"friendly_name": "friendly_name"
|
38
97
|
}
|
39
98
|
],
|
40
99
|
"meta": {
|
41
|
-
"key": "days",
|
42
|
-
"page_size": 50,
|
43
|
-
"url": "https://preview.twilio.com/BulkExports/Exports/Calls/Days?PageSize=50&Page=0",
|
44
100
|
"page": 0,
|
101
|
+
"page_size": 50,
|
45
102
|
"first_page_url": "https://preview.twilio.com/BulkExports/Exports/Calls/Days?PageSize=50&Page=0",
|
46
103
|
"previous_page_url": null,
|
47
|
-
"
|
104
|
+
"url": "https://preview.twilio.com/BulkExports/Exports/Calls/Days?PageSize=50&Page=0",
|
105
|
+
"next_page_url": null,
|
106
|
+
"key": "days"
|
48
107
|
}
|
49
108
|
}
|
50
109
|
]
|
@@ -73,6 +73,7 @@ describe 'Service' do
|
|
73
73
|
"friendly_name": "test-service",
|
74
74
|
"unique_name": "test-service-1",
|
75
75
|
"include_credentials": true,
|
76
|
+
"ui_editable": false,
|
76
77
|
"date_created": "2018-11-10T20:00:00Z",
|
77
78
|
"date_updated": "2018-11-10T20:00:00Z",
|
78
79
|
"url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000",
|
@@ -143,6 +144,7 @@ describe 'Service' do
|
|
143
144
|
"friendly_name": "service-friendly",
|
144
145
|
"unique_name": "service-unique",
|
145
146
|
"include_credentials": true,
|
147
|
+
"ui_editable": false,
|
146
148
|
"date_created": "2018-11-10T20:00:00Z",
|
147
149
|
"date_updated": "2018-11-10T20:00:00Z",
|
148
150
|
"url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000",
|
@@ -186,6 +188,7 @@ describe 'Service' do
|
|
186
188
|
"friendly_name": "service-friendly-update",
|
187
189
|
"unique_name": "service-unique-update",
|
188
190
|
"include_credentials": true,
|
191
|
+
"ui_editable": true,
|
189
192
|
"date_created": "2018-11-10T20:00:00Z",
|
190
193
|
"date_updated": "2018-11-10T20:00:00Z",
|
191
194
|
"url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000",
|
@@ -0,0 +1,186 @@
|
|
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 'Command' do
|
12
|
+
it "can create" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.supersim.v1.commands.create(sim: 'HSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', command: 'command')
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
values = {'Sim' => 'HSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'Command' => 'command', }
|
20
|
+
expect(
|
21
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
22
|
+
method: 'post',
|
23
|
+
url: 'https://supersim.twilio.com/v1/Commands',
|
24
|
+
data: values,
|
25
|
+
))).to eq(true)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "receives create_command_minimal responses" do
|
29
|
+
@holodeck.mock(Twilio::Response.new(
|
30
|
+
201,
|
31
|
+
%q[
|
32
|
+
{
|
33
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"command": "command",
|
35
|
+
"date_created": "2015-07-30T20:00:00Z",
|
36
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
37
|
+
"sim_sid": "HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
+
"sid": "HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
39
|
+
"status": "queued",
|
40
|
+
"direction": "to_sim",
|
41
|
+
"url": "https://supersim.twilio.com/v1/Commands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
42
|
+
}
|
43
|
+
]
|
44
|
+
))
|
45
|
+
|
46
|
+
actual = @client.supersim.v1.commands.create(sim: 'HSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', command: 'command')
|
47
|
+
|
48
|
+
expect(actual).to_not eq(nil)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "receives create_command_full responses" do
|
52
|
+
@holodeck.mock(Twilio::Response.new(
|
53
|
+
201,
|
54
|
+
%q[
|
55
|
+
{
|
56
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
57
|
+
"command": "command",
|
58
|
+
"date_created": "2015-07-30T20:00:00Z",
|
59
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
60
|
+
"sim_sid": "HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
61
|
+
"sid": "HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
62
|
+
"status": "queued",
|
63
|
+
"direction": "to_sim",
|
64
|
+
"url": "https://supersim.twilio.com/v1/Commands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
65
|
+
}
|
66
|
+
]
|
67
|
+
))
|
68
|
+
|
69
|
+
actual = @client.supersim.v1.commands.create(sim: 'HSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', command: 'command')
|
70
|
+
|
71
|
+
expect(actual).to_not eq(nil)
|
72
|
+
end
|
73
|
+
|
74
|
+
it "can fetch" do
|
75
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
76
|
+
|
77
|
+
expect {
|
78
|
+
@client.supersim.v1.commands('HCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
79
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
80
|
+
|
81
|
+
values = {}
|
82
|
+
expect(
|
83
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
84
|
+
method: 'get',
|
85
|
+
url: 'https://supersim.twilio.com/v1/Commands/HCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
86
|
+
))).to eq(true)
|
87
|
+
end
|
88
|
+
|
89
|
+
it "receives fetch responses" do
|
90
|
+
@holodeck.mock(Twilio::Response.new(
|
91
|
+
200,
|
92
|
+
%q[
|
93
|
+
{
|
94
|
+
"sid": "HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
95
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
96
|
+
"command": "content of the command",
|
97
|
+
"sim_sid": "HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
98
|
+
"status": "queued",
|
99
|
+
"direction": "to_sim",
|
100
|
+
"date_created": "2015-07-30T20:00:00Z",
|
101
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
102
|
+
"url": "https://supersim.twilio.com/v1/Commands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
103
|
+
}
|
104
|
+
]
|
105
|
+
))
|
106
|
+
|
107
|
+
actual = @client.supersim.v1.commands('HCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
108
|
+
|
109
|
+
expect(actual).to_not eq(nil)
|
110
|
+
end
|
111
|
+
|
112
|
+
it "can read" do
|
113
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
114
|
+
|
115
|
+
expect {
|
116
|
+
@client.supersim.v1.commands.list()
|
117
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
118
|
+
|
119
|
+
values = {}
|
120
|
+
expect(
|
121
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
122
|
+
method: 'get',
|
123
|
+
url: 'https://supersim.twilio.com/v1/Commands',
|
124
|
+
))).to eq(true)
|
125
|
+
end
|
126
|
+
|
127
|
+
it "receives read_empty responses" do
|
128
|
+
@holodeck.mock(Twilio::Response.new(
|
129
|
+
200,
|
130
|
+
%q[
|
131
|
+
{
|
132
|
+
"commands": [],
|
133
|
+
"meta": {
|
134
|
+
"first_page_url": "https://supersim.twilio.com/v1/Commands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
|
135
|
+
"key": "commands",
|
136
|
+
"next_page_url": null,
|
137
|
+
"page": 0,
|
138
|
+
"page_size": 50,
|
139
|
+
"previous_page_url": null,
|
140
|
+
"url": "https://supersim.twilio.com/v1/Commands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0"
|
141
|
+
}
|
142
|
+
}
|
143
|
+
]
|
144
|
+
))
|
145
|
+
|
146
|
+
actual = @client.supersim.v1.commands.list()
|
147
|
+
|
148
|
+
expect(actual).to_not eq(nil)
|
149
|
+
end
|
150
|
+
|
151
|
+
it "receives read_full responses" do
|
152
|
+
@holodeck.mock(Twilio::Response.new(
|
153
|
+
200,
|
154
|
+
%q[
|
155
|
+
{
|
156
|
+
"meta": {
|
157
|
+
"first_page_url": "https://supersim.twilio.com/v1/Commands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
|
158
|
+
"key": "commands",
|
159
|
+
"next_page_url": null,
|
160
|
+
"page": 0,
|
161
|
+
"page_size": 50,
|
162
|
+
"previous_page_url": null,
|
163
|
+
"url": "https://supersim.twilio.com/v1/Commands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0"
|
164
|
+
},
|
165
|
+
"commands": [
|
166
|
+
{
|
167
|
+
"sid": "HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
168
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
169
|
+
"command": "content of the command",
|
170
|
+
"sim_sid": "HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
171
|
+
"status": "queued",
|
172
|
+
"direction": "from_sim",
|
173
|
+
"date_created": "2015-07-30T20:00:00Z",
|
174
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
175
|
+
"url": "https://supersim.twilio.com/v1/Commands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
176
|
+
}
|
177
|
+
]
|
178
|
+
}
|
179
|
+
]
|
180
|
+
))
|
181
|
+
|
182
|
+
actual = @client.supersim.v1.commands.list()
|
183
|
+
|
184
|
+
expect(actual).to_not eq(nil)
|
185
|
+
end
|
186
|
+
end
|
@@ -0,0 +1,208 @@
|
|
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 'Fleet' do
|
12
|
+
it "can create" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.supersim.v1.fleets.create()
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
values = {}
|
20
|
+
expect(
|
21
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
22
|
+
method: 'post',
|
23
|
+
url: 'https://supersim.twilio.com/v1/Fleets',
|
24
|
+
))).to eq(true)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "receives create responses" do
|
28
|
+
@holodeck.mock(Twilio::Response.new(
|
29
|
+
201,
|
30
|
+
%q[
|
31
|
+
{
|
32
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
33
|
+
"unique_name": "unique_name",
|
34
|
+
"data_enabled": true,
|
35
|
+
"data_metering": "payg",
|
36
|
+
"date_created": "2019-07-30T20:00:00Z",
|
37
|
+
"date_updated": "2019-07-30T20:00:00Z",
|
38
|
+
"commands_enabled": true,
|
39
|
+
"commands_method": "GET",
|
40
|
+
"commands_url": "https://google.com",
|
41
|
+
"sid": "HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
42
|
+
"url": "https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
43
|
+
}
|
44
|
+
]
|
45
|
+
))
|
46
|
+
|
47
|
+
actual = @client.supersim.v1.fleets.create()
|
48
|
+
|
49
|
+
expect(actual).to_not eq(nil)
|
50
|
+
end
|
51
|
+
|
52
|
+
it "can fetch" do
|
53
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
54
|
+
|
55
|
+
expect {
|
56
|
+
@client.supersim.v1.fleets('HFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
57
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
58
|
+
|
59
|
+
values = {}
|
60
|
+
expect(
|
61
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
62
|
+
method: 'get',
|
63
|
+
url: 'https://supersim.twilio.com/v1/Fleets/HFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
64
|
+
))).to eq(true)
|
65
|
+
end
|
66
|
+
|
67
|
+
it "receives fetch responses" do
|
68
|
+
@holodeck.mock(Twilio::Response.new(
|
69
|
+
200,
|
70
|
+
%q[
|
71
|
+
{
|
72
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
73
|
+
"unique_name": "unique_name",
|
74
|
+
"data_enabled": true,
|
75
|
+
"data_metering": "payg",
|
76
|
+
"date_created": "2019-07-30T20:00:00Z",
|
77
|
+
"date_updated": "2019-07-30T20:00:00Z",
|
78
|
+
"commands_enabled": true,
|
79
|
+
"commands_method": "POST",
|
80
|
+
"commands_url": null,
|
81
|
+
"sid": "HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
82
|
+
"url": "https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
83
|
+
}
|
84
|
+
]
|
85
|
+
))
|
86
|
+
|
87
|
+
actual = @client.supersim.v1.fleets('HFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
88
|
+
|
89
|
+
expect(actual).to_not eq(nil)
|
90
|
+
end
|
91
|
+
|
92
|
+
it "can read" do
|
93
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
94
|
+
|
95
|
+
expect {
|
96
|
+
@client.supersim.v1.fleets.list()
|
97
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
98
|
+
|
99
|
+
values = {}
|
100
|
+
expect(
|
101
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
102
|
+
method: 'get',
|
103
|
+
url: 'https://supersim.twilio.com/v1/Fleets',
|
104
|
+
))).to eq(true)
|
105
|
+
end
|
106
|
+
|
107
|
+
it "receives read_empty responses" do
|
108
|
+
@holodeck.mock(Twilio::Response.new(
|
109
|
+
200,
|
110
|
+
%q[
|
111
|
+
{
|
112
|
+
"fleets": [],
|
113
|
+
"meta": {
|
114
|
+
"first_page_url": "https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0",
|
115
|
+
"key": "fleets",
|
116
|
+
"next_page_url": null,
|
117
|
+
"page": 0,
|
118
|
+
"page_size": 50,
|
119
|
+
"previous_page_url": null,
|
120
|
+
"url": "https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0"
|
121
|
+
}
|
122
|
+
}
|
123
|
+
]
|
124
|
+
))
|
125
|
+
|
126
|
+
actual = @client.supersim.v1.fleets.list()
|
127
|
+
|
128
|
+
expect(actual).to_not eq(nil)
|
129
|
+
end
|
130
|
+
|
131
|
+
it "receives read_full responses" do
|
132
|
+
@holodeck.mock(Twilio::Response.new(
|
133
|
+
200,
|
134
|
+
%q[
|
135
|
+
{
|
136
|
+
"meta": {
|
137
|
+
"first_page_url": "https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0",
|
138
|
+
"key": "fleets",
|
139
|
+
"next_page_url": null,
|
140
|
+
"page": 0,
|
141
|
+
"page_size": 50,
|
142
|
+
"previous_page_url": null,
|
143
|
+
"url": "https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0"
|
144
|
+
},
|
145
|
+
"fleets": [
|
146
|
+
{
|
147
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
148
|
+
"unique_name": "Pilot Fleet",
|
149
|
+
"data_enabled": true,
|
150
|
+
"data_metering": "payg",
|
151
|
+
"date_created": "2019-10-15T20:00:00Z",
|
152
|
+
"date_updated": "2019-10-15T20:00:00Z",
|
153
|
+
"commands_enabled": true,
|
154
|
+
"commands_method": "POST",
|
155
|
+
"commands_url": null,
|
156
|
+
"sid": "HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
157
|
+
"url": "https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
158
|
+
}
|
159
|
+
]
|
160
|
+
}
|
161
|
+
]
|
162
|
+
))
|
163
|
+
|
164
|
+
actual = @client.supersim.v1.fleets.list()
|
165
|
+
|
166
|
+
expect(actual).to_not eq(nil)
|
167
|
+
end
|
168
|
+
|
169
|
+
it "can update" do
|
170
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
171
|
+
|
172
|
+
expect {
|
173
|
+
@client.supersim.v1.fleets('HFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
174
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
175
|
+
|
176
|
+
values = {}
|
177
|
+
expect(
|
178
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
179
|
+
method: 'post',
|
180
|
+
url: 'https://supersim.twilio.com/v1/Fleets/HFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
181
|
+
))).to eq(true)
|
182
|
+
end
|
183
|
+
|
184
|
+
it "receives update_unique_name responses" do
|
185
|
+
@holodeck.mock(Twilio::Response.new(
|
186
|
+
200,
|
187
|
+
%q[
|
188
|
+
{
|
189
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
190
|
+
"unique_name": "unique_name",
|
191
|
+
"data_enabled": true,
|
192
|
+
"data_metering": "payg",
|
193
|
+
"date_created": "2019-10-15T20:00:00Z",
|
194
|
+
"date_updated": "2019-10-15T20:00:00Z",
|
195
|
+
"commands_enabled": true,
|
196
|
+
"commands_method": "POST",
|
197
|
+
"commands_url": null,
|
198
|
+
"sid": "HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
199
|
+
"url": "https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
200
|
+
}
|
201
|
+
]
|
202
|
+
))
|
203
|
+
|
204
|
+
actual = @client.supersim.v1.fleets('HFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
205
|
+
|
206
|
+
expect(actual).to_not eq(nil)
|
207
|
+
end
|
208
|
+
end
|