twilio-ruby 5.12.2 → 5.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d71f5a1b5c6bdff3b242a74b23825e02cea1dfd3
4
- data.tar.gz: 2bf4dfc83fc497142bcfe19a17708c765c1740e3
3
+ metadata.gz: b393c5f2aaf85befaca045f95bb55d03e4509791
4
+ data.tar.gz: e3291c819d7bca3986b27e880a4a58a7aec0a5d3
5
5
  SHA512:
6
- metadata.gz: 0e8c970ad67d49f742949451772a45e84e954bb0f92d4dcc45134ceb95aa1c24253430202f9ff3675407622c221a94c871bd34a57c136042dca1c04588c04458
7
- data.tar.gz: 14c89a7e88500a2a214383e2b9e119ef191db4cd4a0dd9893931795ca5301cf57b24d7ad972b772f56d29f87fc98b86c11188058cb116a0db124b9961029b724
6
+ metadata.gz: 1a5cbec255f1c395ba75f7df0dba3396bd2d2fb993dc5425fcf50d62e4a5e479be4eb423a99def8253a1b37813d2cf401131582584e301c39266668ed7c50e28
7
+ data.tar.gz: 88172d73e791244096a7d7f3e94951435dbf0499c247fb36b3a4dcb667a5c73ec23ef4b4575f2d96e7e766277eb84db61688f41ffbf2ee77404766b665ecdb86
data/CHANGES.md CHANGED
@@ -1,6 +1,12 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2018-08-23] Version 5.12.3
5
+ ----------------------------
6
+ **Chat**
7
+ - Add User Channel instance resource
8
+
9
+
4
10
  [2018-08-17] Version 5.12.2
5
11
  ----------------------------
6
12
  **Api**
data/README.md CHANGED
@@ -27,13 +27,13 @@ in-line code documentation here in the library.
27
27
  To install using [Bundler][bundler] grab the latest stable version:
28
28
 
29
29
  ```ruby
30
- gem 'twilio-ruby', '~> 5.12.2'
30
+ gem 'twilio-ruby', '~> 5.12.3'
31
31
  ```
32
32
 
33
33
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
34
34
 
35
35
  ```bash
36
- gem install twilio-ruby -v 5.12.2
36
+ gem install twilio-ruby -v 5.12.3
37
37
  ```
38
38
 
39
39
  To build and install the development branch yourself from the latest source:
@@ -249,8 +249,14 @@ module Twilio
249
249
  ##
250
250
  # Access the user_channels
251
251
  # @return [UserChannelList]
252
- # @return [UserChannelContext]
253
- def user_channels
252
+ # @return [UserChannelContext] if channel_sid was passed.
253
+ def user_channels(channel_sid=:unset)
254
+ raise ArgumentError, 'channel_sid cannot be nil' if channel_sid.nil?
255
+
256
+ if channel_sid != :unset
257
+ return UserChannelContext.new(@version, @solution[:service_sid], @solution[:sid], channel_sid, )
258
+ end
259
+
254
260
  unless @user_channels
