twilio-ruby 5.0.0.rc20 → 5.0.0.rc21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +9 -3
- data/README.md +2 -2
- data/lib/twilio-ruby/http/http_client.rb +0 -1
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +196 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +197 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +232 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports.rb +44 -0
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +517 -0
- data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +35 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +336 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +393 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +409 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +479 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +506 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +336 -0
- data/lib/twilio-ruby/rest/preview/proxy/service.rb +467 -0
- data/lib/twilio-ruby/rest/preview/proxy.rb +35 -0
- data/lib/twilio-ruby/rest/preview.rb +34 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/preview/bulk_exports/export/day_spec.rb +56 -0
- data/spec/integration/preview/bulk_exports/export_configuration_spec.rb +79 -0
- data/spec/integration/preview/bulk_exports/export_spec.rb +43 -0
- data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +277 -0
- data/spec/integration/preview/proxy/service/phone_number_spec.rb +173 -0
- data/spec/integration/preview/proxy/service/session/interaction_spec.rb +104 -0
- data/spec/integration/preview/proxy/service/session/participant/message_interaction_spec.rb +164 -0
- data/spec/integration/preview/proxy/service/session/participant_spec.rb +226 -0
- data/spec/integration/preview/proxy/service/session_spec.rb +216 -0
- data/spec/integration/preview/proxy/service/short_code_spec.rb +173 -0
- data/spec/integration/preview/proxy/service_spec.rb +200 -0
- metadata +38 -2
@@ -0,0 +1,173 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
require 'spec_helper.rb'
|
8
|
+
|
9
|
+
describe 'PhoneNumber' do
|
10
|
+
it "can create" do
|
11
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
12
|
+
|
13
|
+
expect {
|
14
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
15
|
+
.phone_numbers.create(sid: "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
|
16
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
17
|
+
|
18
|
+
values = {
|
19
|
+
'Sid' => "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
20
|
+
}
|
21
|
+
expect(
|
22
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
23
|
+
method: 'post',
|
24
|
+
url: 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers',
|
25
|
+
data: values,
|
26
|
+
))).to eq(true)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "receives create responses" do
|
30
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
31
|
+
201,
|
32
|
+
%q[
|
33
|
+
{
|
34
|
+
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
|
+
"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
+
"date_created": "2015-07-30T20:00:00Z",
|
38
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
39
|
+
"phone_number": "+987654321",
|
40
|
+
"country_code": "US",
|
41
|
+
"capabilities": [],
|
42
|
+
"url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
43
|
+
}
|
44
|
+
]
|
45
|
+
))
|
46
|
+
|
47
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
48
|
+
.phone_numbers.create(sid: "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
|
49
|
+
|
50
|
+
expect(actual).to_not eq(nil)
|
51
|
+
end
|
52
|
+
|
53
|
+
it "can delete" do
|
54
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
55
|
+
|
56
|
+
expect {
|
57
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
58
|
+
.phone_numbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").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://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
66
|
+
))).to eq(true)
|
67
|
+
end
|
68
|
+
|
69
|
+
it "receives delete responses" do
|
70
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
71
|
+
204,
|
72
|
+
nil,
|
73
|
+
))
|
74
|
+
|
75
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
76
|
+
.phone_numbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
77
|
+
|
78
|
+
expect(actual).to eq(true)
|
79
|
+
end
|
80
|
+
|
81
|
+
it "can read" do
|
82
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
83
|
+
|
84
|
+
expect {
|
85
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
86
|
+
.phone_numbers.list()
|
87
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
88
|
+
|
89
|
+
values = {}
|
90
|
+
expect(
|
91
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
92
|
+
method: 'get',
|
93
|
+
url: 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers',
|
94
|
+
))).to eq(true)
|
95
|
+
end
|
96
|
+
|
97
|
+
it "receives read_full responses" do
|
98
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
99
|
+
200,
|
100
|
+
%q[
|
101
|
+
{
|
102
|
+
"meta": {
|
103
|
+
"page": 0,
|
104
|
+
"page_size": 50,
|
105
|
+
"first_page_url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=50&Page=0",
|
106
|
+
"previous_page_url": null,
|
107
|
+
"next_page_url": null,
|
108
|
+
"key": "phone_numbers",
|
109
|
+
"url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=50&Page=0"
|
110
|
+
},
|
111
|
+
"phone_numbers": [
|
112
|
+
{
|
113
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
114
|
+
"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
115
|
+
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
116
|
+
"date_created": "2015-07-30T20:00:00Z",
|
117
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
118
|
+
"phone_number": "+987654321",
|
119
|
+
"country_code": "US",
|
120
|
+
"capabilities": [],
|
121
|
+
"url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
122
|
+
}
|
123
|
+
]
|
124
|
+
}
|
125
|
+
]
|
126
|
+
))
|
127
|
+
|
128
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
129
|
+
.phone_numbers.list()
|
130
|
+
|
131
|
+
expect(actual).to_not eq(nil)
|
132
|
+
end
|
133
|
+
|
134
|
+
it "can fetch" do
|
135
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
136
|
+
|
137
|
+
expect {
|
138
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
139
|
+
.phone_numbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
140
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
141
|
+
|
142
|
+
values = {}
|
143
|
+
expect(
|
144
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
145
|
+
method: 'get',
|
146
|
+
url: 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
147
|
+
))).to eq(true)
|
148
|
+
end
|
149
|
+
|
150
|
+
it "receives fetch responses" do
|
151
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
152
|
+
200,
|
153
|
+
%q[
|
154
|
+
{
|
155
|
+
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
156
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
157
|
+
"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
158
|
+
"date_created": "2015-07-30T20:00:00Z",
|
159
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
160
|
+
"phone_number": "12345",
|
161
|
+
"country_code": "US",
|
162
|
+
"capabilities": [],
|
163
|
+
"url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
164
|
+
}
|
165
|
+
]
|
166
|
+
))
|
167
|
+
|
168
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
169
|
+
.phone_numbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
170
|
+
|
171
|
+
expect(actual).to_not eq(nil)
|
172
|
+
end
|
173
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
require 'spec_helper.rb'
|
8
|
+
|
9
|
+
describe 'Interaction' do
|
10
|
+
it "can fetch" do
|
11
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
12
|
+
|
13
|
+
expect {
|
14
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
15
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
16
|
+
.interactions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").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/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
24
|
+
))).to eq(true)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "receives fetch responses" do
|
28
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
29
|
+
200,
|
30
|
+
%q[
|
31
|
+
{
|
32
|
+
"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
33
|
+
"data": "data",
|
34
|
+
"date_created": "2015-07-30T20:00:00Z",
|
35
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
36
|
+
"inbound_participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
+
"inbound_resource_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
+
"inbound_resource_status": "sent",
|
39
|
+
"inbound_resource_type": "Message",
|
40
|
+
"inbound_resource_url": null,
|
41
|
+
"outbound_participant_sid": "KPbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
42
|
+
"outbound_resource_sid": "SMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
43
|
+
"outbound_resource_status": "sent",
|
44
|
+
"outbound_resource_type": "Message",
|
45
|
+
"outbound_resource_url": null,
|
46
|
+
"sid": "KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
47
|
+
"status": "completed",
|
48
|
+
"url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
49
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
50
|
+
"session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
51
|
+
}
|
52
|
+
]
|
53
|
+
))
|
54
|
+
|
55
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
56
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
57
|
+
.interactions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
58
|
+
|
59
|
+
expect(actual).to_not eq(nil)
|
60
|
+
end
|
61
|
+
|
62
|
+
it "can read" do
|
63
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
64
|
+
|
65
|
+
expect {
|
66
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
67
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
68
|
+
.interactions.list()
|
69
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
70
|
+
|
71
|
+
values = {}
|
72
|
+
expect(
|
73
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
74
|
+
method: 'get',
|
75
|
+
url: 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions',
|
76
|
+
))).to eq(true)
|
77
|
+
end
|
78
|
+
|
79
|
+
it "receives read_empty responses" do
|
80
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
81
|
+
200,
|
82
|
+
%q[
|
83
|
+
{
|
84
|
+
"interactions": [],
|
85
|
+
"meta": {
|
86
|
+
"previous_page_url": null,
|
87
|
+
"next_page_url": null,
|
88
|
+
"url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions?PageSize=50&Page=0",
|
89
|
+
"page": 0,
|
90
|
+
"first_page_url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions?PageSize=50&Page=0",
|
91
|
+
"page_size": 50,
|
92
|
+
"key": "interactions"
|
93
|
+
}
|
94
|
+
}
|
95
|
+
]
|
96
|
+
))
|
97
|
+
|
98
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
99
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
100
|
+
.interactions.list()
|
101
|
+
|
102
|
+
expect(actual).to_not eq(nil)
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,164 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
require 'spec_helper.rb'
|
8
|
+
|
9
|
+
describe 'MessageInteraction' do
|
10
|
+
it "can create" do
|
11
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
12
|
+
|
13
|
+
expect {
|
14
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
15
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
16
|
+
.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
17
|
+
.message_interactions.create()
|
18
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
19
|
+
|
20
|
+
values = {}
|
21
|
+
expect(
|
22
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
23
|
+
method: 'post',
|
24
|
+
url: 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions',
|
25
|
+
))).to eq(true)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "receives create responses" do
|
29
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
30
|
+
201,
|
31
|
+
%q[
|
32
|
+
{
|
33
|
+
"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"data": "body",
|
35
|
+
"date_created": "2015-07-30T20:00:00Z",
|
36
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
37
|
+
"participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
+
"inbound_participant_sid": null,
|
39
|
+
"inbound_resource_sid": null,
|
40
|
+
"inbound_resource_status": null,
|
41
|
+
"inbound_resource_type": null,
|
42
|
+
"inbound_resource_url": null,
|
43
|
+
"outbound_participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
44
|
+
"outbound_resource_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
45
|
+
"outbound_resource_status": "sent",
|
46
|
+
"outbound_resource_type": "Message",
|
47
|
+
"outbound_resource_url": null,
|
48
|
+
"sid": "KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
49
|
+
"status": "completed",
|
50
|
+
"url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
51
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
52
|
+
"session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
53
|
+
}
|
54
|
+
]
|
55
|
+
))
|
56
|
+
|
57
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
58
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
59
|
+
.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
60
|
+
.message_interactions.create()
|
61
|
+
|
62
|
+
expect(actual).to_not eq(nil)
|
63
|
+
end
|
64
|
+
|
65
|
+
it "can fetch" do
|
66
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
67
|
+
|
68
|
+
expect {
|
69
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
70
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
71
|
+
.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
72
|
+
.message_interactions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
73
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
74
|
+
|
75
|
+
values = {}
|
76
|
+
expect(
|
77
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
78
|
+
method: 'get',
|
79
|
+
url: 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
80
|
+
))).to eq(true)
|
81
|
+
end
|
82
|
+
|
83
|
+
it "receives fetch responses" do
|
84
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
85
|
+
200,
|
86
|
+
%q[
|
87
|
+
{
|
88
|
+
"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
89
|
+
"data": "data",
|
90
|
+
"date_created": "2015-07-30T20:00:00Z",
|
91
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
92
|
+
"participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
93
|
+
"inbound_participant_sid": null,
|
94
|
+
"inbound_resource_sid": null,
|
95
|
+
"inbound_resource_status": null,
|
96
|
+
"inbound_resource_type": null,
|
97
|
+
"inbound_resource_url": null,
|
98
|
+
"outbound_participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
99
|
+
"outbound_resource_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
100
|
+
"outbound_resource_status": "sent",
|
101
|
+
"outbound_resource_type": "Message",
|
102
|
+
"outbound_resource_url": null,
|
103
|
+
"sid": "KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
104
|
+
"status": "completed",
|
105
|
+
"url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
106
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
107
|
+
"session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
108
|
+
}
|
109
|
+
]
|
110
|
+
))
|
111
|
+
|
112
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
113
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
114
|
+
.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
115
|
+
.message_interactions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
116
|
+
|
117
|
+
expect(actual).to_not eq(nil)
|
118
|
+
end
|
119
|
+
|
120
|
+
it "can read" do
|
121
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
122
|
+
|
123
|
+
expect {
|
124
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
125
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
126
|
+
.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
127
|
+
.message_interactions.list()
|
128
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
129
|
+
|
130
|
+
values = {}
|
131
|
+
expect(
|
132
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
133
|
+
method: 'get',
|
134
|
+
url: 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions',
|
135
|
+
))).to eq(true)
|
136
|
+
end
|
137
|
+
|
138
|
+
it "receives read_empty responses" do
|
139
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
140
|
+
200,
|
141
|
+
%q[
|
142
|
+
{
|
143
|
+
"interactions": [],
|
144
|
+
"meta": {
|
145
|
+
"previous_page_url": null,
|
146
|
+
"next_page_url": null,
|
147
|
+
"url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions?PageSize=50&Page=0",
|
148
|
+
"page": 0,
|
149
|
+
"first_page_url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions?PageSize=50&Page=0",
|
150
|
+
"page_size": 50,
|
151
|
+
"key": "interactions"
|
152
|
+
}
|
153
|
+
}
|
154
|
+
]
|
155
|
+
))
|
156
|
+
|
157
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
158
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
159
|
+
.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
160
|
+
.message_interactions.list()
|
161
|
+
|
162
|
+
expect(actual).to_not eq(nil)
|
163
|
+
end
|
164
|
+
end
|
@@ -0,0 +1,226 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
require 'spec_helper.rb'
|
8
|
+
|
9
|
+
describe 'Participant' do
|
10
|
+
it "can fetch" do
|
11
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
12
|
+
|
13
|
+
expect {
|
14
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
15
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
16
|
+
.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").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/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
24
|
+
))).to eq(true)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "receives fetch responses" do
|
28
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
29
|
+
200,
|
30
|
+
%q[
|
31
|
+
{
|
32
|
+
"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
33
|
+
"participant_type": "sms",
|
34
|
+
"identifier": "identifier",
|
35
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
36
|
+
"proxy_identifier": "proxy_identifier",
|
37
|
+
"friendly_name": "friendly_name",
|
38
|
+
"date_created": "2015-07-30T20:00:00Z",
|
39
|
+
"url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
40
|
+
"links": {
|
41
|
+
"message_interactions": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions"
|
42
|
+
},
|
43
|
+
"sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
44
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
45
|
+
"session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
46
|
+
}
|
47
|
+
]
|
48
|
+
))
|
49
|
+
|
50
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
51
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
52
|
+
.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
53
|
+
|
54
|
+
expect(actual).to_not eq(nil)
|
55
|
+
end
|
56
|
+
|
57
|
+
it "can read" do
|
58
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
59
|
+
|
60
|
+
expect {
|
61
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
62
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
63
|
+
.participants.list()
|
64
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
65
|
+
|
66
|
+
values = {}
|
67
|
+
expect(
|
68
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
69
|
+
method: 'get',
|
70
|
+
url: 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants',
|
71
|
+
))).to eq(true)
|
72
|
+
end
|
73
|
+
|
74
|
+
it "receives read_empty responses" do
|
75
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
76
|
+
200,
|
77
|
+
%q[
|
78
|
+
{
|
79
|
+
"meta": {
|
80
|
+
"previous_page_url": null,
|
81
|
+
"next_page_url": null,
|
82
|
+
"url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",
|
83
|
+
"page": 0,
|
84
|
+
"first_page_url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",
|
85
|
+
"page_size": 50,
|
86
|
+
"key": "participants"
|
87
|
+
},
|
88
|
+
"participants": []
|
89
|
+
}
|
90
|
+
]
|
91
|
+
))
|
92
|
+
|
93
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
94
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
95
|
+
.participants.list()
|
96
|
+
|
97
|
+
expect(actual).to_not eq(nil)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "can create" do
|
101
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
102
|
+
|
103
|
+
expect {
|
104
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
105
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
106
|
+
.participants.create(identifier: "identifier")
|
107
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
108
|
+
|
109
|
+
values = {
|
110
|
+
'Identifier' => "identifier",
|
111
|
+
}
|
112
|
+
expect(
|
113
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
114
|
+
method: 'post',
|
115
|
+
url: 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants',
|
116
|
+
data: values,
|
117
|
+
))).to eq(true)
|
118
|
+
end
|
119
|
+
|
120
|
+
it "receives create responses" do
|
121
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
122
|
+
201,
|
123
|
+
%q[
|
124
|
+
{
|
125
|
+
"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
126
|
+
"participant_type": "sms",
|
127
|
+
"identifier": "identifier",
|
128
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
129
|
+
"proxy_identifier": "proxy_identifier",
|
130
|
+
"friendly_name": "friendly_name",
|
131
|
+
"date_created": "2015-07-30T20:00:00Z",
|
132
|
+
"url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
133
|
+
"links": {
|
134
|
+
"message_interactions": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions"
|
135
|
+
},
|
136
|
+
"sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
137
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
138
|
+
"session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
139
|
+
}
|
140
|
+
]
|
141
|
+
))
|
142
|
+
|
143
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
144
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
145
|
+
.participants.create(identifier: "identifier")
|
146
|
+
|
147
|
+
expect(actual).to_not eq(nil)
|
148
|
+
end
|
149
|
+
|
150
|
+
it "can delete" do
|
151
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
152
|
+
|
153
|
+
expect {
|
154
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
155
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
156
|
+
.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
157
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
158
|
+
|
159
|
+
values = {}
|
160
|
+
expect(
|
161
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
162
|
+
method: 'delete',
|
163
|
+
url: 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
164
|
+
))).to eq(true)
|
165
|
+
end
|
166
|
+
|
167
|
+
it "receives delete responses" do
|
168
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
169
|
+
204,
|
170
|
+
nil,
|
171
|
+
))
|
172
|
+
|
173
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
174
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
175
|
+
.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
176
|
+
|
177
|
+
expect(actual).to eq(true)
|
178
|
+
end
|
179
|
+
|
180
|
+
it "can update" do
|
181
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
182
|
+
|
183
|
+
expect {
|
184
|
+
@client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
185
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
186
|
+
.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
|
187
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
188
|
+
|
189
|
+
values = {}
|
190
|
+
expect(
|
191
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
192
|
+
method: 'post',
|
193
|
+
url: 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
194
|
+
))).to eq(true)
|
195
|
+
end
|
196
|
+
|
197
|
+
it "receives update responses" do
|
198
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
199
|
+
200,
|
200
|
+
%q[
|
201
|
+
{
|
202
|
+
"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
203
|
+
"participant_type": "sms",
|
204
|
+
"identifier": "identifier",
|
205
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
206
|
+
"proxy_identifier": "proxy_identifier",
|
207
|
+
"friendly_name": "friendly_name",
|
208
|
+
"date_created": "2015-07-30T20:00:00Z",
|
209
|
+
"url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
210
|
+
"links": {
|
211
|
+
"message_interactions": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions"
|
212
|
+
},
|
213
|
+
"sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
214
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
215
|
+
"session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
216
|
+
}
|
217
|
+
]
|
218
|
+
))
|
219
|
+
|
220
|
+
actual = @client.preview.proxy.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
221
|
+
.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
222
|
+
.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
|
223
|
+
|
224
|
+
expect(actual).to_not eq(nil)
|
225
|
+
end
|
226
|
+
end
|