twilio-ruby 5.0.0.rc16 → 5.0.0.rc17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHORS.md +1 -0
  3. data/CHANGES.md +1 -1
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/jwt/access_token.rb +23 -1
  6. data/lib/twilio-ruby/rest/api.rb +2 -2
  7. data/lib/twilio-ruby/rest/api/v2010.rb +2 -2
  8. data/lib/twilio-ruby/rest/api/v2010/account.rb +19 -11
  9. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +29 -5
  10. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +5 -5
  11. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +25 -0
  12. data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +406 -0
  13. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +2 -6
  14. data/lib/twilio-ruby/rest/{notifications.rb → chat.rb} +6 -6
  15. data/lib/twilio-ruby/rest/{notifications → chat}/v1.rb +3 -3
  16. data/lib/twilio-ruby/rest/{notifications → chat}/v1/credential.rb +5 -5
  17. data/lib/twilio-ruby/rest/chat/v1/service.rb +501 -0
  18. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +468 -0
  19. data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +351 -0
  20. data/lib/twilio-ruby/rest/{api/v2010/account/sms/sms_message.rb → chat/v1/service/channel/message.rb} +120 -168
  21. data/lib/twilio-ruby/rest/chat/v1/service/role.rb +373 -0
  22. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +378 -0
  23. data/lib/twilio-ruby/rest/client.rb +19 -8
  24. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +3 -1
  25. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +2 -6
  26. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +5 -1
  27. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +5 -0
  28. data/lib/twilio-ruby/rest/notify.rb +44 -0
  29. data/lib/twilio-ruby/rest/notify/v1.rb +44 -0
  30. data/lib/twilio-ruby/rest/notify/v1/credential.rb +375 -0
  31. data/lib/twilio-ruby/rest/{notifications → notify}/v1/service.rb +5 -5
  32. data/lib/twilio-ruby/rest/{notifications → notify}/v1/service/binding.rb +5 -5
  33. data/lib/twilio-ruby/rest/{notifications → notify}/v1/service/notification.rb +4 -4
  34. data/lib/twilio-ruby/rest/preview.rb +11 -0
  35. data/lib/twilio-ruby/rest/preview/sync.rb +35 -0
  36. data/lib/twilio-ruby/rest/preview/sync/service.rb +458 -0
  37. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +376 -0
  38. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +375 -0
  39. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +409 -0
  40. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +375 -0
  41. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +411 -0
  42. data/lib/twilio-ruby/rest/preview/wireless/device.rb +6 -2
  43. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +55 -3
  44. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +29 -6
  45. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +294 -0
  46. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +32 -0
  47. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +374 -0
  48. data/lib/twilio-ruby/version.rb +1 -1
  49. data/spec/integration/api/v2010/account/conference/participant_spec.rb +6 -6
  50. data/spec/integration/api/v2010/account/recording_spec.rb +10 -1
  51. data/spec/integration/api/v2010/account/{sms/short_code_spec.rb → short_code_spec.rb} +0 -7
  52. data/spec/integration/api/v2010/account/sip/credential_list/credential_spec.rb +3 -7
  53. data/spec/integration/chat/v1/credential_spec.rb +223 -0
  54. data/spec/integration/chat/v1/service/channel/member_spec.rb +213 -0
  55. data/spec/integration/chat/v1/service/channel/message_spec.rb +100 -0
  56. data/spec/integration/chat/v1/service/channel_spec.rb +259 -0
  57. data/spec/integration/chat/v1/service/role_spec.rb +263 -0
  58. data/spec/integration/chat/v1/service/user_spec.rb +242 -0
  59. data/spec/integration/chat/v1/service_spec.rb +263 -0
  60. data/spec/integration/ip_messaging/v1/service/role_spec.rb +2 -3
  61. data/spec/integration/ip_messaging/v1/service/user_spec.rb +2 -3
  62. data/spec/integration/lookups/v1/phone_number_spec.rb +5 -0
  63. data/spec/integration/{notifications → notify}/v1/credential_spec.rb +24 -24
  64. data/spec/integration/{notifications → notify}/v1/service/binding_spec.rb +29 -29
  65. data/spec/integration/{notifications → notify}/v1/service/notification_spec.rb +5 -5
  66. data/spec/integration/{notifications → notify}/v1/service_spec.rb +32 -32
  67. data/spec/integration/preview/sync/service/document_spec.rb +92 -0
  68. data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +100 -0
  69. data/spec/integration/preview/sync/service/sync_list_spec.rb +73 -0
  70. data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +101 -0
  71. data/spec/integration/preview/sync/service/sync_map_spec.rb +73 -0
  72. data/spec/integration/preview/sync/service_spec.rb +84 -0
  73. data/spec/integration/taskrouter/v1/workspace/task_channel_spec.rb +127 -0
  74. data/spec/integration/taskrouter/v1/workspace/task_spec.rb +8 -0
  75. data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +201 -0
  76. data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +2 -3
  77. data/spec/integration/taskrouter/v1/workspace_spec.rb +8 -0
  78. data/spec/jwt/access_token_spec.rb +27 -0
  79. metadata +84 -42
  80. data/lib/twilio-ruby/rest/api/v2010/account/sms.rb +0 -134
  81. data/lib/twilio-ruby/rest/api/v2010/account/sms/short_code.rb +0 -408
  82. data/spec/integration/api/v2010/account/sms/sms_message_spec.rb +0 -275
  83. data/spec/integration/api/v2010/account/sms_spec.rb +0 -10