255
261
  @user_channels = UserChannelList.new(
256
262
  @version,
@@ -19,8 +19,8 @@ module Twilio
19
19
  # @param [String] service_sid The unique id of the
20
20
  # [Service](https://www.twilio.com/docs/api/chat/rest/services) this channel
21
21
  # belongs to.
22
- # @param [String] user_sid A 34 character string that uniquely identifies this
23
- # resource.
22
+ # @param [String] user_sid The unique id of the
23
+ # [User](https://www.twilio.com/docs/api/chat/rest/users) this Channel belongs to.
24
24
  # @return [UserChannelList] UserChannelList
25
25
  def initialize(version, service_sid: nil, user_sid: nil)
26
26
  super(version)
@@ -153,6 +153,76 @@ module Twilio
153
153
  end
154
154
  end
155
155
 
156
+ class UserChannelContext < InstanceContext
157
+ ##
158
+ # Initialize the UserChannelContext
159
+ # @param [Version] version Version that contains the resource
160
+ # @param [String] service_sid The unique id of the
161
+ # [Service](https://www.twilio.com/docs/api/chat/rest/services) those channels
162
+ # belong to.
163
+ # @param [String] user_sid The unique id of a User.
164
+ # @param [String] channel_sid The unique id of a Channel.
165
+ # @return [UserChannelContext] UserChannelContext
166
+ def initialize(version, service_sid, user_sid, channel_sid)
167
+ super(version)
168
+
169
+ # Path Solution
170
+ @solution = {service_sid: service_sid, user_sid: user_sid, channel_sid: channel_sid, }
171
+ @uri = "/Services/#{@solution[:service_sid]}/Users/#{@solution[:user_sid]}/Channels/#{@solution[:channel_sid]}"
172
+ end
173
+
174
+ ##
175
+ # Fetch a UserChannelInstance
176
+ # @return [UserChannelInstance] Fetched UserChannelInstance
177
+ def fetch
178
+ params = Twilio::Values.of({})
179
+
180
+ payload = @version.fetch(
181
+ 'GET',
182
+ @uri,
183
+ params,
184
+ )
185
+
186
+ UserChannelInstance.new(
187
+ @version,
188
+ payload,
189
+ service_sid: @solution[:service_sid],
190
+ user_sid: @solution[:user_sid],
191
+ channel_sid: @solution[:channel_sid],
192
+ )
193
+ end
194
+
195
+ ##
196
+ # Update the UserChannelInstance
197
+ # @param [user_channel.NotificationLevel] notification_level Push notification
198
+ # level to be assigned to Channel of the User.
199
+ # @return [UserChannelInstance] Updated UserChannelInstance
200
+ def update(notification_level: nil)
201
+ data = Twilio::Values.of({'NotificationLevel' => notification_level, })
202
+
203
+ payload = @version.update(
204
+ 'POST',
205
+ @uri,
206
+ data: data,
207
+ )
208
+
209
+ UserChannelInstance.new(
210
+ @version,
211
+ payload,
212
+ service_sid: @solution[:service_sid],
213
+ user_sid: @solution[:user_sid],
214
+ channel_sid: @solution[:channel_sid],
215
+ )
216
+ end
217
+
218
+ ##
219
+ # Provide a user friendly representation
220
+ def to_s
221
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
222
+ "#<Twilio.Chat.V2.UserChannelContext #{context}>"
223
+ end
224
+ end
225
+
156
226
  class UserChannelInstance < InstanceResource
157
227
  ##
158
228
  # Initialize the UserChannelInstance
@@ -161,10 +231,11 @@ module Twilio
161
231
  # @param [String] service_sid The unique id of the
162
232
  # [Service](https://www.twilio.com/docs/api/chat/rest/services) this channel
163
233
  # belongs to.
164
- # @param [String] user_sid A 34 character string that uniquely identifies this
165
- # resource.
234
+ # @param [String] user_sid The unique id of the
235
+ # [User](https://www.twilio.com/docs/api/chat/rest/users) this Channel belongs to.
236
+ # @param [String] channel_sid The unique id of a Channel.
166
237
  # @return [UserChannelInstance] UserChannelInstance
167
- def initialize(version, payload, service_sid: nil, user_sid: nil)
238
+ def initialize(version, payload, service_sid: nil, user_sid: nil, channel_sid: nil)
168
239
  super(version)
169
240
 
170
241
  # Marshaled Properties
@@ -172,14 +243,41 @@ module Twilio
172
243
  'account_sid' => payload['account_sid'],
173
244
  'service_sid' => payload['service_sid'],
174
245
  'channel_sid' => payload['channel_sid'],
246
+ 'user_sid' => payload['user_sid'],
175
247
  'member_sid' => payload['member_sid'],
176
248
  'status' => payload['status'],
177
249
  'last_consumed_message_index' => payload['last_consumed_message_index'] == nil ? payload['last_consumed_message_index'] : payload['last_consumed_message_index'].to_i,
178
250
  'unread_messages_count' => payload['unread_messages_count'] == nil ? payload['unread_messages_count'] : payload['unread_messages_count'].to_i,
179
251
  'links' => payload['links'],
252
+ 'url' => payload['url'],
253
+ 'notification_level' => payload['notification_level'],
254
+ }
255
+
256
+ # Context
257
+ @instance_context = nil
258
+ @params = {
259
+ 'service_sid' => service_sid,
260
+ 'user_sid' => user_sid,
261
+ 'channel_sid' => channel_sid || @properties['channel_sid'],
180
262
  }
