twilio-ruby 5.31.1 → 5.31.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +4 -3
- data/CHANGES.md +16 -0
- data/LICENSE.md +1 -1
- data/README.md +2 -2
- data/lib/twilio-ruby.rb +5 -5
- data/lib/twilio-ruby/rest/client.rb +7 -0
- data/lib/twilio-ruby/rest/numbers.rb +44 -0
- data/lib/twilio-ruby/rest/numbers/v2.rb +35 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +189 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +482 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb +333 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb +361 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb +281 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +374 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb +281 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +30 -5
- data/lib/twilio-ruby/rest/studio.rb +16 -3
- data/lib/twilio-ruby/rest/studio/v2.rb +50 -0
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +451 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +343 -0
- data/lib/twilio-ruby/rest/studio/v2/flow_validate.rb +126 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +3 -2
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/numbers/v2/regulatory_compliance/bundle/item_assignment_spec.rb +198 -0
- data/spec/integration/numbers/v2/regulatory_compliance/bundle_spec.rb +226 -0
- data/spec/integration/numbers/v2/regulatory_compliance/end_user_spec.rb +214 -0
- data/spec/integration/numbers/v2/regulatory_compliance/end_user_type_spec.rb +143 -0
- data/spec/integration/numbers/v2/regulatory_compliance/supporting_document_spec.rb +226 -0
- data/spec/integration/numbers/v2/regulatory_compliance/supporting_document_type_spec.rb +133 -0
- data/spec/integration/numbers/v2/regulatory_compliance_spec.rb +12 -0
- data/spec/integration/serverless/v1/service/environment/log_spec.rb +2 -2
- data/spec/integration/studio/v2/flow/flow_revision_spec.rb +112 -0
- data/spec/integration/studio/v2/flow_spec.rb +234 -0
- data/spec/integration/studio/v2/flow_validate_spec.rb +42 -0
- data/twilio-ruby.gemspec +2 -2
- metadata +39 -6
@@ -0,0 +1,143 @@
|
|
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 'EndUserType' do
|
12
|
+
it "can read" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.numbers.v2.regulatory_compliance \
|
17
|
+
.end_user_types.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://numbers.twilio.com/v2/RegulatoryCompliance/EndUserTypes',
|
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
|
+
"end_user_types": [],
|
34
|
+
"meta": {
|
35
|
+
"page": 0,
|
36
|
+
"page_size": 50,
|
37
|
+
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUserTypes?PageSize=50&Page=0",
|
38
|
+
"previous_page_url": null,
|
39
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUserTypes?PageSize=50&Page=0",
|
40
|
+
"next_page_url": null,
|
41
|
+
"key": "end_user_types"
|
42
|
+
}
|
43
|
+
}
|
44
|
+
]
|
45
|
+
))
|
46
|
+
|
47
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
48
|
+
.end_user_types.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
|
+
"end_user_types": [
|
59
|
+
{
|
60
|
+
"sid": "OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
61
|
+
"friendly_name": "friendly_name",
|
62
|
+
"machine_name": "machine_name",
|
63
|
+
"fields": [
|
64
|
+
{
|
65
|
+
"friendly_name": "Business Purpose",
|
66
|
+
"machine_name": "business_purpose",
|
67
|
+
"constraint": "String"
|
68
|
+
},
|
69
|
+
{
|
70
|
+
"friendly_name": "Last Name",
|
71
|
+
"machine_name": "last_name",
|
72
|
+
"constraint": "String"
|
73
|
+
}
|
74
|
+
],
|
75
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUserTypes/OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
76
|
+
}
|
77
|
+
],
|
78
|
+
"meta": {
|
79
|
+
"page": 0,
|
80
|
+
"page_size": 50,
|
81
|
+
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUserTypes?PageSize=50&Page=0",
|
82
|
+
"previous_page_url": null,
|
83
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUserTypes?PageSize=50&Page=0",
|
84
|
+
"next_page_url": null,
|
85
|
+
"key": "end_user_types"
|
86
|
+
}
|
87
|
+
}
|
88
|
+
]
|
89
|
+
))
|
90
|
+
|
91
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
92
|
+
.end_user_types.list()
|
93
|
+
|
94
|
+
expect(actual).to_not eq(nil)
|
95
|
+
end
|
96
|
+
|
97
|
+
it "can fetch" do
|
98
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
99
|
+
|
100
|
+
expect {
|
101
|
+
@client.numbers.v2.regulatory_compliance \
|
102
|
+
.end_user_types('OYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
103
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
104
|
+
|
105
|
+
values = {}
|
106
|
+
expect(
|
107
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
108
|
+
method: 'get',
|
109
|
+
url: 'https://numbers.twilio.com/v2/RegulatoryCompliance/EndUserTypes/OYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
110
|
+
))).to eq(true)
|
111
|
+
end
|
112
|
+
|
113
|
+
it "receives fetch responses" do
|
114
|
+
@holodeck.mock(Twilio::Response.new(
|
115
|
+
200,
|
116
|
+
%q[
|
117
|
+
{
|
118
|
+
"sid": "OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
119
|
+
"friendly_name": "friendly_name",
|
120
|
+
"machine_name": "machine_name",
|
121
|
+
"fields": [
|
122
|
+
{
|
123
|
+
"friendly_name": "Business Purpose",
|
124
|
+
"machine_name": "business_purpose",
|
125
|
+
"constraint": "String"
|
126
|
+
},
|
127
|
+
{
|
128
|
+
"friendly_name": "Last Name",
|
129
|
+
"machine_name": "last_name",
|
130
|
+
"constraint": "String"
|
131
|
+
}
|
132
|
+
],
|
133
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUserTypes/OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
134
|
+
}
|
135
|
+
]
|
136
|
+
))
|
137
|
+
|
138
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
139
|
+
.end_user_types('OYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
140
|
+
|
141
|
+
expect(actual).to_not eq(nil)
|
142
|
+
end
|
143
|
+
end
|
@@ -0,0 +1,226 @@
|
|
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 'SupportingDocument' do
|
12
|
+
it "can create" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.numbers.v2.regulatory_compliance \
|
17
|
+
.supporting_documents.create(friendly_name: 'friendly_name', type: 'type')
|
18
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
19
|
+
|
20
|
+
values = {'FriendlyName' => 'friendly_name', 'Type' => 'type', }
|
21
|
+
expect(
|
22
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
23
|
+
method: 'post',
|
24
|
+
url: 'https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments',
|
25
|
+
data: values,
|
26
|
+
))).to eq(true)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "receives create responses" do
|
30
|
+
@holodeck.mock(Twilio::Response.new(
|
31
|
+
201,
|
32
|
+
%q[
|
33
|
+
{
|
34
|
+
"sid": "RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
|
+
"friendly_name": "friendly_name",
|
37
|
+
"mime_type": "mime_type",
|
38
|
+
"status": "draft",
|
39
|
+
"type": "type",
|
40
|
+
"attributes": {
|
41
|
+
"first_name": "foo",
|
42
|
+
"last_name": "bar"
|
43
|
+
},
|
44
|
+
"date_created": "2019-07-31T02:11:52Z",
|
45
|
+
"date_updated": "2019-07-31T02:11:52Z",
|
46
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
47
|
+
}
|
48
|
+
]
|
49
|
+
))
|
50
|
+
|
51
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
52
|
+
.supporting_documents.create(friendly_name: 'friendly_name', type: 'type')
|
53
|
+
|
54
|
+
expect(actual).to_not eq(nil)
|
55
|
+
end
|
56
|
+
|
57
|
+
it "can read" do
|
58
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
59
|
+
|
60
|
+
expect {
|
61
|
+
@client.numbers.v2.regulatory_compliance \
|
62
|
+
.supporting_documents.list()
|
63
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
64
|
+
|
65
|
+
values = {}
|
66
|
+
expect(
|
67
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
68
|
+
method: 'get',
|
69
|
+
url: 'https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments',
|
70
|
+
))).to eq(true)
|
71
|
+
end
|
72
|
+
|
73
|
+
it "receives read_empty responses" do
|
74
|
+
@holodeck.mock(Twilio::Response.new(
|
75
|
+
200,
|
76
|
+
%q[
|
77
|
+
{
|
78
|
+
"results": [],
|
79
|
+
"meta": {
|
80
|
+
"page": 0,
|
81
|
+
"page_size": 50,
|
82
|
+
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments?PageSize=50&Page=0",
|
83
|
+
"previous_page_url": null,
|
84
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments?PageSize=50&Page=0",
|
85
|
+
"next_page_url": null,
|
86
|
+
"key": "results"
|
87
|
+
}
|
88
|
+
}
|
89
|
+
]
|
90
|
+
))
|
91
|
+
|
92
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
93
|
+
.supporting_documents.list()
|
94
|
+
|
95
|
+
expect(actual).to_not eq(nil)
|
96
|
+
end
|
97
|
+
|
98
|
+
it "receives read_full responses" do
|
99
|
+
@holodeck.mock(Twilio::Response.new(
|
100
|
+
200,
|
101
|
+
%q[
|
102
|
+
{
|
103
|
+
"results": [
|
104
|
+
{
|
105
|
+
"sid": "RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
106
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
107
|
+
"friendly_name": "friendly_name",
|
108
|
+
"mime_type": "mime_type",
|
109
|
+
"status": "draft",
|
110
|
+
"type": "type",
|
111
|
+
"attributes": {
|
112
|
+
"first_name": "foo",
|
113
|
+
"last_name": "bar"
|
114
|
+
},
|
115
|
+
"date_created": "2019-07-31T02:11:52Z",
|
116
|
+
"date_updated": "2019-07-31T02:11:52Z",
|
117
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
118
|
+
}
|
119
|
+
],
|
120
|
+
"meta": {
|
121
|
+
"page": 0,
|
122
|
+
"page_size": 50,
|
123
|
+
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments?PageSize=50&Page=0",
|
124
|
+
"previous_page_url": null,
|
125
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments?PageSize=50&Page=0",
|
126
|
+
"next_page_url": null,
|
127
|
+
"key": "results"
|
128
|
+
}
|
129
|
+
}
|
130
|
+
]
|
131
|
+
))
|
132
|
+
|
133
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
134
|
+
.supporting_documents.list()
|
135
|
+
|
136
|
+
expect(actual).to_not eq(nil)
|
137
|
+
end
|
138
|
+
|
139
|
+
it "can fetch" do
|
140
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
141
|
+
|
142
|
+
expect {
|
143
|
+
@client.numbers.v2.regulatory_compliance \
|
144
|
+
.supporting_documents('RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
145
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
146
|
+
|
147
|
+
values = {}
|
148
|
+
expect(
|
149
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
150
|
+
method: 'get',
|
151
|
+
url: 'https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
152
|
+
))).to eq(true)
|
153
|
+
end
|
154
|
+
|
155
|
+
it "receives fetch responses" do
|
156
|
+
@holodeck.mock(Twilio::Response.new(
|
157
|
+
200,
|
158
|
+
%q[
|
159
|
+
{
|
160
|
+
"sid": "RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
161
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
162
|
+
"friendly_name": "friendly_name",
|
163
|
+
"mime_type": "mime_type",
|
164
|
+
"status": "draft",
|
165
|
+
"type": "type",
|
166
|
+
"attributes": {
|
167
|
+
"first_name": "foo",
|
168
|
+
"last_name": "bar"
|
169
|
+
},
|
170
|
+
"date_created": "2019-07-31T02:11:52Z",
|
171
|
+
"date_updated": "2019-07-31T02:11:52Z",
|
172
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
173
|
+
}
|
174
|
+
]
|
175
|
+
))
|
176
|
+
|
177
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
178
|
+
.supporting_documents('RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
179
|
+
|
180
|
+
expect(actual).to_not eq(nil)
|
181
|
+
end
|
182
|
+
|
183
|
+
it "can update" do
|
184
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
185
|
+
|
186
|
+
expect {
|
187
|
+
@client.numbers.v2.regulatory_compliance \
|
188
|
+
.supporting_documents('RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
189
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
190
|
+
|
191
|
+
values = {}
|
192
|
+
expect(
|
193
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
194
|
+
method: 'post',
|
195
|
+
url: 'https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
196
|
+
))).to eq(true)
|
197
|
+
end
|
198
|
+
|
199
|
+
it "receives update responses" do
|
200
|
+
@holodeck.mock(Twilio::Response.new(
|
201
|
+
200,
|
202
|
+
%q[
|
203
|
+
{
|
204
|
+
"sid": "RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
205
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
206
|
+
"friendly_name": "friendly_name",
|
207
|
+
"mime_type": "mime_type",
|
208
|
+
"status": "draft",
|
209
|
+
"type": "type",
|
210
|
+
"attributes": {
|
211
|
+
"first_name": "foo",
|
212
|
+
"last_name": "bar"
|
213
|
+
},
|
214
|
+
"date_created": "2019-07-31T02:11:52Z",
|
215
|
+
"date_updated": "2019-07-31T02:11:52Z",
|
216
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
217
|
+
}
|
218
|
+
]
|
219
|
+
))
|
220
|
+
|
221
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
222
|
+
.supporting_documents('RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
223
|
+
|
224
|
+
expect(actual).to_not eq(nil)
|
225
|
+
end
|
226
|
+
end
|
@@ -0,0 +1,133 @@
|
|
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 'SupportingDocumentType' do
|
12
|
+
it "can read" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.numbers.v2.regulatory_compliance \
|
17
|
+
.supporting_document_types.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://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes',
|
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
|
+
"supporting_document_types": [],
|
34
|
+
"meta": {
|
35
|
+
"page": 0,
|
36
|
+
"page_size": 50,
|
37
|
+
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes?PageSize=50&Page=0",
|
38
|
+
"previous_page_url": null,
|
39
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes?PageSize=50&Page=0",
|
40
|
+
"next_page_url": null,
|
41
|
+
"key": "supporting_document_types"
|
42
|
+
}
|
43
|
+
}
|
44
|
+
]
|
45
|
+
))
|
46
|
+
|
47
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
48
|
+
.supporting_document_types.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
|
+
"supporting_document_types": [
|
59
|
+
{
|
60
|
+
"sid": "OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
61
|
+
"friendly_name": "Passport",
|
62
|
+
"machine_name": "passport",
|
63
|
+
"fields": [
|
64
|
+
{
|
65
|
+
"friendly_name": "Last Name",
|
66
|
+
"machine_name": "last_name",
|
67
|
+
"constraint": "String"
|
68
|
+
}
|
69
|
+
],
|
70
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes/OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
71
|
+
}
|
72
|
+
],
|
73
|
+
"meta": {
|
74
|
+
"page": 0,
|
75
|
+
"page_size": 50,
|
76
|
+
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes?PageSize=50&Page=0",
|
77
|
+
"previous_page_url": null,
|
78
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes?PageSize=50&Page=0",
|
79
|
+
"next_page_url": null,
|
80
|
+
"key": "supporting_document_types"
|
81
|
+
}
|
82
|
+
}
|
83
|
+
]
|
84
|
+
))
|
85
|
+
|
86
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
87
|
+
.supporting_document_types.list()
|
88
|
+
|
89
|
+
expect(actual).to_not eq(nil)
|
90
|
+
end
|
91
|
+
|
92
|
+
it "can fetch" do
|
93
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
94
|
+
|
95
|
+
expect {
|
96
|
+
@client.numbers.v2.regulatory_compliance \
|
97
|
+
.supporting_document_types('OYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
98
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
99
|
+
|
100
|
+
values = {}
|
101
|
+
expect(
|
102
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
103
|
+
method: 'get',
|
104
|
+
url: 'https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes/OYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
105
|
+
))).to eq(true)
|
106
|
+
end
|
107
|
+
|
108
|
+
it "receives fetch responses" do
|
109
|
+
@holodeck.mock(Twilio::Response.new(
|
110
|
+
200,
|
111
|
+
%q[
|
112
|
+
{
|
113
|
+
"sid": "OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
114
|
+
"friendly_name": "Passport",
|
115
|
+
"machine_name": "passport",
|
116
|
+
"fields": [
|
117
|
+
{
|
118
|
+
"friendly_name": "Last Name",
|
119
|
+
"machine_name": "last_name",
|
120
|
+
"constraint": "String"
|
121
|
+
}
|
122
|
+
],
|
123
|
+
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes/OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
124
|
+
}
|
125
|
+
]
|
126
|
+
))
|
127
|
+
|
128
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
129
|
+
.supporting_document_types('OYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
130
|
+
|
131
|
+
expect(actual).to_not eq(nil)
|
132
|
+
end
|
133
|
+
end
|