twilio-ruby 5.40.2 → 5.40.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +15 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/framework/version.rb +2 -1
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +2 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +8 -2
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -2
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +8 -1
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +3 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +2 -1
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +8 -4
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +11 -4
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +13 -6
- data/lib/twilio-ruby/rest/conversations.rb +0 -16
- data/lib/twilio-ruby/rest/conversations/v1.rb +0 -24
- data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +17 -7
- data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +262 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +6 -6
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +13 -10
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +22 -16
- data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +42 -36
- data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +14 -11
- data/lib/twilio-ruby/rest/conversations/v1/credential.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/role.rb +4 -2
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +28 -25
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +30 -18
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +315 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +23 -20
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +32 -26
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +52 -46
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +24 -21
- data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +13 -11
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +23 -23
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +14 -14
- data/lib/twilio-ruby/rest/events.rb +10 -1
- data/lib/twilio-ruby/rest/events/v1.rb +17 -1
- data/lib/twilio-ruby/rest/events/v1/event_type.rb +8 -8
- data/lib/twilio-ruby/rest/events/v1/schema.rb +226 -0
- data/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +290 -0
- data/lib/twilio-ruby/rest/events/v1/subscription.rb +28 -8
- data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +3 -109
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +2 -1
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +6 -3
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +12 -6
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +10 -2
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +10 -5
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +6 -3
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb +1 -4
- data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +3 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +6 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +1 -4
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +6 -2
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +19 -26
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +2 -1
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +2 -1
- data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +201 -0
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -1
- data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -3
- data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +18 -9
- data/lib/twilio-ruby/rest/video/v1/room.rb +2 -1
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +1 -4
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +2 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/version_spec.rb +11 -0
- data/spec/integration/conversations/v1/{webhook_spec.rb → configuration/webhook_spec.rb} +12 -8
- data/spec/integration/conversations/v1/configuration_spec.rb +4 -2
- data/spec/integration/conversations/v1/{notification_spec.rb → service/configuration/notification_spec.rb} +12 -4
- data/spec/integration/events/v1/schema/schema_version_spec.rb +126 -0
- data/spec/integration/events/v1/schema_spec.rb +46 -0
- data/spec/integration/events/v1/subscription/subscribed_event_spec.rb +0 -121
- data/spec/integration/events/v1/subscription_spec.rb +38 -0
- data/spec/integration/trunking/v1/trunk/recording_spec.rb +79 -0
- metadata +17 -8
- data/lib/twilio-ruby/rest/conversations/v1/notification.rb +0 -310
- data/lib/twilio-ruby/rest/conversations/v1/webhook.rb +0 -262
@@ -18,11 +18,12 @@ module Twilio
|
|
18
18
|
##
|
19
19
|
# Initialize the WebhookList
|
20
20
|
# @param [Version] version Version that contains the resource
|
21
|
-
# @param [String] chat_service_sid The SID of the [
|
22
|
-
# Service](https://www.twilio.com/docs/
|
23
|
-
# resource is associated with.
|
24
|
-
# @param [String] conversation_sid The unique
|
25
|
-
# [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
|
21
|
+
# @param [String] chat_service_sid The SID of the [Conversation
|
22
|
+
# Service](https://www.twilio.com/docs/conversations/api/service-resource) the
|
23
|
+
# Participant resource is associated with.
|
24
|
+
# @param [String] conversation_sid The unique ID of the
|
25
|
+
# [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
|
26
|
+
# for this webhook.
|
26
27
|
# @return [WebhookList] WebhookList
|
27
28
|
def initialize(version, chat_service_sid: nil, conversation_sid: nil)
|
28
29
|
super(version)
|
@@ -44,7 +45,7 @@ module Twilio
|
|
44
45
|
# for this Conversation.
|
45
46
|
# @param [String] configuration_triggers The list of keywords, firing webhook
|
46
47
|
# event for this Conversation.
|
47
|
-
# @param [String] configuration_flow_sid The studio flow
|
48
|
+
# @param [String] configuration_flow_sid The studio flow SID, where the webhook
|
48
49
|
# should be sent to.
|
49
50
|
# @param [String] configuration_replay_after The message index for which and it's
|
50
51
|
# successors the webhook will be replayed. Not set by default
|
@@ -199,11 +200,12 @@ module Twilio
|
|
199
200
|
##
|
200
201
|
# Initialize the WebhookContext
|
201
202
|
# @param [Version] version Version that contains the resource
|
202
|
-
# @param [String] chat_service_sid The SID of the [
|
203
|
-
# Service](https://www.twilio.com/docs/
|
204
|
-
# resource is associated with.
|
205
|
-
# @param [String] conversation_sid The unique
|
206
|
-
# [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
|
203
|
+
# @param [String] chat_service_sid The SID of the [Conversation
|
204
|
+
# Service](https://www.twilio.com/docs/conversations/api/service-resource) the
|
205
|
+
# Participant resource is associated with.
|
206
|
+
# @param [String] conversation_sid The unique ID of the
|
207
|
+
# [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
|
208
|
+
# for this webhook.
|
207
209
|
# @param [String] sid A 34 character string that uniquely identifies this
|
208
210
|
# resource.
|
209
211
|
# @return [WebhookContext] WebhookContext
|
@@ -225,7 +227,7 @@ module Twilio
|
|
225
227
|
# for this Conversation.
|
226
228
|
# @param [String] configuration_triggers The list of keywords, firing webhook
|
227
229
|
# event for this Conversation.
|
228
|
-
# @param [String] configuration_flow_sid The studio flow
|
230
|
+
# @param [String] configuration_flow_sid The studio flow SID, where the webhook
|
229
231
|
# should be sent to.
|
230
232
|
# @return [WebhookInstance] Updated WebhookInstance
|
231
233
|
def update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset)
|
@@ -292,11 +294,12 @@ module Twilio
|
|
292
294
|
# Initialize the WebhookInstance
|
293
295
|
# @param [Version] version Version that contains the resource
|
294
296
|
# @param [Hash] payload payload that contains response from Twilio
|
295
|
-
# @param [String] chat_service_sid The SID of the [
|
296
|
-
# Service](https://www.twilio.com/docs/
|
297
|
-
# resource is associated with.
|
298
|
-
# @param [String] conversation_sid The unique
|
299
|
-
# [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
|
297
|
+
# @param [String] chat_service_sid The SID of the [Conversation
|
298
|
+
# Service](https://www.twilio.com/docs/conversations/api/service-resource) the
|
299
|
+
# Participant resource is associated with.
|
300
|
+
# @param [String] conversation_sid The unique ID of the
|
301
|
+
# [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
|
302
|
+
# for this webhook.
|
300
303
|
# @param [String] sid A 34 character string that uniquely identifies this
|
301
304
|
# resource.
|
302
305
|
# @return [WebhookInstance] WebhookInstance
|
@@ -348,19 +351,19 @@ module Twilio
|
|
348
351
|
end
|
349
352
|
|
350
353
|
##
|
351
|
-
# @return [String] The unique
|
354
|
+
# @return [String] The unique ID of the Account responsible for this conversation.
|
352
355
|
def account_sid
|
353
356
|
@properties['account_sid']
|
354
357
|
end
|
355
358
|
|
356
359
|
##
|
357
|
-
# @return [String] The SID of the
|
360
|
+
# @return [String] The SID of the Conversation Service that the resource is associated with.
|
358
361
|
def chat_service_sid
|
359
362
|
@properties['chat_service_sid']
|
360
363
|
end
|
361
364
|
|
362
365
|
##
|
363
|
-
# @return [String] The unique
|
366
|
+
# @return [String] The unique ID of the Conversation for this webhook.
|
364
367
|
def conversation_sid
|
365
368
|
@properties['conversation_sid']
|
366
369
|
end
|
@@ -405,7 +408,7 @@ module Twilio
|
|
405
408
|
# for this Conversation.
|
406
409
|
# @param [String] configuration_triggers The list of keywords, firing webhook
|
407
410
|
# event for this Conversation.
|
408
|
-
# @param [String] configuration_flow_sid The studio flow
|
411
|
+
# @param [String] configuration_flow_sid The studio flow SID, where the webhook
|
409
412
|
# should be sent to.
|
410
413
|
# @return [WebhookInstance] Updated WebhookInstance
|
411
414
|
def update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset)
|
@@ -17,9 +17,9 @@ module Twilio
|
|
17
17
|
##
|
18
18
|
# Initialize the RoleList
|
19
19
|
# @param [Version] version Version that contains the resource
|
20
|
-
# @param [String] chat_service_sid The SID of the [
|
21
|
-
# Service](https://www.twilio.com/docs/
|
22
|
-
# resource is associated with.
|
20
|
+
# @param [String] chat_service_sid The SID of the [Conversation
|
21
|
+
# Service](https://www.twilio.com/docs/conversations/api/service-resource) the
|
22
|
+
# Role resource is associated with.
|
23
23
|
# @return [RoleList] RoleList
|
24
24
|
def initialize(version, chat_service_sid: nil)
|
25
25
|
super(version)
|
@@ -34,7 +34,9 @@ module Twilio
|
|
34
34
|
# @param [String] friendly_name A descriptive string that you create to describe
|
35
35
|
# the new resource. It can be up to 64 characters long.
|
36
36
|
# @param [role.RoleType] type The type of role. Can be: `conversation` for
|
37
|
-
# [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
|
37
|
+
# [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
|
38
|
+
# roles or `service` for [Conversation
|
39
|
+
# Service](https://www.twilio.com/docs/conversations/api/service-resource) roles.
|
38
40
|
# @param [String] permission A permission that you grant to the new role. Only one
|
39
41
|
# permission can be granted per parameter. To assign more than one permission,
|
40
42
|
# repeat this parameter for each permission value. The values for this parameter
|
@@ -176,9 +178,9 @@ module Twilio
|
|
176
178
|
##
|
177
179
|
# Initialize the RoleContext
|
178
180
|
# @param [Version] version Version that contains the resource
|
179
|
-
# @param [String] chat_service_sid The SID of the [
|
180
|
-
# Service](https://www.twilio.com/docs/
|
181
|
-
# Role resource from.
|
181
|
+
# @param [String] chat_service_sid The SID of the [Conversation
|
182
|
+
# Service](https://www.twilio.com/docs/conversations/api/service-resource) to
|
183
|
+
# fetch the Role resource from.
|
182
184
|
# @param [String] sid The SID of the Role resource to fetch.
|
183
185
|
# @return [RoleContext] RoleContext
|
184
186
|
def initialize(version, chat_service_sid, sid)
|
@@ -254,9 +256,9 @@ module Twilio
|
|
254
256
|
# Initialize the RoleInstance
|
255
257
|
# @param [Version] version Version that contains the resource
|
256
258
|
# @param [Hash] payload payload that contains response from Twilio
|
257
|
-
# @param [String] chat_service_sid The SID of the [
|
258
|
-
# Service](https://www.twilio.com/docs/
|
259
|
-
# resource is associated with.
|
259
|
+
# @param [String] chat_service_sid The SID of the [Conversation
|
260
|
+
# Service](https://www.twilio.com/docs/conversations/api/service-resource) the
|
261
|
+
# Role resource is associated with.
|
260
262
|
# @param [String] sid The SID of the Role resource to fetch.
|
261
263
|
# @return [RoleInstance] RoleInstance
|
262
264
|
def initialize(version, payload, chat_service_sid: nil, sid: nil)
|
@@ -304,7 +306,7 @@ module Twilio
|
|
304
306
|
end
|
305
307
|
|
306
308
|
##
|
307
|
-
# @return [String] The SID of the Service that the resource is associated with
|
309
|
+
# @return [String] The SID of the Conversation Service that the resource is associated with
|
308
310
|
def chat_service_sid
|
309
311
|
@properties['chat_service_sid']
|
310
312
|
end
|
@@ -17,9 +17,9 @@ module Twilio
|
|
17
17
|
##
|
18
18
|
# Initialize the UserList
|
19
19
|
# @param [Version] version Version that contains the resource
|
20
|
-
# @param [String] chat_service_sid The SID of the [
|
21
|
-
# Service](https://www.twilio.com/docs/
|
22
|
-
# resource is associated with.
|
20
|
+
# @param [String] chat_service_sid The SID of the [Conversation
|
21
|
+
# Service](https://www.twilio.com/docs/conversations/api/service-resource) the
|
22
|
+
# User resource is associated with.
|
23
23
|
# @return [UserList] UserList
|
24
24
|
def initialize(version, chat_service_sid: nil)
|
25
25
|
super(version)
|
@@ -32,16 +32,16 @@ module Twilio
|
|
32
32
|
##
|
33
33
|
# Create the UserInstance
|
34
34
|
# @param [String] identity The application-defined string that uniquely identifies
|
35
|
-
# the resource's User within the
|
36
|
-
#
|
37
|
-
# often a username or an email address, and is case-sensitive.
|
35
|
+
# the resource's User within the [Conversation
|
36
|
+
# Service](https://www.twilio.com/docs/conversations/api/service-resource). This
|
37
|
+
# value is often a username or an email address, and is case-sensitive.
|
38
38
|
# @param [String] friendly_name The string that you assigned to describe the
|
39
39
|
# resource.
|
40
40
|
# @param [String] attributes The JSON Object string that stores
|
41
41
|
# application-specific data. If attributes have not been set, `{}` is returned.
|
42
|
-
# @param [String] role_sid The SID of
|
43
|
-
# [Role](https://www.twilio.com/docs/
|
44
|
-
# user.
|
42
|
+
# @param [String] role_sid The SID of a service-level
|
43
|
+
# [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to
|
44
|
+
# the user.
|
45
45
|
# @return [UserInstance] Created UserInstance
|
46
46
|
def create(identity: nil, friendly_name: :unset, attributes: :unset, role_sid: :unset)
|
47
47
|
data = Twilio::Values.of({
|
@@ -180,9 +180,9 @@ module Twilio
|
|
180
180
|
##
|
181
181
|
# Initialize the UserContext
|
182
182
|
# @param [Version] version Version that contains the resource
|
183
|
-
# @param [String] chat_service_sid The SID of the
|
184
|
-
#
|
185
|
-
# User resource from.
|
183
|
+
# @param [String] chat_service_sid The SID of the [Conversation
|
184
|
+
# Service](https://www.twilio.com/docs/conversations/api/service-resource) to
|
185
|
+
# fetch the User resource from.
|
186
186
|
# @param [String] sid The SID of the User resource to fetch. This value can be
|
187
187
|
# either the `sid` or the `identity` of the User resource to fetch.
|
188
188
|
# @return [UserContext] UserContext
|
@@ -200,9 +200,9 @@ module Twilio
|
|
200
200
|
# resource.
|
201
201
|
# @param [String] attributes The JSON Object string that stores
|
202
202
|
# application-specific data. If attributes have not been set, `{}` is returned.
|
203
|
-
# @param [String] role_sid The SID of
|
204
|
-
# [Role](https://www.twilio.com/docs/
|
205
|
-
# user.
|
203
|
+
# @param [String] role_sid The SID of a service-level
|
204
|
+
# [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to
|
205
|
+
# the user.
|
206
206
|
# @return [UserInstance] Updated UserInstance
|
207
207
|
def update(friendly_name: :unset, attributes: :unset, role_sid: :unset)
|
208
208
|
data = Twilio::Values.of({
|
@@ -264,9 +264,9 @@ module Twilio
|
|
264
264
|
# Initialize the UserInstance
|
265
265
|
# @param [Version] version Version that contains the resource
|
266
266
|
# @param [Hash] payload payload that contains response from Twilio
|
267
|
-
# @param [String] chat_service_sid The SID of the [
|
268
|
-
# Service](https://www.twilio.com/docs/
|
269
|
-
# resource is associated with.
|
267
|
+
# @param [String] chat_service_sid The SID of the [Conversation
|
268
|
+
# Service](https://www.twilio.com/docs/conversations/api/service-resource) the
|
269
|
+
# User resource is associated with.
|
270
270
|
# @param [String] sid The SID of the User resource to fetch. This value can be
|
271
271
|
# either the `sid` or the `identity` of the User resource to fetch.
|
272
272
|
# @return [UserInstance] UserInstance
|
@@ -317,13 +317,13 @@ module Twilio
|
|
317
317
|
end
|
318
318
|
|
319
319
|
##
|
320
|
-
# @return [String] The SID of the Service that the resource is associated with
|
320
|
+
# @return [String] The SID of the Conversation Service that the resource is associated with
|
321
321
|
def chat_service_sid
|
322
322
|
@properties['chat_service_sid']
|
323
323
|
end
|
324
324
|
|
325
325
|
##
|
326
|
-
# @return [String] The SID of
|
326
|
+
# @return [String] The SID of a service-level Role assigned to the user
|
327
327
|
def role_sid
|
328
328
|
@properties['role_sid']
|
329
329
|
end
|
@@ -376,9 +376,9 @@ module Twilio
|
|
376
376
|
# resource.
|
377
377
|
# @param [String] attributes The JSON Object string that stores
|
378
378
|
# application-specific data. If attributes have not been set, `{}` is returned.
|
379
|
-
# @param [String] role_sid The SID of
|
380
|
-
# [Role](https://www.twilio.com/docs/
|
381
|
-
# user.
|
379
|
+
# @param [String] role_sid The SID of a service-level
|
380
|
+
# [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to
|
381
|
+
# the user.
|
382
382
|
# @return [UserInstance] Updated UserInstance
|
383
383
|
def update(friendly_name: :unset, attributes: :unset, role_sid: :unset)
|
384
384
|
context.update(friendly_name: friendly_name, attributes: attributes, role_sid: role_sid, )
|
@@ -28,16 +28,16 @@ module Twilio
|
|
28
28
|
##
|
29
29
|
# Create the UserInstance
|
30
30
|
# @param [String] identity The application-defined string that uniquely identifies
|
31
|
-
# the resource's User within the
|
32
|
-
#
|
33
|
-
# often a username or an email address, and is case-sensitive.
|
31
|
+
# the resource's User within the [Conversation
|
32
|
+
# Service](https://www.twilio.com/docs/conversations/api/service-resource). This
|
33
|
+
# value is often a username or an email address, and is case-sensitive.
|
34
34
|
# @param [String] friendly_name The string that you assigned to describe the
|
35
35
|
# resource.
|
36
36
|
# @param [String] attributes The JSON Object string that stores
|
37
37
|
# application-specific data. If attributes have not been set, `{}` is returned.
|
38
|
-
# @param [String] role_sid The SID of
|
39
|
-
# [Role](https://www.twilio.com/docs/
|
40
|
-
# user.
|
38
|
+
# @param [String] role_sid The SID of a service-level
|
39
|
+
# [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to
|
40
|
+
# the user.
|
41
41
|
# @return [UserInstance] Created UserInstance
|
42
42
|
def create(identity: nil, friendly_name: :unset, attributes: :unset, role_sid: :unset)
|
43
43
|
data = Twilio::Values.of({
|
@@ -193,9 +193,9 @@ module Twilio
|
|
193
193
|
# resource.
|
194
194
|
# @param [String] attributes The JSON Object string that stores
|
195
195
|
# application-specific data. If attributes have not been set, `{}` is returned.
|
196
|
-
# @param [String] role_sid The SID of
|
197
|
-
# [Role](https://www.twilio.com/docs/
|
198
|
-
# user.
|
196
|
+
# @param [String] role_sid The SID of a service-level
|
197
|
+
# [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to
|
198
|
+
# the user.
|
199
199
|
# @return [UserInstance] Updated UserInstance
|
200
200
|
def update(friendly_name: :unset, attributes: :unset, role_sid: :unset)
|
201
201
|
data = Twilio::Values.of({
|
@@ -297,13 +297,13 @@ module Twilio
|
|
297
297
|
end
|
298
298
|
|
299
299
|
##
|
300
|
-
# @return [String] The SID of the Service that the resource is associated with
|
300
|
+
# @return [String] The SID of the Conversation Service that the resource is associated with
|
301
301
|
def chat_service_sid
|
302
302
|
@properties['chat_service_sid']
|
303
303
|
end
|
304
304
|
|
305
305
|
##
|
306
|
-
# @return [String] The SID of
|
306
|
+
# @return [String] The SID of a service-level Role assigned to the user
|
307
307
|
def role_sid
|
308
308
|
@properties['role_sid']
|
309
309
|
end
|
@@ -356,9 +356,9 @@ module Twilio
|
|
356
356
|
# resource.
|
357
357
|
# @param [String] attributes The JSON Object string that stores
|
358
358
|
# application-specific data. If attributes have not been set, `{}` is returned.
|
359
|
-
# @param [String] role_sid The SID of
|
360
|
-
# [Role](https://www.twilio.com/docs/
|
361
|
-
# user.
|
359
|
+
# @param [String] role_sid The SID of a service-level
|
360
|
+
# [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to
|
361
|
+
# the user.
|
362
362
|
# @return [UserInstance] Updated UserInstance
|
363
363
|
def update(friendly_name: :unset, attributes: :unset, role_sid: :unset)
|
364
364
|
context.update(friendly_name: friendly_name, attributes: attributes, role_sid: role_sid, )
|
@@ -29,13 +29,22 @@ module Twilio
|
|
29
29
|
end
|
30
30
|
|
31
31
|
##
|
32
|
-
# @param [String] type
|
32
|
+
# @param [String] type A string that uniquely identifies this Event Type.
|
33
33
|
# @return [Twilio::REST::Events::V1::EventTypeInstance] if type was passed.
|
34
34
|
# @return [Twilio::REST::Events::V1::EventTypeList]
|
35
35
|
def event_types(type=:unset)
|
36
36
|
self.v1.event_types(type)
|
37
37
|
end
|
38
38
|
|
39
|
+
##
|
40
|
+
# @param [String] id The unique identifier of the schema. Each schema can have
|
41
|
+
# multiple versions, that share the same id.
|
42
|
+
# @return [Twilio::REST::Events::V1::SchemaInstance] if id was passed.
|
43
|
+
# @return [Twilio::REST::Events::V1::SchemaList]
|
44
|
+
def schemas(id=:unset)
|
45
|
+
self.v1.schemas(id)
|
46
|
+
end
|
47
|
+
|
39
48
|
##
|
40
49
|
# @param [String] sid A 34 character string that uniquely identifies this Sink.
|
41
50
|
# @return [Twilio::REST::Events::V1::SinkInstance] if sid was passed.
|
@@ -16,12 +16,13 @@ module Twilio
|
|
16
16
|
super
|
17
17
|
@version = 'v1'
|
18
18
|
@event_types = nil
|
19
|
+
@schemas = nil
|
19
20
|
@sinks = nil
|
20
21
|
@subscriptions = nil
|
21
22
|
end
|
22
23
|
|
23
24
|
##
|
24
|
-
# @param [String] type
|
25
|
+
# @param [String] type A string that uniquely identifies this Event Type.
|
25
26
|
# @return [Twilio::REST::Events::V1::EventTypeContext] if type was passed.
|
26
27
|
# @return [Twilio::REST::Events::V1::EventTypeList]
|
27
28
|
def event_types(type=:unset)
|
@@ -34,6 +35,21 @@ module Twilio
|
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
38
|
+
##
|
39
|
+
# @param [String] id The unique identifier of the schema. Each schema can have
|
40
|
+
# multiple versions, that share the same id.
|
41
|
+
# @return [Twilio::REST::Events::V1::SchemaContext] if id was passed.
|
42
|
+
# @return [Twilio::REST::Events::V1::SchemaList]
|
43
|
+
def schemas(id=:unset)
|
44
|
+
if id.nil?
|
45
|
+
raise ArgumentError, 'id cannot be nil'
|
46
|
+
elsif id == :unset
|
47
|
+
@schemas ||= SchemaList.new self
|
48
|
+
else
|
49
|
+
SchemaContext.new(self, id)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
37
53
|
##
|
38
54
|
# @param [String] sid A 34 character string that uniquely identifies this Sink.
|
39
55
|
# @return [Twilio::REST::Events::V1::SinkContext] if sid was passed.
|
@@ -149,7 +149,7 @@ module Twilio
|
|
149
149
|
##
|
150
150
|
# Initialize the EventTypeContext
|
151
151
|
# @param [Version] version Version that contains the resource
|
152
|
-
# @param [String] type
|
152
|
+
# @param [String] type A string that uniquely identifies this Event Type.
|
153
153
|
# @return [EventTypeContext] EventTypeContext
|
154
154
|
def initialize(version, type)
|
155
155
|
super(version)
|
@@ -190,7 +190,7 @@ module Twilio
|
|
190
190
|
# Initialize the EventTypeInstance
|
191
191
|
# @param [Version] version Version that contains the resource
|
192
192
|
# @param [Hash] payload payload that contains response from Twilio
|
193
|
-
# @param [String] type
|
193
|
+
# @param [String] type A string that uniquely identifies this Event Type.
|
194
194
|
# @return [EventTypeInstance] EventTypeInstance
|
195
195
|
def initialize(version, payload, type: nil)
|
196
196
|
super(version)
|
@@ -223,37 +223,37 @@ module Twilio
|
|
223
223
|
end
|
224
224
|
|
225
225
|
##
|
226
|
-
# @return [String] The
|
226
|
+
# @return [String] The Event Type identifier.
|
227
227
|
def type
|
228
228
|
@properties['type']
|
229
229
|
end
|
230
230
|
|
231
231
|
##
|
232
|
-
# @return [String] The
|
232
|
+
# @return [String] The Schema identifier for this Event Type.
|
233
233
|
def schema_id
|
234
234
|
@properties['schema_id']
|
235
235
|
end
|
236
236
|
|
237
237
|
##
|
238
|
-
# @return [Time] The
|
238
|
+
# @return [Time] The date this Event Type was created.
|
239
239
|
def date_created
|
240
240
|
@properties['date_created']
|
241
241
|
end
|
242
242
|
|
243
243
|
##
|
244
|
-
# @return [Time] The
|
244
|
+
# @return [Time] The date this Event Type was updated.
|
245
245
|
def date_updated
|
246
246
|
@properties['date_updated']
|
247
247
|
end
|
248
248
|
|
249
249
|
##
|
250
|
-
# @return [String]
|
250
|
+
# @return [String] Event Type description.
|
251
251
|
def description
|
252
252
|
@properties['description']
|
253
253
|
end
|
254
254
|
|
255
255
|
##
|
256
|
-
# @return [String] The
|
256
|
+
# @return [String] The URL of this resource.
|
257
257
|
def url
|
258
258
|
@properties['url']
|
259
259
|
end
|
@@ -0,0 +1,226 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class Events < Domain
|
12
|
+
class V1 < Version
|
13
|
+
##
|
14
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
15
|
+
class SchemaList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the SchemaList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [SchemaList] SchemaList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# Provide a user friendly representation
|
29
|
+
def to_s
|
30
|
+
'#<Twilio.Events.V1.SchemaList>'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
##
|
35
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
36
|
+
class SchemaPage < Page
|
37
|
+
##
|
38
|
+
# Initialize the SchemaPage
|
39
|
+
# @param [Version] version Version that contains the resource
|
40
|
+
# @param [Response] response Response from the API
|
41
|
+
# @param [Hash] solution Path solution for the resource
|
42
|
+
# @return [SchemaPage] SchemaPage
|
43
|
+
def initialize(version, response, solution)
|
44
|
+
super(version, response)
|
45
|
+
|
46
|
+
# Path Solution
|
47
|
+
@solution = solution
|
48
|
+
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# Build an instance of SchemaInstance
|
52
|
+
# @param [Hash] payload Payload response from the API
|
53
|
+
# @return [SchemaInstance] SchemaInstance
|
54
|
+
def get_instance(payload)
|
55
|
+
SchemaInstance.new(@version, payload, )
|
56
|
+
end
|
57
|
+
|
58
|
+
##
|
59
|
+
# Provide a user friendly representation
|
60
|
+
def to_s
|
61
|
+
'<Twilio.Events.V1.SchemaPage>'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
##
|
66
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
67
|
+
class SchemaContext < InstanceContext
|
68
|
+
##
|
69
|
+
# Initialize the SchemaContext
|
70
|
+
# @param [Version] version Version that contains the resource
|
71
|
+
# @param [String] id The unique identifier of the schema. Each schema can have
|
72
|
+
# multiple versions, that share the same id.
|
73
|
+
# @return [SchemaContext] SchemaContext
|
74
|
+
def initialize(version, id)
|
75
|
+
super(version)
|
76
|
+
|
77
|
+
# Path Solution
|
78
|
+
@solution = {id: id, }
|
79
|
+
@uri = "/Schemas/#{@solution[:id]}"
|
80
|
+
|
81
|
+
# Dependents
|
82
|
+
@versions = nil
|
83
|
+
end
|
84
|
+
|
85
|
+
##
|
86
|
+
# Fetch the SchemaInstance
|
87
|
+
# @return [SchemaInstance] Fetched SchemaInstance
|
88
|
+
def fetch
|
89
|
+
payload = @version.fetch('GET', @uri)
|
90
|
+
|
91
|
+
SchemaInstance.new(@version, payload, id: @solution[:id], )
|
92
|
+
end
|
93
|
+
|
94
|
+
##
|
95
|
+
# Access the versions
|
96
|
+
# @return [VersionList]
|
97
|
+
# @return [VersionContext] if schema_version was passed.
|
98
|
+
def versions(schema_version=:unset)
|
99
|
+
raise ArgumentError, 'schema_version cannot be nil' if schema_version.nil?
|
100
|
+
|
101
|
+
if schema_version != :unset
|
102
|
+
return VersionContext.new(@version, @solution[:id], schema_version, )
|
103
|
+
end
|
104
|
+
|
105
|
+
unless @versions
|
106
|
+
@versions = VersionList.new(@version, id: @solution[:id], )
|
107
|
+
end
|
108
|
+
|
109
|
+
@versions
|
110
|
+
end
|
111
|
+
|
112
|
+
##
|
113
|
+
# Provide a user friendly representation
|
114
|
+
def to_s
|
115
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
116
|
+
"#<Twilio.Events.V1.SchemaContext #{context}>"
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# Provide a detailed, user friendly representation
|
121
|
+
def inspect
|
122
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
123
|
+
"#<Twilio.Events.V1.SchemaContext #{context}>"
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
##
|
128
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
129
|
+
class SchemaInstance < InstanceResource
|
130
|
+
##
|
131
|
+
# Initialize the SchemaInstance
|
132
|
+
# @param [Version] version Version that contains the resource
|
133
|
+
# @param [Hash] payload payload that contains response from Twilio
|
134
|
+
# @param [String] id The unique identifier of the schema. Each schema can have
|
135
|
+
# multiple versions, that share the same id.
|
136
|
+
# @return [SchemaInstance] SchemaInstance
|
137
|
+
def initialize(version, payload, id: nil)
|
138
|
+
super(version)
|
139
|
+
|
140
|
+
# Marshaled Properties
|
141
|
+
@properties = {
|
142
|
+
'id' => payload['id'],
|
143
|
+
'url' => payload['url'],
|
144
|
+
'links' => payload['links'],
|
145
|
+
'last_created' => Twilio.deserialize_iso8601_datetime(payload['last_created']),
|
146
|
+
'last_version' => payload['last_version'].to_i,
|
147
|
+
}
|
148
|
+
|
149
|
+
# Context
|
150
|
+
@instance_context = nil
|
151
|
+
@params = {'id' => id || @properties['id'], }
|
152
|
+
end
|
153
|
+
|
154
|
+
##
|
155
|
+
# Generate an instance context for the instance, the context is capable of
|
156
|
+
# performing various actions. All instance actions are proxied to the context
|
157
|
+
# @return [SchemaContext] SchemaContext for this SchemaInstance
|
158
|
+
def context
|
159
|
+
unless @instance_context
|
160
|
+
@instance_context = SchemaContext.new(@version, @params['id'], )
|
161
|
+
end
|
162
|
+
@instance_context
|
163
|
+
end
|
164
|
+
|
165
|
+
##
|
166
|
+
# @return [String] Schema Identifier.
|
167
|
+
def id
|
168
|
+
@properties['id']
|
169
|
+
end
|
170
|
+
|
171
|
+
##
|
172
|
+
# @return [String] The URL of this resource.
|
173
|
+
def url
|
174
|
+
@properties['url']
|
175
|
+
end
|
176
|
+
|
177
|
+
##
|
178
|
+
# @return [String] Nested resource URLs.
|
179
|
+
def links
|
180
|
+
@properties['links']
|
181
|
+
end
|
182
|
+
|
183
|
+
##
|
184
|
+
# @return [Time] The date that the last schema version was created.
|
185
|
+
def last_created
|
186
|
+
@properties['last_created']
|
187
|
+
end
|
188
|
+
|
189
|
+
##
|
190
|
+
# @return [String] Last schema version.
|
191
|
+
def last_version
|
192
|
+
@properties['last_version']
|
193
|
+
end
|
194
|
+
|
195
|
+
##
|
196
|
+
# Fetch the SchemaInstance
|
197
|
+
# @return [SchemaInstance] Fetched SchemaInstance
|
198
|
+
def fetch
|
199
|
+
context.fetch
|
200
|
+
end
|
201
|
+
|
202
|
+
##
|
203
|
+
# Access the versions
|
204
|
+
# @return [versions] versions
|
205
|
+
def versions
|
206
|
+
context.versions
|
207
|
+
end
|
208
|
+
|
209
|
+
##
|
210
|
+
# Provide a user friendly representation
|
211
|
+
def to_s
|
212
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
213
|
+
"<Twilio.Events.V1.SchemaInstance #{values}>"
|
214
|
+
end
|
215
|
+
|
216
|
+
##
|
217
|
+
# Provide a detailed, user friendly representation
|
218
|
+
def inspect
|
219
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
220
|
+
"<Twilio.Events.V1.SchemaInstance #{values}>"
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|