181
263
  end
182
264
 
265
+ ##
266
+ # Generate an instance context for the instance, the context is capable of
267
+ # performing various actions. All instance actions are proxied to the context
268
+ # @return [UserChannelContext] UserChannelContext for this UserChannelInstance
269
+ def context
270
+ unless @instance_context
271
+ @instance_context = UserChannelContext.new(
272
+ @version,
273
+ @params['service_sid'],
274
+ @params['user_sid'],
275
+ @params['channel_sid'],
276
+ )
277
+ end
278
+ @instance_context
279
+ end
280
+
183
281
  ##
184
282
  # @return [String] The unique id of the Account responsible for this channel.
185
283
  def account_sid
@@ -198,6 +296,12 @@ module Twilio
198
296
  @properties['channel_sid']
199
297
  end
200
298
 
299
+ ##
300
+ # @return [String] The unique id of the User this Channel belongs to.
301
+ def user_sid
302
+ @properties['user_sid']
303
+ end
304
+
201
305
  ##
202
306
  # @return [String] The unique id of this User as a Member in this Channel.
203
307
  def member_sid
@@ -228,16 +332,46 @@ module Twilio
228
332
  @properties['links']
229
333
  end
230
334
 
335
+ ##
336
+ # @return [String] An absolute URL for this User Channel.
337
+ def url
338
+ @properties['url']
339
+ end
340
+
341
+ ##
342
+ # @return [user_channel.NotificationLevel] The notification level of the User for this Channel.
343
+ def notification_level
344
+ @properties['notification_level']
345
+ end
346
+
347
+ ##
348
+ # Fetch a UserChannelInstance
349
+ # @return [UserChannelInstance] Fetched UserChannelInstance
350
+ def fetch
351
+ context.fetch
352
+ end
353
+
354
+ ##
355
+ # Update the UserChannelInstance
356
+ # @param [user_channel.NotificationLevel] notification_level Push notification
357
+ # level to be assigned to Channel of the User.
358
+ # @return [UserChannelInstance] Updated UserChannelInstance
359
+ def update(notification_level: nil)
360
+ context.update(notification_level: notification_level, )
361
+ end
362
+
231
363
  ##
232
364
  # Provide a user friendly representation
233
365
  def to_s
234
- "<Twilio.Chat.V2.UserChannelInstance>"
366
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
367
+ "<Twilio.Chat.V2.UserChannelInstance #{values}>"
235
368
  end
236
369
 
237
370
  ##
238
371
  # Provide a detailed, user friendly representation
239
372
  def inspect
240
- "<Twilio.Chat.V2.UserChannelInstance>"
373
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
374
+ "<Twilio.Chat.V2.UserChannelInstance #{values}>"
241
375
  end
242
376
  end
243
377
  end
@@ -249,8 +249,14 @@ module Twilio
249
249
  ##
250
250
  # Access the user_channels
251
251
  # @return [UserChannelList]
252
- # @return [UserChannelContext]
253
- def user_channels
252
+ # @return [UserChannelContext] if channel_sid was passed.
253
+ def user_channels(channel_sid=:unset)
254
+ raise ArgumentError, 'channel_sid cannot be nil' if channel_sid.nil?
255
+
256
+ if channel_sid != :unset
257
+ return UserChannelContext.new(@version, @solution[:service_sid], @solution[:sid], channel_sid, )
258
+ end
259
+
254
260
  unless @user_channels
