twilio-ruby 5.4.3 → 5.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +12 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/framework/serialize.rb +9 -0
- data/lib/twilio-ruby/http/http_client.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +8 -2
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v2/service.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service/binding.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +2 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +2 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +2 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +1 -1
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +5 -1
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +3 -3
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +4 -4
- data/lib/twilio-ruby/rest/notify/v1/service/user.rb +5 -2
- data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +2 -2
- data/lib/twilio-ruby/rest/preview.rb +10 -3
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +4 -4
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +2 -2
- data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +2 -2
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +1 -1
- data/lib/twilio-ruby/rest/preview/understand.rb +41 -0
- data/lib/twilio-ruby/rest/preview/understand/service.rb +503 -0
- data/lib/twilio-ruby/rest/preview/understand/service/field_type.rb +399 -0
- data/lib/twilio-ruby/rest/preview/understand/service/field_type/field_value.rb +375 -0
- data/lib/twilio-ruby/rest/preview/understand/service/intent.rb +421 -0
- data/lib/twilio-ruby/rest/preview/understand/service/intent/field.rb +371 -0
- data/lib/twilio-ruby/rest/preview/understand/service/intent/sample.rb +407 -0
- data/lib/twilio-ruby/rest/preview/understand/service/model_build.rb +358 -0
- data/lib/twilio-ruby/rest/preview/understand/service/query.rb +422 -0
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +1 -1
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +2 -2
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +3 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +3 -3
- data/lib/twilio-ruby/rest/video/v1/recording.rb +1 -1
- data/lib/twilio-ruby/rest/video/v1/room.rb +27 -1
- data/lib/twilio-ruby/rest/video/v1/room/room_participant.rb +407 -0
- data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb +326 -0
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/serialize_spec.rb +21 -0
- data/spec/integration/chat/v1/service/role_spec.rb +6 -2
- data/spec/integration/chat/v2/service/role_spec.rb +6 -2
- data/spec/integration/ip_messaging/v1/service/role_spec.rb +6 -2
- data/spec/integration/ip_messaging/v2/service/role_spec.rb +6 -2
- data/spec/integration/preview/hosted_numbers/authorization_document_spec.rb +1 -1
- data/spec/integration/preview/understand/service/field_type/field_value_spec.rb +205 -0
- data/spec/integration/preview/understand/service/field_type_spec.rb +244 -0
- data/spec/integration/preview/understand/service/intent/field_spec.rb +205 -0
- data/spec/integration/preview/understand/service/intent/sample_spec.rb +247 -0
- data/spec/integration/preview/understand/service/intent_spec.rb +252 -0
- data/spec/integration/preview/understand/service/model_build_spec.rb +231 -0
- data/spec/integration/preview/understand/service/query_spec.rb +300 -0
- data/spec/integration/preview/understand/service_spec.rb +256 -0
- data/spec/integration/video/v1/room/room_participant/room_participant_published_track_spec.rb +94 -0
- data/spec/integration/video/v1/room/room_participant_spec.rb +182 -0
- data/spec/integration/video/v1/room_spec.rb +4 -0
- metadata +33 -2
@@ -0,0 +1,205 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
require 'spec_helper.rb'
|
8
|
+
|
9
|
+
describe 'Field' do
|
10
|
+
it "can fetch" do
|
11
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
12
|
+
|
13
|
+
expect {
|
14
|
+
@client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
15
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
16
|
+
.fields("UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").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://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
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://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
33
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"unique_name": "unique_name",
|
35
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
36
|
+
"service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
+
"intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
+
"date_created": "2015-07-30T20:00:00Z",
|
39
|
+
"sid": "UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
40
|
+
"field_type": "field_type"
|
41
|
+
}
|
42
|
+
]
|
43
|
+
))
|
44
|
+
|
45
|
+
actual = @client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
46
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
47
|
+
.fields("UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
48
|
+
|
49
|
+
expect(actual).to_not eq(nil)
|
50
|
+
end
|
51
|
+
|
52
|
+
it "can read" do
|
53
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
54
|
+
|
55
|
+
expect {
|
56
|
+
@client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
57
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
58
|
+
.fields.list()
|
59
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
60
|
+
|
61
|
+
values = {}
|
62
|
+
expect(
|
63
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
64
|
+
method: 'get',
|
65
|
+
url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields',
|
66
|
+
))).to eq(true)
|
67
|
+
end
|
68
|
+
|
69
|
+
it "receives read_empty responses" do
|
70
|
+
@holodeck.mock(Twilio::Response.new(
|
71
|
+
200,
|
72
|
+
%q[
|
73
|
+
{
|
74
|
+
"fields": [],
|
75
|
+
"meta": {
|
76
|
+
"page": 0,
|
77
|
+
"first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields?PageSize=50&Page=0",
|
78
|
+
"url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields?PageSize=50&Page=0",
|
79
|
+
"key": "fields",
|
80
|
+
"next_page_url": null,
|
81
|
+
"previous_page_url": null,
|
82
|
+
"page_size": 50
|
83
|
+
}
|
84
|
+
}
|
85
|
+
]
|
86
|
+
))
|
87
|
+
|
88
|
+
actual = @client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
89
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
90
|
+
.fields.list()
|
91
|
+
|
92
|
+
expect(actual).to_not eq(nil)
|
93
|
+
end
|
94
|
+
|
95
|
+
it "receives read_full responses" do
|
96
|
+
@holodeck.mock(Twilio::Response.new(
|
97
|
+
200,
|
98
|
+
%q[
|
99
|
+
{
|
100
|
+
"fields": [
|
101
|
+
{
|
102
|
+
"url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
103
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
104
|
+
"unique_name": "unique_name",
|
105
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
106
|
+
"service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
107
|
+
"intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
108
|
+
"date_created": "2015-07-30T20:00:00Z",
|
109
|
+
"sid": "UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
110
|
+
"field_type": "field_type"
|
111
|
+
}
|
112
|
+
],
|
113
|
+
"meta": {
|
114
|
+
"page": 0,
|
115
|
+
"first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields?PageSize=50&Page=0",
|
116
|
+
"url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields?PageSize=50&Page=0",
|
117
|
+
"key": "fields",
|
118
|
+
"next_page_url": null,
|
119
|
+
"previous_page_url": null,
|
120
|
+
"page_size": 50
|
121
|
+
}
|
122
|
+
}
|
123
|
+
]
|
124
|
+
))
|
125
|
+
|
126
|
+
actual = @client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
127
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
128
|
+
.fields.list()
|
129
|
+
|
130
|
+
expect(actual).to_not eq(nil)
|
131
|
+
end
|
132
|
+
|
133
|
+
it "can create" do
|
134
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
135
|
+
|
136
|
+
expect {
|
137
|
+
@client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
138
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
139
|
+
.fields.create(field_type: "field_type", unique_name: "unique_name")
|
140
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
141
|
+
|
142
|
+
values = {'FieldType' => "field_type", 'UniqueName' => "unique_name",}
|
143
|
+
expect(
|
144
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
145
|
+
method: 'post',
|
146
|
+
url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields',
|
147
|
+
data: values,
|
148
|
+
))).to eq(true)
|
149
|
+
end
|
150
|
+
|
151
|
+
it "receives create responses" do
|
152
|
+
@holodeck.mock(Twilio::Response.new(
|
153
|
+
201,
|
154
|
+
%q[
|
155
|
+
{
|
156
|
+
"url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
157
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
158
|
+
"unique_name": "unique_name",
|
159
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
160
|
+
"service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
161
|
+
"intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
162
|
+
"date_created": "2015-07-30T20:00:00Z",
|
163
|
+
"sid": "UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
164
|
+
"field_type": "field_type"
|
165
|
+
}
|
166
|
+
]
|
167
|
+
))
|
168
|
+
|
169
|
+
actual = @client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
170
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
171
|
+
.fields.create(field_type: "field_type", unique_name: "unique_name")
|
172
|
+
|
173
|
+
expect(actual).to_not eq(nil)
|
174
|
+
end
|
175
|
+
|
176
|
+
it "can delete" do
|
177
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
178
|
+
|
179
|
+
expect {
|
180
|
+
@client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
181
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
182
|
+
.fields("UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
183
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
184
|
+
|
185
|
+
values = {}
|
186
|
+
expect(
|
187
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
188
|
+
method: 'delete',
|
189
|
+
url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
190
|
+
))).to eq(true)
|
191
|
+
end
|
192
|
+
|
193
|
+
it "receives delete responses" do
|
194
|
+
@holodeck.mock(Twilio::Response.new(
|
195
|
+
204,
|
196
|
+
nil,
|
197
|
+
))
|
198
|
+
|
199
|
+
actual = @client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
200
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
201
|
+
.fields("UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
202
|
+
|
203
|
+
expect(actual).to eq(true)
|
204
|
+
end
|
205
|
+
end
|
@@ -0,0 +1,247 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
require 'spec_helper.rb'
|
8
|
+
|
9
|
+
describe 'Sample' do
|
10
|
+
it "can fetch" do
|
11
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
12
|
+
|
13
|
+
expect {
|
14
|
+
@client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
15
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
16
|
+
.samples("UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").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://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
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://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
33
|
+
"intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
|
+
"service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
+
"date_created": "2015-07-30T20:00:00Z",
|
38
|
+
"language": "language",
|
39
|
+
"tagged_text": "tagged_text",
|
40
|
+
"date_updated": "2015-07-30T20:00:00Z"
|
41
|
+
}
|
42
|
+
]
|
43
|
+
))
|
44
|
+
|
45
|
+
actual = @client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
46
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
47
|
+
.samples("UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
48
|
+
|
49
|
+
expect(actual).to_not eq(nil)
|
50
|
+
end
|
51
|
+
|
52
|
+
it "can read" do
|
53
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
54
|
+
|
55
|
+
expect {
|
56
|
+
@client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
57
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
58
|
+
.samples.list()
|
59
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
60
|
+
|
61
|
+
values = {}
|
62
|
+
expect(
|
63
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
64
|
+
method: 'get',
|
65
|
+
url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples',
|
66
|
+
))).to eq(true)
|
67
|
+
end
|
68
|
+
|
69
|
+
it "receives read_empty responses" do
|
70
|
+
@holodeck.mock(Twilio::Response.new(
|
71
|
+
200,
|
72
|
+
%q[
|
73
|
+
{
|
74
|
+
"samples": [],
|
75
|
+
"meta": {
|
76
|
+
"first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?PageSize=50&Page=0",
|
77
|
+
"previous_page_url": null,
|
78
|
+
"key": "samples",
|
79
|
+
"next_page_url": null,
|
80
|
+
"url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?PageSize=50&Page=0",
|
81
|
+
"page": 0,
|
82
|
+
"page_size": 50
|
83
|
+
}
|
84
|
+
}
|
85
|
+
]
|
86
|
+
))
|
87
|
+
|
88
|
+
actual = @client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
89
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
90
|
+
.samples.list()
|
91
|
+
|
92
|
+
expect(actual).to_not eq(nil)
|
93
|
+
end
|
94
|
+
|
95
|
+
it "receives read_full responses" do
|
96
|
+
@holodeck.mock(Twilio::Response.new(
|
97
|
+
200,
|
98
|
+
%q[
|
99
|
+
{
|
100
|
+
"samples": [
|
101
|
+
{
|
102
|
+
"url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
103
|
+
"intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
104
|
+
"sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
105
|
+
"service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
106
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
107
|
+
"date_created": "2015-07-30T20:00:00Z",
|
108
|
+
"language": "language",
|
109
|
+
"tagged_text": "tagged_text",
|
110
|
+
"date_updated": "2015-07-30T20:00:00Z"
|
111
|
+
}
|
112
|
+
],
|
113
|
+
"meta": {
|
114
|
+
"first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?PageSize=50&Page=0",
|
115
|
+
"previous_page_url": null,
|
116
|
+
"key": "samples",
|
117
|
+
"next_page_url": null,
|
118
|
+
"url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?PageSize=50&Page=0",
|
119
|
+
"page": 0,
|
120
|
+
"page_size": 50
|
121
|
+
}
|
122
|
+
}
|
123
|
+
]
|
124
|
+
))
|
125
|
+
|
126
|
+
actual = @client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
127
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
128
|
+
.samples.list()
|
129
|
+
|
130
|
+
expect(actual).to_not eq(nil)
|
131
|
+
end
|
132
|
+
|
133
|
+
it "can create" do
|
134
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
135
|
+
|
136
|
+
expect {
|
137
|
+
@client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
138
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
139
|
+
.samples.create(language: "language", tagged_text: "tagged_text")
|
140
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
141
|
+
|
142
|
+
values = {'Language' => "language", 'TaggedText' => "tagged_text",}
|
143
|
+
expect(
|
144
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
145
|
+
method: 'post',
|
146
|
+
url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples',
|
147
|
+
data: values,
|
148
|
+
))).to eq(true)
|
149
|
+
end
|
150
|
+
|
151
|
+
it "receives create responses" do
|
152
|
+
@holodeck.mock(Twilio::Response.new(
|
153
|
+
201,
|
154
|
+
%q[
|
155
|
+
{
|
156
|
+
"url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
157
|
+
"intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
158
|
+
"sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
159
|
+
"service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
160
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
161
|
+
"date_created": "2015-07-30T20:00:00Z",
|
162
|
+
"language": "language",
|
163
|
+
"tagged_text": "tagged_text",
|
164
|
+
"date_updated": "2015-07-30T20:00:00Z"
|
165
|
+
}
|
166
|
+
]
|
167
|
+
))
|
168
|
+
|
169
|
+
actual = @client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
170
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
171
|
+
.samples.create(language: "language", tagged_text: "tagged_text")
|
172
|
+
|
173
|
+
expect(actual).to_not eq(nil)
|
174
|
+
end
|
175
|
+
|
176
|
+
it "can update" do
|
177
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
178
|
+
|
179
|
+
expect {
|
180
|
+
@client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
181
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
182
|
+
.samples("UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
|
183
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
184
|
+
|
185
|
+
values = {}
|
186
|
+
expect(
|
187
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
188
|
+
method: 'post',
|
189
|
+
url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
190
|
+
))).to eq(true)
|
191
|
+
end
|
192
|
+
|
193
|
+
it "receives update responses" do
|
194
|
+
@holodeck.mock(Twilio::Response.new(
|
195
|
+
200,
|
196
|
+
%q[
|
197
|
+
{
|
198
|
+
"url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
199
|
+
"intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
200
|
+
"sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
201
|
+
"service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
202
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
203
|
+
"date_created": "2015-07-30T20:00:00Z",
|
204
|
+
"language": "language",
|
205
|
+
"tagged_text": "tagged_text",
|
206
|
+
"date_updated": "2015-07-30T20:00:00Z"
|
207
|
+
}
|
208
|
+
]
|
209
|
+
))
|
210
|
+
|
211
|
+
actual = @client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
212
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
213
|
+
.samples("UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
|
214
|
+
|
215
|
+
expect(actual).to_not eq(nil)
|
216
|
+
end
|
217
|
+
|
218
|
+
it "can delete" do
|
219
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
220
|
+
|
221
|
+
expect {
|
222
|
+
@client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
223
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
224
|
+
.samples("UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
225
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
226
|
+
|
227
|
+
values = {}
|
228
|
+
expect(
|
229
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
230
|
+
method: 'delete',
|
231
|
+
url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
232
|
+
))).to eq(true)
|
233
|
+
end
|
234
|
+
|
235
|
+
it "receives delete responses" do
|
236
|
+
@holodeck.mock(Twilio::Response.new(
|
237
|
+
204,
|
238
|
+
nil,
|
239
|
+
))
|
240
|
+
|
241
|
+
actual = @client.preview.understand.services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
242
|
+
.intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
243
|
+
.samples("UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
244
|
+
|
245
|
+
expect(actual).to eq(true)
|
246
|
+
end
|
247
|
+
end
|