twilio-ruby 5.34.0 → 5.34.1
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 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +38 -3
- data/lib/twilio-ruby/rest/autopilot.rb +6 -0
- data/lib/twilio-ruby/rest/autopilot/v1.rb +7 -0
- data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +198 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +26 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +324 -0
- data/lib/twilio-ruby/rest/supersim.rb +8 -0
- data/lib/twilio-ruby/rest/supersim/v1.rb +15 -0
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +44 -10
- data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +337 -0
- data/lib/twilio-ruby/rest/verify/v2/service.rb +22 -3
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -3
- data/lib/twilio-ruby/rest/voice.rb +36 -0
- data/lib/twilio-ruby/rest/voice/v1.rb +64 -0
- data/lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb +513 -0
- data/lib/twilio-ruby/rest/voice/v1/connection_policy.rb +379 -0
- data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +458 -0
- data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +366 -0
- data/lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb +346 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/sip/domain_spec.rb +12 -4
- data/spec/integration/api/v2010/account/token_spec.rb +23 -11
- data/spec/integration/autopilot/v1/restore_assistant_spec.rb +53 -0
- data/spec/integration/numbers/v2/regulatory_compliance/bundle/evaluation_spec.rb +623 -0
- data/spec/integration/numbers/v2/regulatory_compliance/bundle_spec.rb +4 -0
- data/spec/integration/supersim/v1/fleet_spec.rb +8 -4
- data/spec/integration/supersim/v1/network_access_profile_spec.rb +208 -0
- data/spec/integration/verify/v2/service_spec.rb +4 -0
- data/spec/integration/voice/v1/byoc_trunk_spec.rb +250 -0
- data/spec/integration/voice/v1/connection_policy/connection_policy_target_spec.rb +246 -0
- data/spec/integration/voice/v1/connection_policy_spec.rb +226 -0
- data/spec/integration/voice/v1/ip_record_spec.rb +223 -0
- data/spec/integration/voice/v1/source_ip_mapping_spec.rb +219 -0
- data/twilio-ruby.gemspec +1 -1
- metadata +28 -3
@@ -42,6 +42,7 @@ describe 'Bundle' do
|
|
42
42
|
"date_updated": "2019-07-31T01:09:00Z",
|
43
43
|
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
44
44
|
"links": {
|
45
|
+
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
|
45
46
|
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments"
|
46
47
|
}
|
47
48
|
}
|
@@ -113,6 +114,7 @@ describe 'Bundle' do
|
|
113
114
|
"date_updated": "2019-07-31T01:09:00Z",
|
114
115
|
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
115
116
|
"links": {
|
117
|
+
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
|
116
118
|
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments"
|
117
119
|
}
|
118
120
|
}
|
@@ -168,6 +170,7 @@ describe 'Bundle' do
|
|
168
170
|
"date_updated": "2019-07-31T01:09:00Z",
|
169
171
|
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
170
172
|
"links": {
|
173
|
+
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
|
171
174
|
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments"
|
172
175
|
}
|
173
176
|
}
|
@@ -212,6 +215,7 @@ describe 'Bundle' do
|
|
212
215
|
"date_updated": "2019-07-31T01:09:00Z",
|
213
216
|
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
214
217
|
"links": {
|
218
|
+
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
|
215
219
|
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments"
|
216
220
|
}
|
217
221
|
}
|
@@ -38,6 +38,7 @@ describe 'Fleet' do
|
|
38
38
|
"commands_enabled": true,
|
39
39
|
"commands_method": "GET",
|
40
40
|
"commands_url": "https://google.com",
|
41
|
+
"network_access_profile_sid": "HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
41
42
|
"sid": "HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
42
43
|
"url": "https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
43
44
|
}
|
@@ -78,6 +79,7 @@ describe 'Fleet' do
|
|
78
79
|
"commands_enabled": true,
|
79
80
|
"commands_method": "POST",
|
80
81
|
"commands_url": null,
|
82
|
+
"network_access_profile_sid": "HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
81
83
|
"sid": "HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
82
84
|
"url": "https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
83
85
|
}
|
@@ -111,13 +113,13 @@ describe 'Fleet' do
|
|
111
113
|
{
|
112
114
|
"fleets": [],
|
113
115
|
"meta": {
|
114
|
-
"first_page_url": "https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0",
|
116
|
+
"first_page_url": "https://supersim.twilio.com/v1/Fleets?NetworkAccessProfile=HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
|
115
117
|
"key": "fleets",
|
116
118
|
"next_page_url": null,
|
117
119
|
"page": 0,
|
118
120
|
"page_size": 50,
|
119
121
|
"previous_page_url": null,
|
120
|
-
"url": "https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0"
|
122
|
+
"url": "https://supersim.twilio.com/v1/Fleets?NetworkAccessProfile=HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0"
|
121
123
|
}
|
122
124
|
}
|
123
125
|
]
|
@@ -134,13 +136,13 @@ describe 'Fleet' do
|
|
134
136
|
%q[
|
135
137
|
{
|
136
138
|
"meta": {
|
137
|
-
"first_page_url": "https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0",
|
139
|
+
"first_page_url": "https://supersim.twilio.com/v1/Fleets?NetworkAccessProfile=HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
|
138
140
|
"key": "fleets",
|
139
141
|
"next_page_url": null,
|
140
142
|
"page": 0,
|
141
143
|
"page_size": 50,
|
142
144
|
"previous_page_url": null,
|
143
|
-
"url": "https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0"
|
145
|
+
"url": "https://supersim.twilio.com/v1/Fleets?NetworkAccessProfile=HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0"
|
144
146
|
},
|
145
147
|
"fleets": [
|
146
148
|
{
|
@@ -153,6 +155,7 @@ describe 'Fleet' do
|
|
153
155
|
"commands_enabled": true,
|
154
156
|
"commands_method": "POST",
|
155
157
|
"commands_url": null,
|
158
|
+
"network_access_profile_sid": "HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
156
159
|
"sid": "HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
157
160
|
"url": "https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
158
161
|
}
|
@@ -195,6 +198,7 @@ describe 'Fleet' do
|
|
195
198
|
"commands_enabled": true,
|
196
199
|
"commands_method": "POST",
|
197
200
|
"commands_url": null,
|
201
|
+
"network_access_profile_sid": "HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
198
202
|
"sid": "HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
199
203
|
"url": "https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
200
204
|
}
|
@@ -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 'NetworkAccessProfile' do
|
12
|
+
it "can create" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.supersim.v1.network_access_profiles.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/NetworkAccessProfiles',
|
24
|
+
))).to eq(true)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "receives create_minimal responses" do
|
28
|
+
@holodeck.mock(Twilio::Response.new(
|
29
|
+
201,
|
30
|
+
%q[
|
31
|
+
{
|
32
|
+
"unique_name": null,
|
33
|
+
"sid": "HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
|
+
"date_created": "2020-05-01T20:00:00Z",
|
36
|
+
"date_updated": "2020-05-01T20:00:00Z",
|
37
|
+
"url": "https://supersim.twilio.com/v1/NetworkAccessProfiles/HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
38
|
+
}
|
39
|
+
]
|
40
|
+
))
|
41
|
+
|
42
|
+
actual = @client.supersim.v1.network_access_profiles.create()
|
43
|
+
|
44
|
+
expect(actual).to_not eq(nil)
|
45
|
+
end
|
46
|
+
|
47
|
+
it "receives create_with_name_and_networks responses" do
|
48
|
+
@holodeck.mock(Twilio::Response.new(
|
49
|
+
201,
|
50
|
+
%q[
|
51
|
+
{
|
52
|
+
"unique_name": "My Network Access Profile",
|
53
|
+
"sid": "HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
54
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
55
|
+
"date_created": "2020-05-01T20:00:00Z",
|
56
|
+
"date_updated": "2020-05-01T20:00:00Z",
|
57
|
+
"url": "https://supersim.twilio.com/v1/NetworkAccessProfiles/HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
58
|
+
}
|
59
|
+
]
|
60
|
+
))
|
61
|
+
|
62
|
+
actual = @client.supersim.v1.network_access_profiles.create()
|
63
|
+
|
64
|
+
expect(actual).to_not eq(nil)
|
65
|
+
end
|
66
|
+
|
67
|
+
it "can fetch" do
|
68
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
69
|
+
|
70
|
+
expect {
|
71
|
+
@client.supersim.v1.network_access_profiles('HAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
72
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
73
|
+
|
74
|
+
values = {}
|
75
|
+
expect(
|
76
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
77
|
+
method: 'get',
|
78
|
+
url: 'https://supersim.twilio.com/v1/NetworkAccessProfiles/HAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
79
|
+
))).to eq(true)
|
80
|
+
end
|
81
|
+
|
82
|
+
it "receives fetch responses" do
|
83
|
+
@holodeck.mock(Twilio::Response.new(
|
84
|
+
200,
|
85
|
+
%q[
|
86
|
+
{
|
87
|
+
"unique_name": "My Network Access Profile",
|
88
|
+
"sid": "HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
89
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
90
|
+
"date_created": "2020-05-01T20:00:00Z",
|
91
|
+
"date_updated": "2020-05-01T20:00:00Z",
|
92
|
+
"url": "https://supersim.twilio.com/v1/NetworkAccessProfiles/HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
93
|
+
}
|
94
|
+
]
|
95
|
+
))
|
96
|
+
|
97
|
+
actual = @client.supersim.v1.network_access_profiles('HAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
98
|
+
|
99
|
+
expect(actual).to_not eq(nil)
|
100
|
+
end
|
101
|
+
|
102
|
+
it "can update" do
|
103
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
104
|
+
|
105
|
+
expect {
|
106
|
+
@client.supersim.v1.network_access_profiles('HAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
107
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
108
|
+
|
109
|
+
values = {}
|
110
|
+
expect(
|
111
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
112
|
+
method: 'post',
|
113
|
+
url: 'https://supersim.twilio.com/v1/NetworkAccessProfiles/HAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
114
|
+
))).to eq(true)
|
115
|
+
end
|
116
|
+
|
117
|
+
it "receives update_unique_name responses" do
|
118
|
+
@holodeck.mock(Twilio::Response.new(
|
119
|
+
200,
|
120
|
+
%q[
|
121
|
+
{
|
122
|
+
"unique_name": "My Network Access Profile",
|
123
|
+
"sid": "HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
124
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
125
|
+
"date_created": "2020-05-01T20:00:00Z",
|
126
|
+
"date_updated": "2020-05-01T20:00:00Z",
|
127
|
+
"url": "https://supersim.twilio.com/v1/NetworkAccessProfiles/HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
128
|
+
}
|
129
|
+
]
|
130
|
+
))
|
131
|
+
|
132
|
+
actual = @client.supersim.v1.network_access_profiles('HAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
133
|
+
|
134
|
+
expect(actual).to_not eq(nil)
|
135
|
+
end
|
136
|
+
|
137
|
+
it "can read" do
|
138
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
139
|
+
|
140
|
+
expect {
|
141
|
+
@client.supersim.v1.network_access_profiles.list()
|
142
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
143
|
+
|
144
|
+
values = {}
|
145
|
+
expect(
|
146
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
147
|
+
method: 'get',
|
148
|
+
url: 'https://supersim.twilio.com/v1/NetworkAccessProfiles',
|
149
|
+
))).to eq(true)
|
150
|
+
end
|
151
|
+
|
152
|
+
it "receives read_empty responses" do
|
153
|
+
@holodeck.mock(Twilio::Response.new(
|
154
|
+
200,
|
155
|
+
%q[
|
156
|
+
{
|
157
|
+
"network_access_profiles": [],
|
158
|
+
"meta": {
|
159
|
+
"first_page_url": "https://supersim.twilio.com/v1/NetworkAccessProfiles?PageSize=50&Page=0",
|
160
|
+
"key": "network_access_profiles",
|
161
|
+
"next_page_url": null,
|
162
|
+
"page": 0,
|
163
|
+
"page_size": 50,
|
164
|
+
"previous_page_url": null,
|
165
|
+
"url": "https://supersim.twilio.com/v1/NetworkAccessProfiles?PageSize=50&Page=0"
|
166
|
+
}
|
167
|
+
}
|
168
|
+
]
|
169
|
+
))
|
170
|
+
|
171
|
+
actual = @client.supersim.v1.network_access_profiles.list()
|
172
|
+
|
173
|
+
expect(actual).to_not eq(nil)
|
174
|
+
end
|
175
|
+
|
176
|
+
it "receives read_full responses" do
|
177
|
+
@holodeck.mock(Twilio::Response.new(
|
178
|
+
200,
|
179
|
+
%q[
|
180
|
+
{
|
181
|
+
"meta": {
|
182
|
+
"first_page_url": "https://supersim.twilio.com/v1/NetworkAccessProfiles?PageSize=50&Page=0",
|
183
|
+
"key": "network_access_profiles",
|
184
|
+
"next_page_url": null,
|
185
|
+
"page": 0,
|
186
|
+
"page_size": 50,
|
187
|
+
"previous_page_url": null,
|
188
|
+
"url": "https://supersim.twilio.com/v1/NetworkAccessProfiles?PageSize=50&Page=0"
|
189
|
+
},
|
190
|
+
"network_access_profiles": [
|
191
|
+
{
|
192
|
+
"unique_name": "My Network Access Profile",
|
193
|
+
"sid": "HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
194
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
195
|
+
"date_created": "2020-05-01T20:00:00Z",
|
196
|
+
"date_updated": "2020-05-01T20:00:00Z",
|
197
|
+
"url": "https://supersim.twilio.com/v1/NetworkAccessProfiles/HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
198
|
+
}
|
199
|
+
]
|
200
|
+
}
|
201
|
+
]
|
202
|
+
))
|
203
|
+
|
204
|
+
actual = @client.supersim.v1.network_access_profiles.list()
|
205
|
+
|
206
|
+
expect(actual).to_not eq(nil)
|
207
|
+
end
|
208
|
+
end
|
@@ -41,6 +41,7 @@ describe 'Service' do
|
|
41
41
|
"tts_name": "name",
|
42
42
|
"mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
43
43
|
"do_not_share_warning_enabled": false,
|
44
|
+
"custom_code_enabled": true,
|
44
45
|
"date_created": "2015-07-30T20:00:00Z",
|
45
46
|
"date_updated": "2015-07-30T20:00:00Z",
|
46
47
|
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -90,6 +91,7 @@ describe 'Service' do
|
|
90
91
|
"tts_name": "name",
|
91
92
|
"mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
92
93
|
"do_not_share_warning_enabled": false,
|
94
|
+
"custom_code_enabled": true,
|
93
95
|
"date_created": "2015-07-30T20:00:00Z",
|
94
96
|
"date_updated": "2015-07-30T20:00:00Z",
|
95
97
|
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -176,6 +178,7 @@ describe 'Service' do
|
|
176
178
|
"tts_name": "name",
|
177
179
|
"mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
178
180
|
"do_not_share_warning_enabled": false,
|
181
|
+
"custom_code_enabled": true,
|
179
182
|
"date_created": "2015-07-30T20:00:00Z",
|
180
183
|
"date_updated": "2015-07-30T20:00:00Z",
|
181
184
|
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -227,6 +230,7 @@ describe 'Service' do
|
|
227
230
|
"tts_name": "name",
|
228
231
|
"mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
229
232
|
"do_not_share_warning_enabled": false,
|
233
|
+
"custom_code_enabled": true,
|
230
234
|
"date_created": "2015-07-30T20:00:00Z",
|
231
235
|
"date_updated": "2015-07-30T20:00:00Z",
|
232
236
|
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -0,0 +1,250 @@
|
|
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 'ByocTrunk' do
|
12
|
+
it "can create" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.voice.v1.byoc_trunks.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://voice.twilio.com/v1/ByocTrunks',
|
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
|
+
"sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"friendly_name": "friendly_name",
|
35
|
+
"voice_url": "https://byoc.example.com/twilio/app",
|
36
|
+
"voice_method": "POST",
|
37
|
+
"voice_fallback_method": "POST",
|
38
|
+
"voice_fallback_url": "https://byoc.example.com/twilio/fallback",
|
39
|
+
"status_callback_method": "POST",
|
40
|
+
"status_callback_url": "https://byoc.example.com/twilio/status_callback",
|
41
|
+
"cnam_lookup_enabled": false,
|
42
|
+
"connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
43
|
+
"from_domain_sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
44
|
+
"date_created": "2020-03-18T23:31:36Z",
|
45
|
+
"date_updated": "2020-03-18T23:31:36Z",
|
46
|
+
"url": "https://voice.twilio.com/v1/ByocTrunks/BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
47
|
+
}
|
48
|
+
]
|
49
|
+
))
|
50
|
+
|
51
|
+
actual = @client.voice.v1.byoc_trunks.create()
|
52
|
+
|
53
|
+
expect(actual).to_not eq(nil)
|
54
|
+
end
|
55
|
+
|
56
|
+
it "can fetch" do
|
57
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
58
|
+
|
59
|
+
expect {
|
60
|
+
@client.voice.v1.byoc_trunks('BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
61
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
62
|
+
|
63
|
+
values = {}
|
64
|
+
expect(
|
65
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
66
|
+
method: 'get',
|
67
|
+
url: 'https://voice.twilio.com/v1/ByocTrunks/BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
68
|
+
))).to eq(true)
|
69
|
+
end
|
70
|
+
|
71
|
+
it "receives fetch responses" do
|
72
|
+
@holodeck.mock(Twilio::Response.new(
|
73
|
+
200,
|
74
|
+
%q[
|
75
|
+
{
|
76
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
77
|
+
"sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
78
|
+
"friendly_name": "friendly_name",
|
79
|
+
"voice_url": "https://byoc.example.com/twilio/app",
|
80
|
+
"voice_method": "POST",
|
81
|
+
"voice_fallback_method": "POST",
|
82
|
+
"voice_fallback_url": "https://byoc.example.com/twilio/fallback",
|
83
|
+
"status_callback_method": "POST",
|
84
|
+
"status_callback_url": "https://byoc.example.com/twilio/status_callback",
|
85
|
+
"cnam_lookup_enabled": false,
|
86
|
+
"connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
87
|
+
"from_domain_sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
88
|
+
"date_created": "2020-03-18T23:31:36Z",
|
89
|
+
"date_updated": "2020-03-18T23:31:37Z",
|
90
|
+
"url": "https://voice.twilio.com/v1/ByocTrunks/BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
91
|
+
}
|
92
|
+
]
|
93
|
+
))
|
94
|
+
|
95
|
+
actual = @client.voice.v1.byoc_trunks('BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
96
|
+
|
97
|
+
expect(actual).to_not eq(nil)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "can read" do
|
101
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
102
|
+
|
103
|
+
expect {
|
104
|
+
@client.voice.v1.byoc_trunks.list()
|
105
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
106
|
+
|
107
|
+
values = {}
|
108
|
+
expect(
|
109
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
110
|
+
method: 'get',
|
111
|
+
url: 'https://voice.twilio.com/v1/ByocTrunks',
|
112
|
+
))).to eq(true)
|
113
|
+
end
|
114
|
+
|
115
|
+
it "receives read_full responses" do
|
116
|
+
@holodeck.mock(Twilio::Response.new(
|
117
|
+
200,
|
118
|
+
%q[
|
119
|
+
{
|
120
|
+
"meta": {
|
121
|
+
"page": 0,
|
122
|
+
"page_size": 50,
|
123
|
+
"first_page_url": "https://voice.twilio.com/v1/ByocTrunks?PageSize=50&Page=0",
|
124
|
+
"previous_page_url": null,
|
125
|
+
"url": "https://voice.twilio.com/v1/ByocTrunks?PageSize=50&Page=0",
|
126
|
+
"next_page_url": null,
|
127
|
+
"key": "byoc_trunks"
|
128
|
+
},
|
129
|
+
"byoc_trunks": [
|
130
|
+
{
|
131
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
132
|
+
"sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
133
|
+
"friendly_name": "friendly_name",
|
134
|
+
"voice_url": "https://byoc.example.com/twilio/app",
|
135
|
+
"voice_method": "POST",
|
136
|
+
"voice_fallback_method": "POST",
|
137
|
+
"voice_fallback_url": "https://byoc.example.com/twilio/fallback",
|
138
|
+
"status_callback_method": "POST",
|
139
|
+
"status_callback_url": "https://byoc.example.com/twilio/status_callback",
|
140
|
+
"cnam_lookup_enabled": false,
|
141
|
+
"connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
142
|
+
"from_domain_sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
143
|
+
"date_created": "2020-03-18T23:31:36Z",
|
144
|
+
"date_updated": "2020-03-18T23:31:37Z",
|
145
|
+
"url": "https://voice.twilio.com/v1/ByocTrunks/BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
146
|
+
}
|
147
|
+
]
|
148
|
+
}
|
149
|
+
]
|
150
|
+
))
|
151
|
+
|
152
|
+
actual = @client.voice.v1.byoc_trunks.list()
|
153
|
+
|
154
|
+
expect(actual).to_not eq(nil)
|
155
|
+
end
|
156
|
+
|
157
|
+
it "receives read_empty responses" do
|
158
|
+
@holodeck.mock(Twilio::Response.new(
|
159
|
+
200,
|
160
|
+
%q[
|
161
|
+
{
|
162
|
+
"meta": {
|
163
|
+
"page": 0,
|
164
|
+
"page_size": 50,
|
165
|
+
"first_page_url": "https://voice.twilio.com/v1/ByocTrunks?PageSize=50&Page=0",
|
166
|
+
"previous_page_url": null,
|
167
|
+
"url": "https://voice.twilio.com/v1/ByocTrunks?PageSize=50&Page=0",
|
168
|
+
"next_page_url": null,
|
169
|
+
"key": "byoc_trunks"
|
170
|
+
},
|
171
|
+
"byoc_trunks": []
|
172
|
+
}
|
173
|
+
]
|
174
|
+
))
|
175
|
+
|
176
|
+
actual = @client.voice.v1.byoc_trunks.list()
|
177
|
+
|
178
|
+
expect(actual).to_not eq(nil)
|
179
|
+
end
|
180
|
+
|
181
|
+
it "can update" do
|
182
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
183
|
+
|
184
|
+
expect {
|
185
|
+
@client.voice.v1.byoc_trunks('BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
186
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
187
|
+
|
188
|
+
values = {}
|
189
|
+
expect(
|
190
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
191
|
+
method: 'post',
|
192
|
+
url: 'https://voice.twilio.com/v1/ByocTrunks/BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
193
|
+
))).to eq(true)
|
194
|
+
end
|
195
|
+
|
196
|
+
it "receives update responses" do
|
197
|
+
@holodeck.mock(Twilio::Response.new(
|
198
|
+
200,
|
199
|
+
%q[
|
200
|
+
{
|
201
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
202
|
+
"sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
203
|
+
"friendly_name": "update_name",
|
204
|
+
"voice_url": "https://byoc.example.com/twilio_updated/app",
|
205
|
+
"voice_method": "GET",
|
206
|
+
"voice_fallback_method": "GET",
|
207
|
+
"voice_fallback_url": "https://byoc.example.com/twilio_updated/fallback",
|
208
|
+
"status_callback_method": "GET",
|
209
|
+
"status_callback_url": "https://byoc.example.com/twilio_updated/status_callback",
|
210
|
+
"cnam_lookup_enabled": true,
|
211
|
+
"connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
|
212
|
+
"from_domain_sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
|
213
|
+
"date_created": "2020-03-18T23:31:36Z",
|
214
|
+
"date_updated": "2020-03-18T23:31:37Z",
|
215
|
+
"url": "https://voice.twilio.com/v1/ByocTrunks/BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
216
|
+
}
|
217
|
+
]
|
218
|
+
))
|
219
|
+
|
220
|
+
actual = @client.voice.v1.byoc_trunks('BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
221
|
+
|
222
|
+
expect(actual).to_not eq(nil)
|
223
|
+
end
|
224
|
+
|
225
|
+
it "can delete" do
|
226
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
227
|
+
|
228
|
+
expect {
|
229
|
+
@client.voice.v1.byoc_trunks('BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
230
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
231
|
+
|
232
|
+
values = {}
|
233
|
+
expect(
|
234
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
235
|
+
method: 'delete',
|
236
|
+
url: 'https://voice.twilio.com/v1/ByocTrunks/BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
237
|
+
))).to eq(true)
|
238
|
+
end
|
239
|
+
|
240
|
+
it "receives delete responses" do
|
241
|
+
@holodeck.mock(Twilio::Response.new(
|
242
|
+
204,
|
243
|
+
nil,
|
244
|
+
))
|
245
|
+
|
246
|
+
actual = @client.voice.v1.byoc_trunks('BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
247
|
+
|
248
|
+
expect(actual).to eq(true)
|
249
|
+
end
|
250
|
+
end
|