255
261
  @user_channels = UserChannelList.new(
256
262
  @version,
@@ -19,8 +19,8 @@ module Twilio
19
19
  # @param [String] service_sid The unique id of the
20
20
  # [Service](https://www.twilio.com/docs/api/chat/rest/services) this channel
21
21
  # belongs to.
22
- # @param [String] user_sid A 34 character string that uniquely identifies this
23
- # resource.
22
+ # @param [String] user_sid The unique id of the
23
+ # [User](https://www.twilio.com/docs/api/chat/rest/users) this Channel belongs to.
24
24
  # @return [UserChannelList] UserChannelList
25
25
  def initialize(version, service_sid: nil, user_sid: nil)
26
26
  super(version)
@@ -153,6 +153,76 @@ module Twilio
153
153
  end
154
154
  end
155
155
 
156
+ class UserChannelContext < InstanceContext
157
+ ##
158
+ # Initialize the UserChannelContext
159
+ # @param [Version] version Version that contains the resource
160
+ # @param [String] service_sid The unique id of the
161
+ # [Service](https://www.twilio.com/docs/api/chat/rest/services) those channels
162
+ # belong to.
163
+ # @param [String] user_sid The unique id of a User.
164
+ # @param [String] channel_sid The unique id of a Channel.
165
+ # @return [UserChannelContext] UserChannelContext
166
+ def initialize(version, service_sid, user_sid, channel_sid)
167
+ super(version)
168
+
169
+ # Path Solution
170
+ @solution = {service_sid: service_sid, user_sid: user_sid, channel_sid: channel_sid, }
171
+ @uri = "/Services/#{@solution[:service_sid]}/Users/#{@solution[:user_sid]}/Channels/#{@solution[:channel_sid]}"
172
+ end
173
+
174
+ ##
175
+ # Fetch a UserChannelInstance
176
+ # @return [UserChannelInstance] Fetched UserChannelInstance
177
+ def fetch
178
+ params = Twilio::Values.of({})
179
+
180
+ payload = @version.fetch(
181
+ 'GET',
182
+ @uri,
183
+ params,
184
+ )
185
+
186
+ UserChannelInstance.new(
187
+ @version,
188
+ payload,
189
+ service_sid: @solution[:service_sid],
190
+ user_sid: @solution[:user_sid],
191
+ channel_sid: @solution[:channel_sid],
192
+ )
193
+ end
194
+
195
+ ##
196
+ # Update the UserChannelInstance
197
+ # @param [user_channel.NotificationLevel] notification_level Push notification
198
+ # level to be assigned to Channel of the User.
199
+ # @return [UserChannelInstance] Updated UserChannelInstance
200
+ def update(notification_level: nil)
201
+ data = Twilio::Values.of({'NotificationLevel' => notification_level, })
202
+
203
+ payload = @version.update(
204
+ 'POST',
205
+ @uri,
206
+ data: data,
207
+ )
208
+
209
+ UserChannelInstance.new(
210
+ @version,
211
+ payload,
212
+ service_sid: @solution[:service_sid],
213
+ user_sid: @solution[:user_sid],
214
+ channel_sid: @solution[:channel_sid],
215
+ )
216
+ end
217
+
218
+ ##
219
+ # Provide a user friendly representation
220
+ def to_s
221
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
222
+ "#<Twilio.IpMessaging.V2.UserChannelContext #{context}>"
223
+ end
224
+ end
225
+
156
226
  class UserChannelInstance < InstanceResource
157
227
  ##
158
228
  # Initialize the UserChannelInstance
@@ -161,10 +231,11 @@ module Twilio
161
231
  # @param [String] service_sid The unique id of the
162
232
  # [Service](https://www.twilio.com/docs/api/chat/rest/services) this channel
163
233
  # belongs to.
164
- # @param [String] user_sid A 34 character string that uniquely identifies this
165
- # resource.
234
+ # @param [String] user_sid The unique id of the
235
+ # [User](https://www.twilio.com/docs/api/chat/rest/users) this Channel belongs to.
236
+ # @param [String] channel_sid The unique id of a Channel.
166
237
  # @return [UserChannelInstance] UserChannelInstance
167
- def initialize(version, payload, service_sid: nil, user_sid: nil)
238
+ def initialize(version, payload, service_sid: nil, user_sid: nil, channel_sid: nil)
168
239
  super(version)
169
240
 
170
241
  # Marshaled Properties
@@ -172,14 +243,41 @@ module Twilio
172
243
  'account_sid' => payload['account_sid'],
173
244
  'service_sid' => payload['service_sid'],
174
245
  'channel_sid' => payload['channel_sid'],
246
+ 'user_sid' => payload['user_sid'],
175
247
  'member_sid' => payload['member_sid'],
176
248
  'status' => payload['status'],
177
249
  'last_consumed_message_index' => payload['last_consumed_message_index'] == nil ? payload['last_consumed_message_index'] : payload['last_consumed_message_index'].to_i,
178
250
  'unread_messages_count' => payload['unread_messages_count'] == nil ? payload['unread_messages_count'] : payload['unread_messages_count'].to_i,
179
251
  'links' => payload['links'],
252
+ 'url' => payload['url'],
253
+ 'notification_level' => payload['notification_level'],
254
+ }
255
+
256
+ # Context
257
+ @instance_context = nil
258
+ @params = {
259
+ 'service_sid' => service_sid,
260
+ 'user_sid' => user_sid,
261
+ 'channel_sid' => channel_sid || @properties['channel_sid'],
180
262
  }
