twilio-ruby 5.9.0 → 5.10.0
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/rest/api/v2010/account/available_phone_number/local.rb +36 -24
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +34 -25
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +30 -21
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +10 -4
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +2 -4
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +6 -4
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +6 -7
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +12 -4
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +11 -6
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +10 -8
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +10 -8
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +11 -9
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +0 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +2 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +9 -6
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +9 -3
- data/lib/twilio-ruby/rest/api/v2010/account.rb +13 -9
- data/lib/twilio-ruby/rest/chat/v1/credential.rb +42 -24
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +38 -18
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +60 -24
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +28 -18
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +33 -24
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +26 -16
- data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +4 -2
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +43 -24
- data/lib/twilio-ruby/rest/chat/v1/service.rb +74 -44
- data/lib/twilio-ruby/rest/chat/v2/credential.rb +61 -27
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +41 -18
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +43 -25
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +76 -37
- data/lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb +432 -0
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +90 -35
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +23 -16
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +4 -2
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +43 -25
- data/lib/twilio-ruby/rest/chat/v2/service.rb +93 -53
- data/lib/twilio-ruby/rest/chat.rb +4 -2
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +42 -24
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +38 -18
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +60 -24
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +28 -18
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +33 -24
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +26 -16
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +4 -2
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +43 -24
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +74 -44
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +61 -27
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +41 -18
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +43 -25
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +76 -37
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +432 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +90 -35
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +23 -16
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +4 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +43 -25
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +93 -53
- data/lib/twilio-ruby/rest/ip_messaging.rb +4 -2
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +12 -11
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +11 -11
- data/lib/twilio-ruby/rest/monitor.rb +1 -1
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +47 -22
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +59 -26
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +104 -29
- data/lib/twilio-ruby/rest/notify/v1/service.rb +86 -48
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +2 -2
- data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
- data/lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb +22 -16
- data/lib/twilio-ruby/rest/preview/understand/assistant/field_type.rb +21 -15
- data/lib/twilio-ruby/rest/preview/understand/assistant/intent/field.rb +17 -14
- data/lib/twilio-ruby/rest/preview/understand/assistant/intent/sample.rb +36 -25
- data/lib/twilio-ruby/rest/preview/understand/assistant/intent.rb +21 -15
- data/lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb +19 -13
- data/lib/twilio-ruby/rest/preview/understand/assistant/query.rb +42 -28
- data/lib/twilio-ruby/rest/preview/understand/assistant.rb +39 -21
- data/lib/twilio-ruby/rest/preview.rb +10 -9
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +5 -5
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +4 -4
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +3 -3
- data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +5 -5
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +12 -13
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +28 -22
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +7 -5
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +31 -14
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +3 -3
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +2 -2
- data/lib/twilio-ruby/rest/sync/v1/service.rb +24 -27
- data/lib/twilio-ruby/rest/video/v1/composition.rb +1 -1
- data/lib/twilio-ruby/rest/video/v1/recording.rb +45 -31
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +1 -1
- data/lib/twilio-ruby/rest/video/v1/room/room_participant.rb +18 -6
- data/lib/twilio-ruby/rest/video/v1.rb +13 -12
- data/lib/twilio-ruby/rest/video.rb +9 -8
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +43 -33
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +48 -35
- data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +21 -23
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +32 -22
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +121 -70
- data/lib/twilio-ruby/rest/wireless.rb +6 -3
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/chat/v2/service/channel/webhook_spec.rb +307 -0
- data/spec/integration/chat/v2/service/channel_spec.rb +4 -0
- data/spec/integration/ip_messaging/v2/service/channel/webhook_spec.rb +307 -0
- data/spec/integration/ip_messaging/v2/service/channel_spec.rb +4 -0
- metadata +9 -3
@@ -15,7 +15,9 @@ module Twilio
|
|
15
15
|
##
|
16
16
|
# Initialize the ChannelList
|
17
17
|
# @param [Version] version Version that contains the resource
|
18
|
-
# @param [String] service_sid The
|
18
|
+
# @param [String] service_sid The unique id of the
|
19
|
+
# [Service](https://www.twilio.com/docs/chat/api/services) this channel belongs
|
20
|
+
# to.
|
19
21
|
# @return [ChannelList] ChannelList
|
20
22
|
def initialize(version, service_sid: nil)
|
21
23
|
super(version)
|
@@ -28,13 +30,24 @@ module Twilio
|
|
28
30
|
##
|
29
31
|
# Retrieve a single page of ChannelInstance records from the API.
|
30
32
|
# Request is executed immediately.
|
31
|
-
# @param [String] friendly_name
|
32
|
-
# @param [String] unique_name
|
33
|
-
#
|
34
|
-
# @param [
|
35
|
-
#
|
36
|
-
# @param [
|
37
|
-
#
|
33
|
+
# @param [String] friendly_name A human-readable name for the Channel. Optional.
|
34
|
+
# @param [String] unique_name A unique, addressable name for the Channel.
|
35
|
+
# Optional.
|
36
|
+
# @param [String] attributes An optional metadata field you can use to store any
|
37
|
+
# data you wish. No processing or validation is done on this field.
|
38
|
+
# @param [channel.ChannelType] type The visibility of the channel - `public` or
|
39
|
+
# `private`. Defaults to `public`.
|
40
|
+
# @param [Time] date_created The optional ISO8601 time specifying the datetime the
|
41
|
+
# Channel should be set as being created. Will be set to the current time by the
|
42
|
+
# Chat service if not specified. Note that this should only be used in cases
|
43
|
+
# where a a Channel is being recreated from a backup/separate source
|
44
|
+
# @param [Time] date_updated The optional ISO8601 time specifying the datetime the
|
45
|
+
# Channel should be set as having been last updated. Will be set to the `null` by
|
46
|
+
# the Chat service if not specified. Note that this should only be used in cases
|
47
|
+
# where a Channel is being recreated from a backup/separate source and where a
|
48
|
+
# Message was previously updated.
|
49
|
+
# @param [String] created_by Optional field to specify the Identity of the User
|
50
|
+
# that created the Channel. Will be set to "system" if not specified.
|
38
51
|
# @return [ChannelInstance] Newly created ChannelInstance
|
39
52
|
def create(friendly_name: :unset, unique_name: :unset, attributes: :unset, type: :unset, date_created: :unset, date_updated: :unset, created_by: :unset)
|
40
53
|
data = Twilio::Values.of({
|
@@ -196,6 +209,7 @@ module Twilio
|
|
196
209
|
@members = nil
|
197
210
|
@messages = nil
|
198
211
|
@invites = nil
|
212
|
+
@webhooks = nil
|
199
213
|
end
|
200
214
|
|
201
215
|
##
|
@@ -222,12 +236,17 @@ module Twilio
|
|
222
236
|
|
223
237
|
##
|
224
238
|
# Update the ChannelInstance
|
225
|
-
# @param [String] friendly_name
|
226
|
-
# @param [String] unique_name
|
227
|
-
#
|
228
|
-
# @param [
|
229
|
-
#
|
230
|
-
# @param [
|
239
|
+
# @param [String] friendly_name A human-readable name for the Channel. Optional.
|
240
|
+
# @param [String] unique_name A unique, addressable name for the Channel.
|
241
|
+
# Optional.
|
242
|
+
# @param [String] attributes An optional metadata field you can use to store any
|
243
|
+
# data you wish. No processing or validation is done on this field.
|
244
|
+
# @param [Time] date_created The optional ISO8601 time specifying the datetime the
|
245
|
+
# Channel should be set as being created.
|
246
|
+
# @param [Time] date_updated The optional ISO8601 time specifying the datetime the
|
247
|
+
# Channel should be set as having been last updated.
|
248
|
+
# @param [String] created_by Optional field to specify the Identity of the User
|
249
|
+
# that created the Channel.
|
231
250
|
# @return [ChannelInstance] Updated ChannelInstance
|
232
251
|
def update(friendly_name: :unset, unique_name: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, created_by: :unset)
|
233
252
|
data = Twilio::Values.of({
|
@@ -314,6 +333,28 @@ module Twilio
|
|
314
333
|
@invites
|
315
334
|
end
|
316
335
|
|
336
|
+
##
|
337
|
+
# Access the webhooks
|
338
|
+
# @return [WebhookList]
|
339
|
+
# @return [WebhookContext] if sid was passed.
|
340
|
+
def webhooks(sid=:unset)
|
341
|
+
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
342
|
+
|
343
|
+
if sid != :unset
|
344
|
+
return WebhookContext.new(@version, @solution[:service_sid], @solution[:sid], sid, )
|
345
|
+
end
|
346
|
+
|
347
|
+
unless @webhooks
|
348
|
+
@webhooks = WebhookList.new(
|
349
|
+
@version,
|
350
|
+
service_sid: @solution[:service_sid],
|
351
|
+
channel_sid: @solution[:sid],
|
352
|
+
)
|
353
|
+
end
|
354
|
+
|
355
|
+
@webhooks
|
356
|
+
end
|
357
|
+
|
317
358
|
##
|
318
359
|
# Provide a user friendly representation
|
319
360
|
def to_s
|
@@ -327,7 +368,9 @@ module Twilio
|
|
327
368
|
# Initialize the ChannelInstance
|
328
369
|
# @param [Version] version Version that contains the resource
|
329
370
|
# @param [Hash] payload payload that contains response from Twilio
|
330
|
-
# @param [String] service_sid The
|
371
|
+
# @param [String] service_sid The unique id of the
|
372
|
+
# [Service](https://www.twilio.com/docs/chat/api/services) this channel belongs
|
373
|
+
# to.
|
331
374
|
# @param [String] sid The sid
|
332
375
|
# @return [ChannelInstance] ChannelInstance
|
333
376
|
def initialize(version, payload, service_sid: nil, sid: nil)
|
@@ -368,85 +411,85 @@ module Twilio
|
|
368
411
|
end
|
369
412
|
|
370
413
|
##
|
371
|
-
# @return [String]
|
414
|
+
# @return [String] A 34 character string that uniquely identifies this resource.
|
372
415
|
def sid
|
373
416
|
@properties['sid']
|
374
417
|
end
|
375
418
|
|
376
419
|
##
|
377
|
-
# @return [String] The
|
420
|
+
# @return [String] The unique id of the Account responsible for this channel.
|
378
421
|
def account_sid
|
379
422
|
@properties['account_sid']
|
380
423
|
end
|
381
424
|
|
382
425
|
##
|
383
|
-
# @return [String] The
|
426
|
+
# @return [String] The unique id of the Service this channel belongs to.
|
384
427
|
def service_sid
|
385
428
|
@properties['service_sid']
|
386
429
|
end
|
387
430
|
|
388
431
|
##
|
389
|
-
# @return [String] The
|
432
|
+
# @return [String] The human-readable name of this channel.
|
390
433
|
def friendly_name
|
391
434
|
@properties['friendly_name']
|
392
435
|
end
|
393
436
|
|
394
437
|
##
|
395
|
-
# @return [String] The
|
438
|
+
# @return [String] The unique, addressable name of this channel.
|
396
439
|
def unique_name
|
397
440
|
@properties['unique_name']
|
398
441
|
end
|
399
442
|
|
400
443
|
##
|
401
|
-
# @return [String]
|
444
|
+
# @return [String] An optional string metadata field you can use to store any data you wish.
|
402
445
|
def attributes
|
403
446
|
@properties['attributes']
|
404
447
|
end
|
405
448
|
|
406
449
|
##
|
407
|
-
# @return [channel.ChannelType] The
|
450
|
+
# @return [channel.ChannelType] The visibility of this channel - either public or private
|
408
451
|
def type
|
409
452
|
@properties['type']
|
410
453
|
end
|
411
454
|
|
412
455
|
##
|
413
|
-
# @return [Time] The
|
456
|
+
# @return [Time] The date that this resource was created.
|
414
457
|
def date_created
|
415
458
|
@properties['date_created']
|
416
459
|
end
|
417
460
|
|
418
461
|
##
|
419
|
-
# @return [Time] The
|
462
|
+
# @return [Time] The date that this resource was last updated.
|
420
463
|
def date_updated
|
421
464
|
@properties['date_updated']
|
422
465
|
end
|
423
466
|
|
424
467
|
##
|
425
|
-
# @return [String]
|
468
|
+
# @return [String] Identity of the channel's creator.
|
426
469
|
def created_by
|
427
470
|
@properties['created_by']
|
428
471
|
end
|
429
472
|
|
430
473
|
##
|
431
|
-
# @return [String] The
|
474
|
+
# @return [String] The number of Members in the Channel
|
432
475
|
def members_count
|
433
476
|
@properties['members_count']
|
434
477
|
end
|
435
478
|
|
436
479
|
##
|
437
|
-
# @return [String] The
|
480
|
+
# @return [String] The number of Messages in the Channel
|
438
481
|
def messages_count
|
439
482
|
@properties['messages_count']
|
440
483
|
end
|
441
484
|
|
442
485
|
##
|
443
|
-
# @return [String]
|
486
|
+
# @return [String] An absolute URL for this channel.
|
444
487
|
def url
|
445
488
|
@properties['url']
|
446
489
|
end
|
447
490
|
|
448
491
|
##
|
449
|
-
# @return [String]
|
492
|
+
# @return [String] Absolute URLs to access the Members, Messages , Invites and, if it exists the last Message for this Channel.
|
450
493
|
def links
|
451
494
|
@properties['links']
|
452
495
|
end
|
@@ -467,12 +510,17 @@ module Twilio
|
|
467
510
|
|
468
511
|
##
|
469
512
|
# Update the ChannelInstance
|
470
|
-
# @param [String] friendly_name
|
471
|
-
# @param [String] unique_name
|
472
|
-
#
|
473
|
-
# @param [
|
474
|
-
#
|
475
|
-
# @param [
|
513
|
+
# @param [String] friendly_name A human-readable name for the Channel. Optional.
|
514
|
+
# @param [String] unique_name A unique, addressable name for the Channel.
|
515
|
+
# Optional.
|
516
|
+
# @param [String] attributes An optional metadata field you can use to store any
|
517
|
+
# data you wish. No processing or validation is done on this field.
|
518
|
+
# @param [Time] date_created The optional ISO8601 time specifying the datetime the
|
519
|
+
# Channel should be set as being created.
|
520
|
+
# @param [Time] date_updated The optional ISO8601 time specifying the datetime the
|
521
|
+
# Channel should be set as having been last updated.
|
522
|
+
# @param [String] created_by Optional field to specify the Identity of the User
|
523
|
+
# that created the Channel.
|
476
524
|
# @return [ChannelInstance] Updated ChannelInstance
|
477
525
|
def update(friendly_name: :unset, unique_name: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, created_by: :unset)
|
478
526
|
context.update(
|
@@ -506,6 +554,13 @@ module Twilio
|
|
506
554
|
context.invites
|
507
555
|
end
|
508
556
|
|
557
|
+
##
|
558
|
+
# Access the webhooks
|
559
|
+
# @return [webhooks] webhooks
|
560
|
+
def webhooks
|
561
|
+
context.webhooks
|
562
|
+
end
|
563
|
+
|
509
564
|
##
|
510
565
|
# Provide a user friendly representation
|
511
566
|
def to_s
|
@@ -15,7 +15,8 @@ module Twilio
|
|
15
15
|
##
|
16
16
|
# Initialize the RoleList
|
17
17
|
# @param [Version] version Version that contains the resource
|
18
|
-
# @param [String] service_sid The
|
18
|
+
# @param [String] service_sid The unique id of the
|
19
|
+
# [Service](https://www.twilio.com/docs/chat/api/services) this role belongs to.
|
19
20
|
# @return [RoleList] RoleList
|
20
21
|
def initialize(version, service_sid: nil)
|
21
22
|
super(version)
|
@@ -28,9 +29,12 @@ module Twilio
|
|
28
29
|
##
|
29
30
|
# Retrieve a single page of RoleInstance records from the API.
|
30
31
|
# Request is executed immediately.
|
31
|
-
# @param [String] friendly_name The
|
32
|
-
# @param [role.RoleType] type
|
33
|
-
#
|
32
|
+
# @param [String] friendly_name The human-readable name of this role.
|
33
|
+
# @param [role.RoleType] type What kind of role this is. Either `channel` for
|
34
|
+
# [Channel](https://www.twilio.com/docs/chat/api/channels) roles or `deployment`
|
35
|
+
# for [Service](https://www.twilio.com/docs/api/chat/rest/services) roles.
|
36
|
+
# @param [String] permission (multiple) A permission this role should have.
|
37
|
+
# Consult the table above for the list of possible permissions.
|
34
38
|
# @return [RoleInstance] Newly created RoleInstance
|
35
39
|
def create(friendly_name: nil, type: nil, permission: nil)
|
36
40
|
data = Twilio::Values.of({
|
@@ -205,7 +209,8 @@ module Twilio
|
|
205
209
|
|
206
210
|
##
|
207
211
|
# Update the RoleInstance
|
208
|
-
# @param [String] permission
|
212
|
+
# @param [String] permission (multiple) A permission this role should have.
|
213
|
+
# Consult the table above for the list of possible permissions.
|
209
214
|
# @return [RoleInstance] Updated RoleInstance
|
210
215
|
def update(permission: nil)
|
211
216
|
data = Twilio::Values.of({'Permission' => Twilio.serialize_list(permission) { |e| e }, })
|
@@ -232,7 +237,8 @@ module Twilio
|
|
232
237
|
# Initialize the RoleInstance
|
233
238
|
# @param [Version] version Version that contains the resource
|
234
239
|
# @param [Hash] payload payload that contains response from Twilio
|
235
|
-
# @param [String] service_sid The
|
240
|
+
# @param [String] service_sid The unique id of the
|
241
|
+
# [Service](https://www.twilio.com/docs/chat/api/services) this role belongs to.
|
236
242
|
# @param [String] sid The sid
|
237
243
|
# @return [RoleInstance] RoleInstance
|
238
244
|
def initialize(version, payload, service_sid: nil, sid: nil)
|
@@ -268,55 +274,55 @@ module Twilio
|
|
268
274
|
end
|
269
275
|
|
270
276
|
##
|
271
|
-
# @return [String]
|
277
|
+
# @return [String] A 34 character string that uniquely identifies this resource.
|
272
278
|
def sid
|
273
279
|
@properties['sid']
|
274
280
|
end
|
275
281
|
|
276
282
|
##
|
277
|
-
# @return [String] The
|
283
|
+
# @return [String] The unique id of the Account responsible for this role.
|
278
284
|
def account_sid
|
279
285
|
@properties['account_sid']
|
280
286
|
end
|
281
287
|
|
282
288
|
##
|
283
|
-
# @return [String] The
|
289
|
+
# @return [String] The unique id of the Service this role belongs to.
|
284
290
|
def service_sid
|
285
291
|
@properties['service_sid']
|
286
292
|
end
|
287
293
|
|
288
294
|
##
|
289
|
-
# @return [String] The
|
295
|
+
# @return [String] The human-readable name of this role.
|
290
296
|
def friendly_name
|
291
297
|
@properties['friendly_name']
|
292
298
|
end
|
293
299
|
|
294
300
|
##
|
295
|
-
# @return [role.RoleType]
|
301
|
+
# @return [role.RoleType] What kind of role this is.
|
296
302
|
def type
|
297
303
|
@properties['type']
|
298
304
|
end
|
299
305
|
|
300
306
|
##
|
301
|
-
# @return [String]
|
307
|
+
# @return [String] A JSON array of the permissions this role has.
|
302
308
|
def permissions
|
303
309
|
@properties['permissions']
|
304
310
|
end
|
305
311
|
|
306
312
|
##
|
307
|
-
# @return [Time] The
|
313
|
+
# @return [Time] The date that this resource was created in ISO 8601 format.
|
308
314
|
def date_created
|
309
315
|
@properties['date_created']
|
310
316
|
end
|
311
317
|
|
312
318
|
##
|
313
|
-
# @return [Time] The
|
319
|
+
# @return [Time] The date that this resource was last updated in ISO 8601 format.
|
314
320
|
def date_updated
|
315
321
|
@properties['date_updated']
|
316
322
|
end
|
317
323
|
|
318
324
|
##
|
319
|
-
# @return [String]
|
325
|
+
# @return [String] An absolute URL for this role.
|
320
326
|
def url
|
321
327
|
@properties['url']
|
322
328
|
end
|
@@ -337,7 +343,8 @@ module Twilio
|
|
337
343
|
|
338
344
|
##
|
339
345
|
# Update the RoleInstance
|
340
|
-
# @param [String] permission
|
346
|
+
# @param [String] permission (multiple) A permission this role should have.
|
347
|
+
# Consult the table above for the list of possible permissions.
|
341
348
|
# @return [RoleInstance] Updated RoleInstance
|
342
349
|
def update(permission: nil)
|
343
350
|
context.update(permission: permission, )
|
@@ -17,7 +17,8 @@ module Twilio
|
|
17
17
|
# Initialize the UserChannelList
|
18
18
|
# @param [Version] version Version that contains the resource
|
19
19
|
# @param [String] service_sid The service_sid
|
20
|
-
# @param [String] user_sid
|
20
|
+
# @param [String] user_sid A 34 character string that uniquely identifies this
|
21
|
+
# resource.
|
21
22
|
# @return [UserChannelList] UserChannelList
|
22
23
|
def initialize(version, service_sid: nil, user_sid: nil)
|
23
24
|
super(version)
|
@@ -156,7 +157,8 @@ module Twilio
|
|
156
157
|
# @param [Version] version Version that contains the resource
|
157
158
|
# @param [Hash] payload payload that contains response from Twilio
|
158
159
|
# @param [String] service_sid The service_sid
|
159
|
-
# @param [String] user_sid
|
160
|
+
# @param [String] user_sid A 34 character string that uniquely identifies this
|
161
|
+
# resource.
|
160
162
|
# @return [UserChannelInstance] UserChannelInstance
|
161
163
|
def initialize(version, payload, service_sid: nil, user_sid: nil)
|
162
164
|
super(version)
|
@@ -15,7 +15,9 @@ module Twilio
|
|
15
15
|
##
|
16
16
|
# Initialize the UserList
|
17
17
|
# @param [Version] version Version that contains the resource
|
18
|
-
# @param [String] service_sid The
|
18
|
+
# @param [String] service_sid The unique id of the
|
19
|
+
# [Service](https://www.twilio.com/docs/api/chat/rest/services) this user belongs
|
20
|
+
# to.
|
19
21
|
# @return [UserList] UserList
|
20
22
|
def initialize(version, service_sid: nil)
|
21
23
|
super(version)
|
@@ -28,10 +30,16 @@ module Twilio
|
|
28
30
|
##
|
29
31
|
# Retrieve a single page of UserInstance records from the API.
|
30
32
|
# Request is executed immediately.
|
31
|
-
# @param [String] identity
|
32
|
-
#
|
33
|
-
#
|
34
|
-
# @param [String]
|
33
|
+
# @param [String] identity A unique string that identifies the user within this
|
34
|
+
# service - often a username or email address. See the [identity][identity] docs
|
35
|
+
# for more details.
|
36
|
+
# @param [String] role_sid The unique id of the
|
37
|
+
# [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user.
|
38
|
+
# @param [String] attributes An optional string used to contain any metadata or
|
39
|
+
# other information for the User. The string must contain structurally valid JSON
|
40
|
+
# if specified.
|
41
|
+
# @param [String] friendly_name An optional human readable string representing the
|
42
|
+
# user. Often used for display purposes.
|
35
43
|
# @return [UserInstance] Newly created UserInstance
|
36
44
|
def create(identity: nil, role_sid: :unset, attributes: :unset, friendly_name: :unset)
|
37
45
|
data = Twilio::Values.of({
|
@@ -211,9 +219,13 @@ module Twilio
|
|
211
219
|
|
212
220
|
##
|
213
221
|
# Update the UserInstance
|
214
|
-
# @param [String] role_sid The
|
215
|
-
#
|
216
|
-
# @param [String]
|
222
|
+
# @param [String] role_sid The unique id of the [Role][role] assigned to this
|
223
|
+
# user.
|
224
|
+
# @param [String] attributes An optional string used to contain any metadata or
|
225
|
+
# other information for the User. The string must contain structurally valid JSON
|
226
|
+
# if specified.
|
227
|
+
# @param [String] friendly_name An optional human readable string representing the
|
228
|
+
# user. Often used for display purposes.
|
217
229
|
# @return [UserInstance] Updated UserInstance
|
218
230
|
def update(role_sid: :unset, attributes: :unset, friendly_name: :unset)
|
219
231
|
data = Twilio::Values.of({
|
@@ -282,7 +294,9 @@ module Twilio
|
|
282
294
|
# Initialize the UserInstance
|
283
295
|
# @param [Version] version Version that contains the resource
|
284
296
|
# @param [Hash] payload payload that contains response from Twilio
|
285
|
-
# @param [String] service_sid The
|
297
|
+
# @param [String] service_sid The unique id of the
|
298
|
+
# [Service](https://www.twilio.com/docs/api/chat/rest/services) this user belongs
|
299
|
+
# to.
|
286
300
|
# @param [String] sid The sid
|
287
301
|
# @return [UserInstance] UserInstance
|
288
302
|
def initialize(version, payload, service_sid: nil, sid: nil)
|
@@ -323,73 +337,73 @@ module Twilio
|
|
323
337
|
end
|
324
338
|
|
325
339
|
##
|
326
|
-
# @return [String]
|
340
|
+
# @return [String] A 34 character string that uniquely identifies this resource.
|
327
341
|
def sid
|
328
342
|
@properties['sid']
|
329
343
|
end
|
330
344
|
|
331
345
|
##
|
332
|
-
# @return [String] The
|
346
|
+
# @return [String] The unique id of the Account responsible for this user.
|
333
347
|
def account_sid
|
334
348
|
@properties['account_sid']
|
335
349
|
end
|
336
350
|
|
337
351
|
##
|
338
|
-
# @return [String] The
|
352
|
+
# @return [String] The unique id of the Service this user belongs to.
|
339
353
|
def service_sid
|
340
354
|
@properties['service_sid']
|
341
355
|
end
|
342
356
|
|
343
357
|
##
|
344
|
-
# @return [String]
|
358
|
+
# @return [String] An optional string metadata field you can use to store any data you wish.
|
345
359
|
def attributes
|
346
360
|
@properties['attributes']
|
347
361
|
end
|
348
362
|
|
349
363
|
##
|
350
|
-
# @return [String] The
|
364
|
+
# @return [String] The human-readable name of this user.
|
351
365
|
def friendly_name
|
352
366
|
@properties['friendly_name']
|
353
367
|
end
|
354
368
|
|
355
369
|
##
|
356
|
-
# @return [String] The
|
370
|
+
# @return [String] The unique id of the [Role][role] assigned to this user.
|
357
371
|
def role_sid
|
358
372
|
@properties['role_sid']
|
359
373
|
end
|
360
374
|
|
361
375
|
##
|
362
|
-
# @return [String]
|
376
|
+
# @return [String] A unique string that identifies the user within this service - often a username or email address.
|
363
377
|
def identity
|
364
378
|
@properties['identity']
|
365
379
|
end
|
366
380
|
|
367
381
|
##
|
368
|
-
# @return [Boolean]
|
382
|
+
# @return [Boolean] Indicates whether the User is actively connected to the Service instance and online.
|
369
383
|
def is_online
|
370
384
|
@properties['is_online']
|
371
385
|
end
|
372
386
|
|
373
387
|
##
|
374
|
-
# @return [Boolean]
|
388
|
+
# @return [Boolean] Indicates whether the User has a potentially valid Push Notification registration for the Service instance.
|
375
389
|
def is_notifiable
|
376
390
|
@properties['is_notifiable']
|
377
391
|
end
|
378
392
|
|
379
393
|
##
|
380
|
-
# @return [Time] The
|
394
|
+
# @return [Time] The date that this resource was created in ISO 8601 format.
|
381
395
|
def date_created
|
382
396
|
@properties['date_created']
|
383
397
|
end
|
384
398
|
|
385
399
|
##
|
386
|
-
# @return [Time] The
|
400
|
+
# @return [Time] The date that this resource was last updated in ISO 8601 format.
|
387
401
|
def date_updated
|
388
402
|
@properties['date_updated']
|
389
403
|
end
|
390
404
|
|
391
405
|
##
|
392
|
-
# @return [String] The
|
406
|
+
# @return [String] The number of Channels this User is a Member of.
|
393
407
|
def joined_channels_count
|
394
408
|
@properties['joined_channels_count']
|
395
409
|
end
|
@@ -401,7 +415,7 @@ module Twilio
|
|
401
415
|
end
|
402
416
|
|
403
417
|
##
|
404
|
-
# @return [String]
|
418
|
+
# @return [String] An absolute URL for this user.
|
405
419
|
def url
|
406
420
|
@properties['url']
|
407
421
|
end
|
@@ -422,9 +436,13 @@ module Twilio
|
|
422
436
|
|
423
437
|
##
|
424
438
|
# Update the UserInstance
|
425
|
-
# @param [String] role_sid The
|
426
|
-
#
|
427
|
-
# @param [String]
|
439
|
+
# @param [String] role_sid The unique id of the [Role][role] assigned to this
|
440
|
+
# user.
|
441
|
+
# @param [String] attributes An optional string used to contain any metadata or
|
442
|
+
# other information for the User. The string must contain structurally valid JSON
|
443
|
+
# if specified.
|
444
|
+
# @param [String] friendly_name An optional human readable string representing the
|
445
|
+
# user. Often used for display purposes.
|
428
446
|
# @return [UserInstance] Updated UserInstance
|
429
447
|
def update(role_sid: :unset, attributes: :unset, friendly_name: :unset)
|
430
448
|
context.update(role_sid: role_sid, attributes: attributes, friendly_name: friendly_name, )
|