@@ -223,12 +223,10 @@ module Twilio
223
223
 
224
224
  ##
225
225
  # Update the CredentialInstance
226
- # @param [String] username The username
227
226
  # @param [String] password The password
228
227
  # @return [CredentialInstance] Updated CredentialInstance
229
- def update(username: nil, password: nil)
228
+ def update(password: nil)
230
229
  data = {
231
- 'Username' => username,
232
230
  'Password' => password,
233
231
  }
234
232
 
@@ -348,12 +346,10 @@ module Twilio
348
346
 
349
347
  ##
350
348
  # Update the CredentialInstance
351
- # @param [String] username The username
352
349
  # @param [String] password The password
353
350
  # @return [CredentialInstance] Updated CredentialInstance
354
- def update(username: nil, password: nil)
351
+ def update(password: nil)
355
352
  context.update(
356
- username: username,
357
353
  password: password,
358
354
  )
359
355
  end
@@ -6,14 +6,14 @@
6
6
 
7
7
  module Twilio
8
8
  module REST
9
- class Notifications < Domain
9
+ class Chat < Domain
10
10
  ##
11
- # Initialize the Notifications Domain
11
+ # Initialize the Chat Domain
12
12
  def initialize(twilio)
13
13
  super
14
14
 
15
- @base_url = 'https://notifications.twilio.com'
16
- @host = 'notifications.twilio.com'
15
+ @base_url = 'https://chat.twilio.com'
16
+ @host = 'chat.twilio.com'
17
17
  @port = 443
18
18
 
19
19
  # Versions
@@ -21,7 +21,7 @@ module Twilio
21
21
  end
22
22
 
23
23
  ##
24
- # Version v1 of notifications
24
+ # Version v1 of chat
25
25
  def v1
26
26
  @v1 ||= V1.new self
27
27
  end
@@ -37,7 +37,7 @@ module Twilio
37
37
  ##
38
38
  # Provide a user friendly representation
39
39
  def to_s
40
- '#<Twilio::REST::Notifications>'
40
+ '#<Twilio::REST::Chat>'
41
41
  end
42
42
  end
43
43
  end
@@ -6,10 +6,10 @@
6
6
 
7
7
  module Twilio
8
8
  module REST
9
- class Notifications
9
+ class Chat
10
10
  class V1 < Version
11
11
  ##
12
- # Initialize the V1 version of Notifications
12
+ # Initialize the V1 version of Chat
13
13
  def initialize(domain)
14
14
  super
15
15
  @version = 'v1'
@@ -36,7 +36,7 @@ module Twilio
36
36
  ##
37
37
  # Provide a user friendly representation
38
38
  def to_s
39
- '<Twilio::REST::Notifications::V1>'
39
+ '<Twilio::REST::Chat::V1>'
40
40
  end
41
41
  end
42
42
  end
@@ -6,7 +6,7 @@
6
6
 
7
7
  module Twilio
8
8
  module REST
9
- class Notifications < Domain
9
+ class Chat < Domain
10
10
  class V1 < Version
11
11
  class CredentialList < ListResource
12
12
  ##
@@ -138,7 +138,7 @@ module Twilio
138
138
  ##
139
139
  # Provide a user friendly representation
140
140
  def to_s
141
- '#<Twilio.Notifications.V1.CredentialList>'
141
+ '#<Twilio.Chat.V1.CredentialList>'
142
142
  end