181
263
  end
182
264
 
265
+ ##
266
+ # Generate an instance context for the instance, the context is capable of
267
+ # performing various actions. All instance actions are proxied to the context
268
+ # @return [UserChannelContext] UserChannelContext for this UserChannelInstance
269
+ def context
270
+ unless @instance_context
271
+ @instance_context = UserChannelContext.new(
272
+ @version,
273
+ @params['service_sid'],
274
+ @params['user_sid'],
275
+ @params['channel_sid'],
276
+ )
277
+ end
278
+ @instance_context
279
+ end
280
+
183
281
  ##
184
282
  # @return [String] The unique id of the Account responsible for this channel.
185
283
  def account_sid
@@ -198,6 +296,12 @@ module Twilio
198
296
  @properties['channel_sid']
199
297
  end
200
298
 
299
+ ##
300
+ # @return [String] The unique id of the User this Channel belongs to.
301
+ def user_sid
302
+ @properties['user_sid']
303
+ end
304
+
201
305
  ##
202
306
  # @return [String] The unique id of this User as a Member in this Channel.
203
307
  def member_sid
@@ -228,16 +332,46 @@ module Twilio
228
332
  @properties['links']
229
333
  end
230
334
 
335
+ ##
336
+ # @return [String] An absolute URL for this User Channel.
337
+ def url
338
+ @properties['url']
339
+ end
340
+
341
+ ##
342
+ # @return [user_channel.NotificationLevel] The notification level of the User for this Channel.
343
+ def notification_level
344
+ @properties['notification_level']
345
+ end
346
+
347
+ ##
348
+ # Fetch a UserChannelInstance
349
+ # @return [UserChannelInstance] Fetched UserChannelInstance
350
+ def fetch
351
+ context.fetch
352
+ end
353
+
354
+ ##
355
+ # Update the UserChannelInstance
356
+ # @param [user_channel.NotificationLevel] notification_level Push notification
357
+ # level to be assigned to Channel of the User.
358
+ # @return [UserChannelInstance] Updated UserChannelInstance
359
+ def update(notification_level: nil)
360
+ context.update(notification_level: notification_level, )
361
+ end
362
+
231
363
  ##
232
364
  # Provide a user friendly representation
233
365
  def to_s
234
- "<Twilio.IpMessaging.V2.UserChannelInstance>"
366
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
367
+ "<Twilio.IpMessaging.V2.UserChannelInstance #{values}>"
235
368
  end
236
369
 
237
370
  ##
238
371
  # Provide a detailed, user friendly representation
239
372
  def inspect
240
- "<Twilio.IpMessaging.V2.UserChannelInstance>"
373
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
374
+ "<Twilio.IpMessaging.V2.UserChannelInstance #{values}>"
241
375
  end
242
376
  end
243
377
  end
@@ -120,14 +120,6 @@ module Twilio
120
120
  self.hosted_numbers.hosted_number_orders(sid)
121
121
  end
122
122
 
123
- ##
124
- # @param [String] sid A 34 character string that uniquely identifies this Add-on.
125
- # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnInstance] if sid was passed.
126
- # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnList]
127
- def available_add_ons(sid=:unset)
128
- self.marketplace.available_add_ons(sid)
129
- end
130
-
131
123
  ##
132
124
  # @param [String] sid 34 character string that uniquely identifies the Add-on.
133
125
  # This Sid can also be found in the Console on that specific Add-ons page as the
@@ -138,6 +130,14 @@ module Twilio
138
130
  self.marketplace.installed_add_ons(sid)
139
131
  end
