twilio-ruby 5.0.0.rc3 → 5.0.0.rc4
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 -0
- data/lib/twilio-ruby/rest/client.rb +7 -4
- data/lib/twilio-ruby/rest/conversations/v1/conversation/completed.rb +0 -7
- data/lib/twilio-ruby/rest/conversations/v1/conversation/in_progress.rb +0 -7
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/notifications/v1/service/binding.rb +440 -0
- data/lib/twilio-ruby/rest/notifications/v1/service/notification.rb +217 -0
- data/lib/twilio-ruby/rest/notifications/v1/service.rb +478 -0
- data/lib/twilio-ruby/rest/notifications/v1.rb +35 -0
- data/lib/twilio-ruby/rest/notifications.rb +40 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +96 -5
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/ip_messaging/v1/credential_spec.rb +136 -0
- data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +133 -0
- data/spec/integration/ip_messaging/v1/service/channel_spec.rb +171 -1
- data/spec/integration/ip_messaging/v1/service/role_spec.rb +167 -1
- data/spec/integration/ip_messaging/v1/service/user_spec.rb +151 -1
- data/spec/integration/ip_messaging/v1/service_spec.rb +177 -1
- data/spec/integration/notifications/v1/service/binding_spec.rb +210 -0
- data/spec/integration/notifications/v1/service/notification_spec.rb +57 -0
- data/spec/integration/notifications/v1/service_spec.rb +244 -0
- metadata +14 -3
@@ -0,0 +1,244 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
require 'spec_helper.rb'
|
8
|
+
|
9
|
+
describe 'Service' do
|
10
|
+
it "can create" do
|
11
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
12
|
+
|
13
|
+
expect {
|
14
|
+
@client.notifications.v1.services.create()
|
15
|
+
}.to raise_exception(Twilio::REST::TwilioException)
|
16
|
+
|
17
|
+
values = {}
|
18
|
+
expect(
|
19
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
20
|
+
method: 'post',
|
21
|
+
url: 'https://notifications.twilio.com/v1/Services',
|
22
|
+
))).to eq(true)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "receives create responses" do
|
26
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
27
|
+
201,
|
28
|
+
%q[
|
29
|
+
{
|
30
|
+
"sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
31
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
32
|
+
"friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c",
|
33
|
+
"date_created": "2016-03-09T20:22:31Z",
|
34
|
+
"date_updated": "2016-03-09T20:22:31Z",
|
35
|
+
"apn_credential_sid": null,
|
36
|
+
"gcm_credential_sid": null,
|
37
|
+
"default_apn_notification_protocol_version": "3",
|
38
|
+
"default_gcm_notification_protocol_version": "3",
|
39
|
+
"url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
40
|
+
"links": {
|
41
|
+
"bindings": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings",
|
42
|
+
"notifications": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications"
|
43
|
+
}
|
44
|
+
}
|
45
|
+
]
|
46
|
+
))
|
47
|
+
|
48
|
+
actual = @client.notifications.v1.services.create()
|
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.notifications.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
58
|
+
}.to raise_exception(Twilio::REST::TwilioException)
|
59
|
+
|
60
|
+
values = {}
|
61
|
+
expect(
|
62
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
63
|
+
method: 'delete',
|
64
|
+
url: 'https://notifications.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
65
|
+
))).to eq(true)
|
66
|
+
end
|
67
|
+
|
68
|
+
it "receives delete responses" do
|
69
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
70
|
+
204,
|
71
|
+
nil,
|
72
|
+
))
|
73
|
+
|
74
|
+
actual = @client.notifications.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
75
|
+
|
76
|
+
expect(actual).to eq(true)
|
77
|
+
end
|
78
|
+
|
79
|
+
it "can fetch" do
|
80
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
81
|
+
|
82
|
+
expect {
|
83
|
+
@client.notifications.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
84
|
+
}.to raise_exception(Twilio::REST::TwilioException)
|
85
|
+
|
86
|
+
values = {}
|
87
|
+
expect(
|
88
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
89
|
+
method: 'get',
|
90
|
+
url: 'https://notifications.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
91
|
+
))).to eq(true)
|
92
|
+
end
|
93
|
+
|
94
|
+
it "receives fetch responses" do
|
95
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
96
|
+
200,
|
97
|
+
%q[
|
98
|
+
{
|
99
|
+
"sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
100
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
101
|
+
"friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c",
|
102
|
+
"date_created": "2016-03-09T20:22:31Z",
|
103
|
+
"date_updated": "2016-03-09T20:22:31Z",
|
104
|
+
"apn_credential_sid": null,
|
105
|
+
"gcm_credential_sid": null,
|
106
|
+
"default_apn_notification_protocol_version": "3",
|
107
|
+
"default_gcm_notification_protocol_version": "3",
|
108
|
+
"url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
109
|
+
"links": {
|
110
|
+
"bindings": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings",
|
111
|
+
"notifications": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications"
|
112
|
+
}
|
113
|
+
}
|
114
|
+
]
|
115
|
+
))
|
116
|
+
|
117
|
+
actual = @client.notifications.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
118
|
+
|
119
|
+
expect(actual).to_not eq(nil)
|
120
|
+
end
|
121
|
+
|
122
|
+
it "can read" do
|
123
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
124
|
+
|
125
|
+
expect {
|
126
|
+
@client.notifications.v1.services.list()
|
127
|
+
}.to raise_exception(Twilio::REST::TwilioException)
|
128
|
+
|
129
|
+
values = {}
|
130
|
+
expect(
|
131
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
132
|
+
method: 'get',
|
133
|
+
url: 'https://notifications.twilio.com/v1/Services',
|
134
|
+
))).to eq(true)
|
135
|
+
end
|
136
|
+
|
137
|
+
it "receives read_full responses" do
|
138
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
139
|
+
200,
|
140
|
+
%q[
|
141
|
+
{
|
142
|
+
"meta": {
|
143
|
+
"page": 0,
|
144
|
+
"page_size": 1,
|
145
|
+
"first_page_url": "https://notifications.twilio.com/v1/Services?PageSize=1&Page=0",
|
146
|
+
"previous_page_url": null,
|
147
|
+
"url": "https://notifications.twilio.com/v1/Services?PageSize=1&Page=0",
|
148
|
+
"next_page_url": null,
|
149
|
+
"key": "services"
|
150
|
+
},
|
151
|
+
"services": [
|
152
|
+
{
|
153
|
+
"sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
154
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
155
|
+
"friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c",
|
156
|
+
"date_created": "2016-03-09T20:22:31Z",
|
157
|
+
"date_updated": "2016-03-09T20:22:31Z",
|
158
|
+
"apn_credential_sid": null,
|
159
|
+
"gcm_credential_sid": null,
|
160
|
+
"default_apn_notification_protocol_version": "3",
|
161
|
+
"default_gcm_notification_protocol_version": "3",
|
162
|
+
"url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
163
|
+
"links": {
|
164
|
+
"bindings": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings",
|
165
|
+
"notifications": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications"
|
166
|
+
}
|
167
|
+
}
|
168
|
+
]
|
169
|
+
}
|
170
|
+
]
|
171
|
+
))
|
172
|
+
|
173
|
+
actual = @client.notifications.v1.services.list()
|
174
|
+
|
175
|
+
expect(actual).to_not eq(nil)
|
176
|
+
end
|
177
|
+
|
178
|
+
it "receives read_empty responses" do
|
179
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
180
|
+
200,
|
181
|
+
%q[
|
182
|
+
{
|
183
|
+
"meta": {
|
184
|
+
"page": 0,
|
185
|
+
"page_size": 50,
|
186
|
+
"first_page_url": "https://notifications.twilio.com/v1/Services?PageSize=50&Page=0",
|
187
|
+
"previous_page_url": null,
|
188
|
+
"url": "https://notifications.twilio.com/v1/Services?PageSize=50&Page=0",
|
189
|
+
"next_page_url": null,
|
190
|
+
"key": "services"
|
191
|
+
},
|
192
|
+
"services": []
|
193
|
+
}
|
194
|
+
]
|
195
|
+
))
|
196
|
+
|
197
|
+
actual = @client.notifications.v1.services.list()
|
198
|
+
|
199
|
+
expect(actual).to_not eq(nil)
|
200
|
+
end
|
201
|
+
|
202
|
+
it "can update" do
|
203
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
204
|
+
|
205
|
+
expect {
|
206
|
+
@client.notifications.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
|
207
|
+
}.to raise_exception(Twilio::REST::TwilioException)
|
208
|
+
|
209
|
+
values = {}
|
210
|
+
expect(
|
211
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
212
|
+
method: 'post',
|
213
|
+
url: 'https://notifications.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
214
|
+
))).to eq(true)
|
215
|
+
end
|
216
|
+
|
217
|
+
it "receives update responses" do
|
218
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
219
|
+
200,
|
220
|
+
%q[
|
221
|
+
{
|
222
|
+
"sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
223
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
224
|
+
"friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c",
|
225
|
+
"date_created": "2016-03-09T20:22:31Z",
|
226
|
+
"date_updated": "2016-03-09T20:22:31Z",
|
227
|
+
"apn_credential_sid": null,
|
228
|
+
"gcm_credential_sid": null,
|
229
|
+
"default_apn_notification_protocol_version": "3",
|
230
|
+
"default_gcm_notification_protocol_version": "3",
|
231
|
+
"url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
232
|
+
"links": {
|
233
|
+
"bindings": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings",
|
234
|
+
"notifications": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications"
|
235
|
+
}
|
236
|
+
}
|
237
|
+
]
|
238
|
+
))
|
239
|
+
|
240
|
+
actual = @client.notifications.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
|
241
|
+
|
242
|
+
expect(actual).to_not eq(nil)
|
243
|
+
end
|
244
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.0.
|
4
|
+
version: 5.0.0.rc4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Benton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|
@@ -195,6 +195,11 @@ files:
|
|
195
195
|
- lib/twilio-ruby/rest/monitor/v1.rb
|
196
196
|
- lib/twilio-ruby/rest/monitor/v1/alert.rb
|
197
197
|
- lib/twilio-ruby/rest/monitor/v1/event.rb
|
198
|
+
- lib/twilio-ruby/rest/notifications.rb
|
199
|
+
- lib/twilio-ruby/rest/notifications/v1.rb
|
200
|
+
- lib/twilio-ruby/rest/notifications/v1/service.rb
|
201
|
+
- lib/twilio-ruby/rest/notifications/v1/service/binding.rb
|
202
|
+
- lib/twilio-ruby/rest/notifications/v1/service/notification.rb
|
198
203
|
- lib/twilio-ruby/rest/pricing.rb
|
199
204
|
- lib/twilio-ruby/rest/pricing/v1.rb
|
200
205
|
- lib/twilio-ruby/rest/pricing/v1/messaging.rb
|
@@ -308,6 +313,9 @@ files:
|
|
308
313
|
- spec/integration/lookups/v1/phone_number_spec.rb
|
309
314
|
- spec/integration/monitor/v1/alert_spec.rb
|
310
315
|
- spec/integration/monitor/v1/event_spec.rb
|
316
|
+
- spec/integration/notifications/v1/service/binding_spec.rb
|
317
|
+
- spec/integration/notifications/v1/service/notification_spec.rb
|
318
|
+
- spec/integration/notifications/v1/service_spec.rb
|
311
319
|
- spec/integration/pricing/v1/messaging/country_spec.rb
|
312
320
|
- spec/integration/pricing/v1/messaging_spec.rb
|
313
321
|
- spec/integration/pricing/v1/phone_number/country_spec.rb
|
@@ -372,7 +380,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
372
380
|
version: 1.3.1
|
373
381
|
requirements: []
|
374
382
|
rubyforge_project:
|
375
|
-
rubygems_version: 2.
|
383
|
+
rubygems_version: 2.4.8
|
376
384
|
signing_key:
|
377
385
|
specification_version: 4
|
378
386
|
summary: A simple library for communicating with the Twilio REST API, building TwiML,
|
@@ -449,6 +457,9 @@ test_files:
|
|
449
457
|
- spec/integration/lookups/v1/phone_number_spec.rb
|
450
458
|
- spec/integration/monitor/v1/alert_spec.rb
|
451
459
|
- spec/integration/monitor/v1/event_spec.rb
|
460
|
+
- spec/integration/notifications/v1/service/binding_spec.rb
|
461
|
+
- spec/integration/notifications/v1/service/notification_spec.rb
|
462
|
+
- spec/integration/notifications/v1/service_spec.rb
|
452
463
|
- spec/integration/pricing/v1/messaging/country_spec.rb
|
453
464
|
- spec/integration/pricing/v1/messaging_spec.rb
|
454
465
|
- spec/integration/pricing/v1/phone_number/country_spec.rb
|