143
143
  end
144
144
 
@@ -170,7 +170,7 @@ module Twilio
170
170
  ##
171
171
  # Provide a user friendly representation
172
172
  def to_s
173
- '<Twilio.Notifications.V1.CredentialPage>'
173
+ '<Twilio.Chat.V1.CredentialPage>'
174
174
  end
175
175
  end
176
176
 
@@ -250,7 +250,7 @@ module Twilio
250
250
  # Provide a user friendly representation
251
251
  def to_s
252
252
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
253
- "#<Twilio.Notifications.V1.CredentialContext #{context}>"
253
+ "#<Twilio.Chat.V1.CredentialContext #{context}>"
254
254
  end
255
255
  end
256
256
 
@@ -366,7 +366,7 @@ module Twilio
366
366
  # Provide a user friendly representation
367
367
  def to_s
368
368
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
369
- "<Twilio.Notifications.V1.CredentialInstance #{values}>"
369
+ "<Twilio.Chat.V1.CredentialInstance #{values}>"
370
370
  end
371
371
  end
372
372
  end
@@ -0,0 +1,501 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Chat < Domain
10
+ class V1 < Version
11
+ class ServiceList < ListResource
12
+ ##
13
+ # Initialize the ServiceList
14
+ # @param [Version] version Version that contains the resource
15
+ # @return [ServiceList] ServiceList
16
+ def initialize(version)
17
+ super(version)
18
+
19
+ # Path Solution
20
+ @solution = {}
21
+ @uri = "/Services"
22
+ end
23
+
24
+ ##
25
+ # Retrieve a single page of ServiceInstance records from the API.
26
+ # Request is executed immediately.
27
+ # @param [String] friendly_name The friendly_name
28
+ # @return [ServiceInstance] Newly created ServiceInstance
29
+ def create(friendly_name: nil)
30
+ data = {
31
+ 'FriendlyName' => friendly_name,
32
+ }
33
+
34
+ payload = @version.create(
35
+ 'POST',
36
+ @uri,
37
+ data: data
38
+ )
39
+
40
+ return ServiceInstance.new(
41
+ @version,
42
+ payload,
43
+ )
44
+ end
45
+
46
+ ##
47
+ # Lists ServiceInstance records from the API as a list.
48
+ # Unlike stream(), this operation is eager and will load `limit` records into
49
+ # memory before returning.
50
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
51
+ # guarantees to never return more than limit. Default is no limit
52
+ # @param [Integer] page_size Number of records to fetch per request, when not set will use
53
+ # the default value of 50 records. If no page_size is defined
54
+ # but a limit is defined, stream() will attempt to read the
55
+ # limit with the most efficient page size, i.e. min(limit, 1000)
56
+ # @return [Array] Array of up to limit results
57
+ def list(limit: nil, page_size: nil)
58
+ self.stream(
59
+ limit: limit,
60
+ page_size: page_size
61
+ ).entries
62
+ end
63
+
64
+ ##
65
+ # Streams ServiceInstance records from the API as an Enumerable.
66
+ # This operation lazily loads records as efficiently as possible until the limit
67
+ # is reached.
68
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
69
+ # guarantees to never return more than limit. Default is no limit
70
+ # @param [Integer] page_size Number of records to fetch per request, when not set will use
71
+ # the default value of 50 records. If no page_size is defined
72
+ # but a limit is defined, stream() will attempt to read the
73
+ # limit with the most efficient page size, i.e. min(limit, 1000)
74
+ # @return [Enumerable] Enumerable that will yield up to limit results
75
+ def stream(limit: nil, page_size: nil)
76
+ limits = @version.read_limits(limit, page_size)
77
+
78
+ page = self.page(
79
+ page_size: limits[:page_size],
80
+ )
81
+
82
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
83
+ end
84
+
85
+ ##
86
+ # When passed a block, yields ServiceInstance records from the API.
87
+ # This operation lazily loads records as efficiently as possible until the limit
88
+ # is reached.
89
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
90
+ # guarantees to never return more than limit. Default is no limit
91
+ # @param [Integer] page_size Number of records to fetch per request, when not set will use
92
+ # the default value of 50 records. If no page_size is defined
93
+ # but a limit is defined, stream() will attempt to read the
94
+ # limit with the most efficient page size, i.e. min(limit, 1000)
95
+ def each
96
+ limits = @version.read_limits
97
+
98
+ page = self.page(
99
+ page_size: limits[:page_size],
100
+ )
101
+
102
+ @version.stream(page,
103
+ limit: limits[:limit],
104
+ page_limit: limits[:page_limit]).each {|x| yield x}
105
+ end
106
+
107
+ ##
108
+ # Retrieve a single page of ServiceInstance records from the API.
109
+ # Request is executed immediately.
110
+ # @param [String] page_token PageToken provided by the API
111
+ # @param [Integer] page_number Page Number, this value is simply for client state
112
+ # @param [Integer] page_size Number of records to return, defaults to 50
113
+ # @return [Page] Page of ServiceInstance
114
+ def page(page_token: nil, page_number: nil, page_size: nil)
115
+ params = {
116
+ 'PageToken' => page_token,
117
+ 'Page' => page_number,
118
+ 'PageSize' => page_size,
119
+ }
120
+ response = @version.page(
121
+ 'GET',
122
+ @uri,
123
+ params
124
+ )
125
+ return ServicePage.new(@version, response, @solution)
126
+ end
127
+
128
+ ##
129
+ # Provide a user friendly representation
130
+ def to_s
131
+ '#<Twilio.Chat.V1.ServiceList>'
132
+ end
133
+ end
134
+
135
+ class ServicePage < Page
136
+ ##
137
+ # Initialize the ServicePage
138
+ # @param [Version] version Version that contains the resource
139
+ # @param [Response] response Response from the API
140
+ # @param [Hash] solution Path solution for the resource
141
+ # @return [ServicePage] ServicePage
142
+ def initialize(version, response, solution)
143
+ super(version, response)
144
+
145
+ # Path Solution
146
+ @solution = solution
147
+ end
148
+
149
+ ##
150
+ # Build an instance of ServiceInstance
151
+ # @param [Hash] payload Payload response from the API
152
+ # @return [ServiceInstance] ServiceInstance
153
+ def get_instance(payload)
154
+ return ServiceInstance.new(
155
+ @version,
156
+ payload,
157
+ )
158
+ end
159
+
160
+ ##
161
+ # Provide a user friendly representation
162
+ def to_s
163
+ '<Twilio.Chat.V1.ServicePage>'
164
+ end
165
+ end
166
+
167
+ class ServiceContext < InstanceContext
168
+ ##
169
+ # Initialize the ServiceContext
170
+ # @param [Version] version Version that contains the resource
171
+ # @param [String] sid The sid
172
+ # @return [ServiceContext] ServiceContext
173
+ def initialize(version, sid)
174
+ super(version)
175
+
176
+ # Path Solution
177
+ @solution = {
178
+ sid: sid,
179
+ }
180
+ @uri = "/Services/#{@solution[:sid]}"
181
+
182
+ # Dependents
183
+ @channels = nil
184
+ @roles = nil
185
+ @users = nil
186
+ end
187
+
188
+ ##
189
+ # Fetch a ServiceInstance
190
+ # @return [ServiceInstance] Fetched ServiceInstance
191
+ def fetch
192
+ params = {}
193
+
194
+ payload = @version.fetch(
195
+ 'GET',
196
+ @uri,
197
+ params,
198
+ )
199
+
200
+ return ServiceInstance.new(
201
+ @version,
202
+ payload,
203
+ sid: @solution[:sid],
204
+ )
205
+ end
206
+
207
+ ##
208
+ # Deletes the ServiceInstance
209
+ # @return [Boolean] true if delete succeeds, true otherwise
210
+ def delete
211
+ return @version.delete('delete', @uri)
212
+ end
213
+
214
+ ##
215
+ # Update the ServiceInstance
216
+ # @param [String] friendly_name The friendly_name
217
+ # @param [String] default_service_role_sid The default_service_role_sid
218
+ # @param [String] default_channel_role_sid The default_channel_role_sid
219
+ # @param [String] default_channel_creator_role_sid The
220
+ # default_channel_creator_role_sid
221
+ # @param [Boolean] read_status_enabled The read_status_enabled
222
+ # @param [String] typing_indicator_timeout The typing_indicator_timeout
223
+ # @param [String] consumption_report_interval The consumption_report_interval
224
+ # @param [Hash] webhooks The webhooks
225
+ # @return [ServiceInstance] Updated ServiceInstance
226
+ def update(friendly_name: nil, default_service_role_sid: nil, default_channel_role_sid: nil, default_channel_creator_role_sid: nil, read_status_enabled: nil, typing_indicator_timeout: nil, consumption_report_interval: nil, webhooks: nil)
227
+ data = {
228
+ 'FriendlyName' => friendly_name,
229
+ 'DefaultServiceRoleSid' => default_service_role_sid,
230
+ 'DefaultChannelRoleSid' => default_channel_role_sid,
231
+ 'DefaultChannelCreatorRoleSid' => default_channel_creator_role_sid,
232
+ 'ReadStatusEnabled' => read_status_enabled,
233
+ 'TypingIndicatorTimeout' => typing_indicator_timeout,
234
+ 'ConsumptionReportInterval' => consumption_report_interval,
235
+ 'Webhooks' => webhooks,
236
+ }
237
+
238
+ payload = @version.update(
239
+ 'POST',
240
+ @uri,
241
+ data: data,
242
+ )
243
+
244
+ return ServiceInstance.new(
245
+ @version,
246
+ payload,
247
+ sid: @solution[:sid],
248
+ )
249
+ end
250
+
251
+ ##
252
+ # Access the channels
253
+ # @return [ChannelList] ChannelList
254
+ def channels(sid=:unset)
255
+ if sid != :unset
256
+ return ChannelContext.new(
257
+ @version,
258
+ @solution[:sid],
259
+ sid,
260
+ )
261
+ end
262
+
263
+ unless @channels
264
+ @channels = ChannelList.new(
265
+ @version,
266
+ service_sid: @solution[:sid],
267
+ )
268
+ end
269
+
270
+ @channels
271
+ end
272
+
273
+ ##
274
+ # Access the roles
275
+ # @return [RoleList] RoleList
276
+ def roles(sid=:unset)
277
+ if sid != :unset
278
+ return RoleContext.new(
279
+ @version,
280
+ @solution[:sid],
281
+ sid,
282
+ )
283
+ end
284
+
285
+ unless @roles
286
+ @roles = RoleList.new(
287
+ @version,
288
+ service_sid: @solution[:sid],
289
+ )
290
+ end
291
+
292
+ @roles
293
+ end
294
+
295
+ ##
296
+ # Access the users
297
+ # @return [UserList] UserList
298
+ def users(sid=:unset)
299
+ if sid != :unset
300
+ return UserContext.new(
301
+ @version,
302
+ @solution[:sid],
303
+ sid,
304
+ )
305
+ end
306
+
307
+ unless @users
308
+ @users = UserList.new(
309
+ @version,
310
+ service_sid: @solution[:sid],
311
+ )
312
+ end
313
+
314
+ @users
315
+ end
316
+
317
+ ##
318
+ # Provide a user friendly representation
319
+ def to_s
320
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
321
+ "#<Twilio.Chat.V1.ServiceContext #{context}>"
322
+ end
323
+ end
324
+
325
+ class ServiceInstance < InstanceResource
326
+ ##
327
+ # Initialize the ServiceInstance
328
+ # @param [Version] version Version that contains the resource
329
+ # @param [Hash] payload payload that contains response from Twilio
330
+ # @param [String] sid The sid
331
+ # @return [ServiceInstance] ServiceInstance
332
+ def initialize(version, payload, sid: nil)
333
+ super(version)
334
+
335
+ # Marshaled Properties
336
+ @properties = {
337
+ 'sid' => payload['sid'],
338
+ 'account_sid' => payload['account_sid'],
339
+ 'friendly_name' => payload['friendly_name'],
340
+ 'date_created' => Twilio.deserialize_iso8601(payload['date_created']),
341
+ 'date_updated' => Twilio.deserialize_iso8601(payload['date_updated']),
342
+ 'default_service_role_sid' => payload['default_service_role_sid'],
343
+ 'default_channel_role_sid' => payload['default_channel_role_sid'],
344
+ 'default_channel_creator_role_sid' => payload['default_channel_creator_role_sid'],
345
+ 'read_status_enabled' => payload['read_status_enabled'],
346
+ 'typing_indicator_timeout' => payload['typing_indicator_timeout'].to_i,
347
+ 'consumption_report_interval' => payload['consumption_report_interval'].to_i,
348
+ 'webhooks' => payload['webhooks'],
349
+ 'url' => payload['url'],
350
+ 'links' => payload['links'],
351
+ }
352
+
353
+ # Context
354
+ @instance_context = nil
355
+ @params = {
356
+ 'sid' => sid || @properties['sid'],
357
+ }
358
+ end
359
+
360
+ ##
361
+ # Generate an instance context for the instance, the context is capable of
362
+ # performing various actions. All instance actions are proxied to the context
363
+ # @param [Version] version Version that contains the resource
364
+ # @return [ServiceContext] ServiceContext for this ServiceInstance
365
+ def context
366
+ unless @instance_context
367
+ @instance_context = ServiceContext.new(
368
+ @version,
369
+ @params['sid'],
370
+ )
371
+ end
372
+ @instance_context
373
+ end
374
+
375
+ def sid
376
+ @properties['sid']
377
+ end
378
+
379
+ def account_sid
380
+ @properties['account_sid']
381
+ end
382
+
383
+ def friendly_name
384
+ @properties['friendly_name']
385
+ end
386
+
387
+ def date_created
388
+ @properties['date_created']
389
+ end
390
+
391
+ def date_updated
392
+ @properties['date_updated']
393
+ end
394
+
395
+ def default_service_role_sid
396
+ @properties['default_service_role_sid']
397
+ end
398
+
399
+ def default_channel_role_sid
400
+ @properties['default_channel_role_sid']
401
+ end
402
+
403
+ def default_channel_creator_role_sid
404
+ @properties['default_channel_creator_role_sid']
405
+ end
406
+
407
+ def read_status_enabled
408
+ @properties['read_status_enabled']
409
+ end
410
+
411
+ def typing_indicator_timeout
412
+ @properties['typing_indicator_timeout']
413
+ end
414
+
415
+ def consumption_report_interval
416
+ @properties['consumption_report_interval']
417
+ end
418
+
419
+ def webhooks
420
+ @properties['webhooks']
421
+ end
422
+
423
+ def url
424
+ @properties['url']
425
+ end
426
+
427
+ def links
428
+ @properties['links']
429
+ end
430
+
431
+ ##
432
+ # Fetch a ServiceInstance
433
+ # @return [ServiceInstance] Fetched ServiceInstance
434
+ def fetch
435
+ context.fetch
436
+ end
437
+
438
+ ##
439
+ # Deletes the ServiceInstance
440
+ # @return [Boolean] true if delete succeeds, true otherwise
441
+ def delete
442
+ context.delete
443
+ end
444
+
445
+ ##
446
+ # Update the ServiceInstance
447
+ # @param [String] friendly_name The friendly_name
448
+ # @param [String] default_service_role_sid The default_service_role_sid
449
+ # @param [String] default_channel_role_sid The default_channel_role_sid
450
+ # @param [String] default_channel_creator_role_sid The
451
+ # default_channel_creator_role_sid
452
+ # @param [Boolean] read_status_enabled The read_status_enabled
453
+ # @param [String] typing_indicator_timeout The typing_indicator_timeout
454
+ # @param [String] consumption_report_interval The consumption_report_interval
455
+ # @param [Hash] webhooks The webhooks
456
+ # @return [ServiceInstance] Updated ServiceInstance
457
+ def update(friendly_name: nil, default_service_role_sid: nil, default_channel_role_sid: nil, default_channel_creator_role_sid: nil, read_status_enabled: nil, typing_indicator_timeout: nil, consumption_report_interval: nil, webhooks: nil)
458
+ context.update(
459
+ friendly_name: friendly_name,
460
+ default_service_role_sid: default_service_role_sid,
461
+ default_channel_role_sid: default_channel_role_sid,
462
+ default_channel_creator_role_sid: default_channel_creator_role_sid,
463
+ read_status_enabled: read_status_enabled,
464
+ typing_indicator_timeout: typing_indicator_timeout,
465
+ consumption_report_interval: consumption_report_interval,
466
+ webhooks: webhooks,
467
+ )
468
+ end
469
+
470
+ ##
471
+ # Access the channels
472
+ # @return [channels] channels
473
+ def channels
474
+ context.channels
475
+ end
476
+
477
+ ##
478
+ # Access the roles
479
+ # @return [roles] roles
480
+ def roles
481
+ context.roles
482
+ end
483
+
484
+ ##
485
+ # Access the users
486
+ # @return [users] users
487
+ def users
488
+ context.users
489
+ end
490
+
491
+ ##
492
+ # Provide a user friendly representation
493
+ def to_s
494
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
495
+ "<Twilio.Chat.V1.ServiceInstance #{values}>"
496
+ end
497
+ end
498
+ end
499
+ end
500
+ end
501
+ end