140
132
 
133
+ ##
134
+ # @param [String] sid A 34 character string that uniquely identifies this Add-on.
135
+ # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnInstance] if sid was passed.
136
+ # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnList]
137
+ def available_add_ons(sid=:unset)
138
+ self.marketplace.available_add_ons(sid)
139
+ end
140
+
141
141
  ##
142
142
  # @param [String] sid The sid
143
143
  # @return [Twilio::REST::Preview::Sync::ServiceInstance] if sid was passed.
@@ -15,37 +15,37 @@ module Twilio
15
15
  def initialize(domain)
16
16
  super
17
17
  @version = 'marketplace'
18
- @available_add_ons = nil
19
18
  @installed_add_ons = nil
19
+ @available_add_ons = nil
20
20
  end
21
21
 
22
22
  ##
23
- # @param [String] sid The Available Add-on Sid that uniquely identifies this
23
+ # @param [String] sid The Installed Add-on Sid that uniquely identifies this
24
24
  # resource
25
- # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnContext] if sid was passed.
26
- # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnList]
27
- def available_add_ons(sid=:unset)
25
+ # @return [Twilio::REST::Preview::Marketplace::InstalledAddOnContext] if sid was passed.
26
+ # @return [Twilio::REST::Preview::Marketplace::InstalledAddOnList]
27
+ def installed_add_ons(sid=:unset)
28
28
  if sid.nil?
29
29
  raise ArgumentError, 'sid cannot be nil'
30
30
  elsif sid == :unset
31
- @available_add_ons ||= AvailableAddOnList.new self
31
+ @installed_add_ons ||= InstalledAddOnList.new self
32
32
  else
33
- AvailableAddOnContext.new(self, sid)
33
+ InstalledAddOnContext.new(self, sid)
34
34
  end
35
35
  end
36
36
 
37
37
  ##
38
- # @param [String] sid The Installed Add-on Sid that uniquely identifies this
38
+ # @param [String] sid The Available Add-on Sid that uniquely identifies this
39
39
  # resource
40
- # @return [Twilio::REST::Preview::Marketplace::InstalledAddOnContext] if sid was passed.
41
- # @return [Twilio::REST::Preview::Marketplace::InstalledAddOnList]
42
- def installed_add_ons(sid=:unset)
40
+ # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnContext] if sid was passed.
41
+ # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnList]
42
+ def available_add_ons(sid=:unset)
43
43
  if sid.nil?
44
44
  raise ArgumentError, 'sid cannot be nil'
45
45
  elsif sid == :unset
46
- @installed_add_ons ||= InstalledAddOnList.new self
46
+ @available_add_ons ||= AvailableAddOnList.new self
47
47
  else
48
- InstalledAddOnContext.new(self, sid)
48
+ AvailableAddOnContext.new(self, sid)
49
49
  end
50
50
  end
51
51
 
@@ -28,15 +28,6 @@ module Twilio
28
28
  @v1 ||= V1.new self
29
29
  end
30
30
 
31
- ##
32
- # @param [String] sid `CJxx…xx` A system-generated 34-character string that
33
- # uniquely identifies this Composition.
34
- # @return [Twilio::REST::Video::V1::CompositionInstance] if sid was passed.
35
- # @return [Twilio::REST::Video::V1::CompositionList]
36
- def compositions(sid=:unset)
37
- self.v1.compositions(sid)
38
- end
39
-
40
31
  ##
41
32
  # @return [Twilio::REST::Video::V1::CompositionSettingsInstance]
42
33
  def composition_settings
@@ -58,6 +49,15 @@ module Twilio
58
49
  self.v1.recording_settings()
59
50
  end
60
51
 
52
+ ##
53
+ # @param [String] sid `CJxx…xx` A system-generated 34-character string that
54
+ # uniquely identifies this Composition.
55
+ # @return [Twilio::REST::Video::V1::CompositionInstance] if sid was passed.
56
+ # @return [Twilio::REST::Video::V1::CompositionList]
57
+ def compositions(sid=:unset)
58
+ self.v1.compositions(sid)
59
+ end
60
+
61
61
  ##
62
62
  # @param [String] sid A system-generated 34-character string that uniquely
63
63
  # identifies this resource.
@@ -15,28 +15,13 @@ module Twilio
15
15
  def initialize(domain)
16
16
  super
17
17
  @version = 'v1'
18
- @compositions = nil
19
18
  @composition_settings = nil
20
19
  @recordings = nil
21
20
  @recording_settings = nil
21
+ @compositions = nil
22
22
  @rooms = nil
23
23
  end
24
24
 
25
- ##
26
- # @param [String] sid The Composition Sid that uniquely identifies the Composition
27
- # to fetch.
28
- # @return [Twilio::REST::Video::V1::CompositionContext] if sid was passed.
29
- # @return [Twilio::REST::Video::V1::CompositionList]
30
- def compositions(sid=:unset)
31
- if sid.nil?
32
- raise ArgumentError, 'sid cannot be nil'
33
- elsif sid == :unset
34
- @compositions ||= CompositionList.new self
35
- else
36
- CompositionContext.new(self, sid)
37
- end
38
- end
39
-
40
25
  ##
41
26
  # @return [Twilio::REST::Video::V1::CompositionSettingsContext]
42
27
  def composition_settings
@@ -64,6 +49,21 @@ module Twilio
64
49
  @recording_settings ||= RecordingSettingsContext.new self
65
50
  end
66
51
 
52
+ ##
53
+ # @param [String] sid The Composition Sid that uniquely identifies the Composition
54
+ # to fetch.
55
+ # @return [Twilio::REST::Video::V1::CompositionContext] if sid was passed.
56
+ # @return [Twilio::REST::Video::V1::CompositionList]
57
+ def compositions(sid=:unset)
58
+ if sid.nil?
59
+ raise ArgumentError, 'sid cannot be nil'
60
+ elsif sid == :unset
61
+ @compositions ||= CompositionList.new self
62
+ else
63
+ CompositionContext.new(self, sid)
64
+ end
65
+ end
66
+
67
67
  ##
68
68
  # @param [String] sid The Room Sid or name that uniquely identifies this resource.
69
69
  # @return [Twilio::REST::Video::V1::RoomContext] if sid was passed.
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.12.2'
2
+ VERSION = '5.12.3'
3
3
  end
@@ -45,10 +45,13 @@ describe 'UserChannel' do
45
45
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
46
46
  "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
47
47
  "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
48
+ "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
48
49
  "member_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
49
50
  "status": "joined",
50
51
  "last_consumed_message_index": 5,
51
52
  "unread_messages_count": 5,
53
+ "notification_level": "default",
54
+ "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
52
55
  "links": {
53
56
  "channel": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
54
57
  "member": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -91,4 +94,99 @@ describe 'UserChannel' do
91
94
 
92
95
  expect(actual).to_not eq(nil)
93
96
  end
97
+
98
+ it "can fetch" do
99
+ @holodeck.mock(Twilio::Response.new(500, ''))
100
+
101
+ expect {
102
+ @client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
103
+ .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
104
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
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://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users/USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
112
+ ))).to eq(true)
113
+ end
114
+
115
+ it "receives fetch responses" do
116
+ @holodeck.mock(Twilio::Response.new(
117
+ 200,
118
+ %q[
119
+ {
120
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
121
+ "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
122
+ "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
123
+ "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
124
+ "member_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
125
+ "status": "joined",
126
+ "last_consumed_message_index": 5,
127
+ "unread_messages_count": 5,
128
+ "notification_level": "default",
129
+ "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
130
+ "links": {
131
+ "channel": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
132
+ "member": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
133
+ }
134
+ }
135
+ ]
136
+ ))
137
+
138
+ actual = @client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
139
+ .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
140
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
141
+
142
+ expect(actual).to_not eq(nil)
143
+ end
144
+
145
+ it "can update" do
146
+ @holodeck.mock(Twilio::Response.new(500, ''))
147
+
148
+ expect {
149
+ @client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
150
+ .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
151
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(notification_level: 'default')
152
+ }.to raise_exception(Twilio::REST::TwilioError)
153
+
154
+ values = {'NotificationLevel' => 'default', }
155
+ expect(
156
+ @holodeck.has_request?(Holodeck::Request.new(
157
+ method: 'post',
158
+ url: 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users/USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
159
+ data: values,
160
+ ))).to eq(true)
161
+ end
162
+
163
+ it "receives update responses" do
164
+ @holodeck.mock(Twilio::Response.new(
165
+ 200,
166
+ %q[
167
+ {
168
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
169
+ "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
170
+ "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
171
+ "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
172
+ "member_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
173
+ "status": "joined",
174
+ "last_consumed_message_index": 5,
175
+ "unread_messages_count": 5,
176
+ "notification_level": "muted",
177
+ "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
178
+ "links": {
179
+ "channel": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
180
+ "member": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
181
+ }
182
+ }
183
+ ]
184
+ ))
185
+
186
+ actual = @client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
187
+ .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
188
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(notification_level: 'default')
189
+
190
+ expect(actual).to_not eq(nil)
191
+ end
94
192
  end
@@ -45,10 +45,13 @@ describe 'UserChannel' do
45
45
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
46
46
  "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
47
47
  "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
48
+ "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
48
49
  "member_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
49
50
  "status": "joined",
50
51
  "last_consumed_message_index": 5,
51
52
  "unread_messages_count": 5,
53
+ "notification_level": "default",
54
+ "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
52
55
  "links": {
53
56
  "channel": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
54
57
  "member": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -91,4 +94,99 @@ describe 'UserChannel' do
91
94
 
92
95
  expect(actual).to_not eq(nil)
93
96
  end
97
+
98
+ it "can fetch" do
99
+ @holodeck.mock(Twilio::Response.new(500, ''))
100
+
101
+ expect {
102
+ @client.ip_messaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
103
+ .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
104
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
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://ip-messaging.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users/USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
112
+ ))).to eq(true)
113
+ end
114
+
115
+ it "receives fetch responses" do
116
+ @holodeck.mock(Twilio::Response.new(
117
+ 200,
118
+ %q[
119
+ {
120
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
121
+ "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
122
+ "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
123
+ "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
124
+ "member_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
125
+ "status": "joined",
126
+ "last_consumed_message_index": 5,
127
+ "unread_messages_count": 5,
128
+ "notification_level": "default",
129
+ "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
130
+ "links": {
131
+ "channel": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
132
+ "member": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
133
+ }
134
+ }
135
+ ]
136
+ ))
137
+
138
+ actual = @client.ip_messaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
139
+ .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
140
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
141
+
142
+ expect(actual).to_not eq(nil)
143
+ end
144
+
145
+ it "can update" do
146
+ @holodeck.mock(Twilio::Response.new(500, ''))
147
+
148
+ expect {
149
+ @client.ip_messaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
150
+ .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
151
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(notification_level: 'default')
152
+ }.to raise_exception(Twilio::REST::TwilioError)
153
+
154
+ values = {'NotificationLevel' => 'default', }
155
+ expect(
156
+ @holodeck.has_request?(Holodeck::Request.new(
157
+ method: 'post',
158
+ url: 'https://ip-messaging.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users/USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
159
+ data: values,
160
+ ))).to eq(true)
161
+ end
162
+
163
+ it "receives update responses" do
164
+ @holodeck.mock(Twilio::Response.new(
165
+ 200,
166
+ %q[
167
+ {
168
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
169
+ "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
170
+ "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
171
+ "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
172
+ "member_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
173
+ "status": "joined",
174
+ "last_consumed_message_index": 5,
175
+ "unread_messages_count": 5,
176
+ "notification_level": "muted",
177
+ "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
178
+ "links": {
179
+ "channel": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
180
+ "member": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
181
+ }
182
+ }
183
+ ]
184
+ ))
185
+
186
+ actual = @client.ip_messaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
187
+ .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
188
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(notification_level: 'default')
189
+
190
+ expect(actual).to_not eq(nil)
191
+ end
94
192
  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.12.2
4
+ version: 5.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Twilio API Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-17 00:00:00.000000000 Z
11
+ date: 2018-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -762,7 +762,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
762
762
  version: '0'
763
763
  requirements: []
764
764
  rubyforge_project:
765
- rubygems_version: 2.6.11
765
+ rubygems_version: 2.5.1
766
766
  signing_key:
767
767
  specification_version: 4
768
768
  summary: The official library for communicating with the Twilio REST API, building