twilio-ruby 5.39.2 → 5.40.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/CHANGES.md +107 -1
  4. data/CONTRIBUTING.md +2 -2
  5. data/ISSUE_TEMPLATE.md +5 -1
  6. data/PULL_REQUEST_TEMPLATE.md +1 -1
  7. data/README.md +4 -3
  8. data/lib/twilio-ruby/framework/version.rb +4 -8
  9. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +6 -4
  10. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +12 -3
  11. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +12 -3
  12. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +12 -3
  13. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +12 -3
  14. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +12 -3
  15. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +12 -3
  16. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +12 -3
  17. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +2 -1
  18. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +85 -60
  19. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -2
  20. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +14 -0
  21. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +14 -0
  22. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +14 -0
  23. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +8 -1
  24. data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +3 -1
  25. data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +2 -1
  26. data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +8 -4
  27. data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +11 -4
  28. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +13 -6
  29. data/lib/twilio-ruby/rest/client.rb +7 -0
  30. data/lib/twilio-ruby/rest/conversations.rb +39 -3
  31. data/lib/twilio-ruby/rest/conversations/v1.rb +68 -5
  32. data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +268 -0
  33. data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +262 -0
  34. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +21 -10
  35. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +13 -10
  36. data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +34 -19
  37. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +48 -32
  38. data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +14 -11
  39. data/lib/twilio-ruby/rest/conversations/v1/credential.rb +427 -0
  40. data/lib/twilio-ruby/rest/conversations/v1/role.rb +374 -0
  41. data/lib/twilio-ruby/rest/conversations/v1/service.rb +442 -0
  42. data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +388 -0
  43. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +271 -0
  44. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +315 -0
  45. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +586 -0
  46. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +549 -0
  47. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +394 -0
  48. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +519 -0
  49. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +457 -0
  50. data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +395 -0
  51. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +419 -0
  52. data/lib/twilio-ruby/rest/conversations/v1/user.rb +398 -0
  53. data/lib/twilio-ruby/rest/events.rb +72 -0
  54. data/lib/twilio-ruby/rest/events/v1.rb +90 -0
  55. data/lib/twilio-ruby/rest/events/v1/event_type.rb +291 -0
  56. data/lib/twilio-ruby/rest/events/v1/schema.rb +226 -0
  57. data/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +290 -0
  58. data/lib/twilio-ruby/rest/events/v1/sink.rb +380 -0
  59. data/lib/twilio-ruby/rest/events/v1/sink/sink_test.rb +115 -0
  60. data/lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb +119 -0
  61. data/lib/twilio-ruby/rest/events/v1/subscription.rb +383 -0
  62. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +216 -0
  63. data/lib/twilio-ruby/rest/fax/v1/fax.rb +2 -1
  64. data/lib/twilio-ruby/rest/messaging.rb +6 -0
  65. data/lib/twilio-ruby/rest/messaging/v1.rb +7 -0
  66. data/lib/twilio-ruby/rest/messaging/v1/deactivation.rb +164 -0
  67. data/lib/twilio-ruby/rest/messaging/v1/service.rb +6 -3
  68. data/lib/twilio-ruby/rest/notify/v1/credential.rb +12 -6
  69. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +10 -2
  70. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +3 -3
  71. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb +16 -2
  72. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +18 -4
  73. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +10 -5
  74. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +6 -3
  75. data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb +1 -4
  76. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +3 -1
  77. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +45 -4
  78. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +14 -1
  79. data/lib/twilio-ruby/rest/serverless/v1/service.rb +13 -13
  80. data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +6 -6
  81. data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +5 -5
  82. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +8 -8
  83. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +6 -8
  84. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +8 -8
  85. data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +14 -14
  86. data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
  87. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +7 -7
  88. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +1 -1
  89. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +12 -11
  90. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +17 -7
  91. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +75 -9
  92. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +2 -1
  93. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +6 -2
  94. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +1 -4
  95. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +6 -2
  96. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +38 -23
  97. data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +2 -1
  98. data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +2 -1
  99. data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +201 -0
  100. data/lib/twilio-ruby/rest/verify/v2/service.rb +21 -9
  101. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +10 -2
  102. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +7 -2
  103. data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -3
  104. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +18 -9
  105. data/lib/twilio-ruby/rest/video/v1/room.rb +2 -1
  106. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +0 -6
  107. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +1 -4
  108. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +2 -1
  109. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +5 -19
  110. data/lib/twilio-ruby/version.rb +1 -1
  111. data/spec/framework/version_spec.rb +53 -0
  112. data/spec/holodeck/holodeck.rb +3 -3
  113. data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +35 -36
  114. data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +39 -40
  115. data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +35 -36
  116. data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +25 -23
  117. data/spec/integration/api/v2010/account/message_spec.rb +37 -0
  118. data/spec/integration/bulkexports/v1/export/day_spec.rb +5 -5
  119. data/spec/integration/bulkexports/v1/export_configuration_spec.rb +4 -4
  120. data/spec/integration/bulkexports/v1/export_spec.rb +3 -3
  121. data/spec/integration/conversations/v1/{webhook_spec.rb → configuration/webhook_spec.rb} +12 -8
  122. data/spec/integration/conversations/v1/configuration_spec.rb +87 -0
  123. data/spec/integration/conversations/v1/conversation/message/delivery_receipt_spec.rb +4 -0
  124. data/spec/integration/conversations/v1/conversation/message_spec.rb +38 -0
  125. data/spec/integration/conversations/v1/conversation/participant_spec.rb +60 -4
  126. data/spec/integration/conversations/v1/conversation_spec.rb +35 -0
  127. data/spec/integration/conversations/v1/credential_spec.rb +219 -0
  128. data/spec/integration/conversations/v1/role_spec.rb +249 -0
  129. data/spec/integration/conversations/v1/service/binding_spec.rb +166 -0
  130. data/spec/integration/conversations/v1/service/configuration/notification_spec.rb +115 -0
  131. data/spec/integration/conversations/v1/service/configuration_spec.rb +87 -0
  132. data/spec/integration/conversations/v1/service/conversation/message/delivery_receipt_spec.rb +144 -0
  133. data/spec/integration/conversations/v1/service/conversation/message_spec.rb +429 -0
  134. data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +407 -0
  135. data/spec/integration/conversations/v1/service/conversation/webhook_spec.rb +299 -0
  136. data/spec/integration/conversations/v1/service/conversation_spec.rb +289 -0
  137. data/spec/integration/conversations/v1/service/role_spec.rb +260 -0
  138. data/spec/integration/conversations/v1/service/user_spec.rb +230 -0
  139. data/spec/integration/conversations/v1/service_spec.rb +174 -0
  140. data/spec/integration/conversations/v1/user_spec.rb +220 -0
  141. data/spec/integration/events/v1/event_type_spec.rb +133 -0
  142. data/spec/integration/events/v1/schema/schema_version_spec.rb +126 -0
  143. data/spec/integration/events/v1/schema_spec.rb +46 -0
  144. data/spec/integration/events/v1/sink/sink_test_spec.rb +42 -0
  145. data/spec/integration/events/v1/sink/sink_validate_spec.rb +44 -0
  146. data/spec/integration/events/v1/sink_spec.rb +217 -0
  147. data/spec/integration/events/v1/subscription/subscribed_event_spec.rb +91 -0
  148. data/spec/integration/events/v1/subscription_spec.rb +243 -0
  149. data/spec/integration/messaging/v1/deactivation_spec.rb +40 -0
  150. data/spec/integration/numbers/v2/regulatory_compliance/end_user_spec.rb +27 -0
  151. data/spec/integration/numbers/v2/regulatory_compliance/supporting_document_spec.rb +27 -0
  152. data/spec/integration/studio/v1/flow/execution/execution_step_spec.rb +1 -0
  153. data/spec/integration/studio/v2/flow/execution/execution_step_spec.rb +1 -0
  154. data/spec/integration/supersim/v1/sim_spec.rb +23 -0
  155. data/spec/integration/supersim/v1/usage_record_spec.rb +463 -18
  156. data/spec/integration/trunking/v1/trunk/recording_spec.rb +79 -0
  157. data/spec/integration/trunking/v1/trunk_spec.rb +4 -0
  158. data/spec/integration/verify/v2/service/access_token_spec.rb +1 -1
  159. data/spec/integration/verify/v2/service/entity/challenge_spec.rb +8 -8
  160. data/spec/integration/video/v1/room_spec.rb +37 -0
  161. data/spec/integration/wireless/v1/sim/data_session_spec.rb +2 -2
  162. data/spec/spec_helper.rb +1 -1
  163. metadata +82 -5
  164. data/lib/twilio-ruby/rest/conversations/v1/webhook.rb +0 -262
@@ -17,8 +17,9 @@ module Twilio
17
17
  ##
18
18
  # Initialize the ParticipantList
19
19
  # @param [Version] version Version that contains the resource
20
- # @param [String] conversation_sid The unique id of the
21
- # [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this participant.
20
+ # @param [String] conversation_sid The unique ID of the
21
+ # [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
22
+ # for this participant.
22
23
  # @return [ParticipantList] ParticipantList
23
24
  def initialize(version, conversation_sid: nil)
24
25
  super(version)
@@ -31,18 +32,19 @@ module Twilio
31
32
  ##
32
33
  # Create the ParticipantInstance
33
34
  # @param [String] identity A unique string identifier for the conversation
34
- # participant as [Chat User](https://www.twilio.com/docs/chat/rest/user-resource).
35
- # This parameter is non-null if (and only if) the participant is using the
36
- # Programmable Chat SDK to communicate. Limited to 256 characters.
35
+ # participant as [Conversation
36
+ # User](https://www.twilio.com/docs/conversations/api/user-resource). This
37
+ # parameter is non-null if (and only if) the participant is using the
38
+ # Conversations SDK to communicate. Limited to 256 characters.
37
39
  # @param [String] messaging_binding_address The address of the participant's
38
- # device, e.g. a phone number or Messenger ID. Together with the Proxy address,
39
- # this determines a participant uniquely. This field (with proxy_address) is only
40
- # null when the participant is interacting from a Chat endpoint (see the
41
- # 'identity' field).
40
+ # device, e.g. a phone or WhatsApp number. Together with the Proxy address, this
41
+ # determines a participant uniquely. This field (with proxy_address) is only null
42
+ # when the participant is interacting from an SDK endpoint (see the 'identity'
43
+ # field).
42
44
  # @param [String] messaging_binding_proxy_address The address of the Twilio phone
43
- # number (or WhatsApp number, or Messenger Page ID) that the participant is in
44
- # contact with. This field, together with participant address, is only null when
45
- # the participant is interacting from a Chat endpoint (see the 'identity' field).
45
+ # number (or WhatsApp number) that the participant is in contact with. This field,
46
+ # together with participant address, is only null when the participant is
47
+ # interacting from an SDK endpoint (see the 'identity' field).
46
48
  # @param [Time] date_created The date that this resource was created.
47
49
  # @param [Time] date_updated The date that this resource was last updated.
48
50
  # @param [String] attributes An optional string metadata field you can use to
@@ -50,11 +52,11 @@ module Twilio
50
52
  # if specified. **Note** that if the attributes are not set "{}" will be
51
53
  # returned.
52
54
  # @param [String] messaging_binding_projected_address The address of the Twilio
53
- # phone number that is used in Group MMS. Communication mask for the Chat
55
+ # phone number that is used in Group MMS. Communication mask for the Conversation
54
56
  # participant with Identity.
55
- # @param [String] role_sid The SID of the
56
- # [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the
57
- # participant.
57
+ # @param [String] role_sid The SID of a conversation-level
58
+ # [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to
59
+ # the participant.
58
60
  # @param [participant.WebhookEnabledType] x_twilio_webhook_enabled The
59
61
  # X-Twilio-Webhook-Enabled HTTP request header
60
62
  # @return [ParticipantInstance] Created ParticipantInstance
@@ -200,8 +202,9 @@ module Twilio
200
202
  ##
201
203
  # Initialize the ParticipantContext
202
204
  # @param [Version] version Version that contains the resource
203
- # @param [String] conversation_sid The unique id of the
204
- # [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this participant.
205
+ # @param [String] conversation_sid The unique ID of the
206
+ # [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
207
+ # for this participant.
205
208
  # @param [String] sid A 34 character string that uniquely identifies this
206
209
  # resource.
207
210
  # @return [ParticipantContext] ParticipantContext
@@ -221,17 +224,22 @@ module Twilio
221
224
  # store any data you wish. The string value must contain structurally valid JSON
222
225
  # if specified. **Note** that if the attributes are not set "{}" will be
223
226
  # returned.
224
- # @param [String] role_sid The SID of the
225
- # [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the
226
- # participant.
227
+ # @param [String] role_sid The SID of a conversation-level
228
+ # [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to
229
+ # the participant.
227
230
  # @param [String] messaging_binding_proxy_address The address of the Twilio phone
228
231
  # number that the participant is in contact with. 'null' value will remove it.
229
232
  # @param [String] messaging_binding_projected_address The address of the Twilio
230
233
  # phone number that is used in Group MMS. 'null' value will remove it.
234
+ # @param [String] identity A unique string identifier for the conversation
235
+ # participant as [Conversation
236
+ # User](https://www.twilio.com/docs/conversations/api/user-resource). This
237
+ # parameter is non-null if (and only if) the participant is using the
238
+ # Conversations SDK to communicate. Limited to 256 characters.
231
239
  # @param [participant.WebhookEnabledType] x_twilio_webhook_enabled The
232
240
  # X-Twilio-Webhook-Enabled HTTP request header
233
241
  # @return [ParticipantInstance] Updated ParticipantInstance
234
- def update(date_created: :unset, date_updated: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, x_twilio_webhook_enabled: :unset)
242
+ def update(date_created: :unset, date_updated: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, identity: :unset, x_twilio_webhook_enabled: :unset)
235
243
  data = Twilio::Values.of({
236
244
  'DateCreated' => Twilio.serialize_iso8601_datetime(date_created),
237
245
  'DateUpdated' => Twilio.serialize_iso8601_datetime(date_updated),
@@ -239,6 +247,7 @@ module Twilio
239
247
  'RoleSid' => role_sid,
240
248
  'MessagingBinding.ProxyAddress' => messaging_binding_proxy_address,
241
249
  'MessagingBinding.ProjectedAddress' => messaging_binding_projected_address,
250
+ 'Identity' => identity,
242
251
  })
243
252
  headers = Twilio::Values.of({'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, })
244
253
 
@@ -299,8 +308,9 @@ module Twilio
299
308
  # Initialize the ParticipantInstance
300
309
  # @param [Version] version Version that contains the resource
301
310
  # @param [Hash] payload payload that contains response from Twilio
302
- # @param [String] conversation_sid The unique id of the
303
- # [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this participant.
311
+ # @param [String] conversation_sid The unique ID of the
312
+ # [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
313
+ # for this participant.
304
314
  # @param [String] sid A 34 character string that uniquely identifies this
305
315
  # resource.
306
316
  # @return [ParticipantInstance] ParticipantInstance
@@ -338,13 +348,13 @@ module Twilio
338
348
  end
339
349
 
340
350
  ##
341
- # @return [String] The unique id of the Account responsible for this participant.
351
+ # @return [String] The unique ID of the Account responsible for this participant.
342
352
  def account_sid
343
353
  @properties['account_sid']
344
354
  end
345
355
 
346
356
  ##
347
- # @return [String] The unique id of the Conversation for this participant.
357
+ # @return [String] The unique ID of the Conversation for this participant.
348
358
  def conversation_sid
349
359
  @properties['conversation_sid']
350
360
  end
@@ -356,7 +366,7 @@ module Twilio
356
366
  end
357
367
 
358
368
  ##
359
- # @return [String] A unique string identifier for the conversation participant as Chat User.
369
+ # @return [String] A unique string identifier for the conversation participant as Conversation User.
360
370
  def identity
361
371
  @properties['identity']
362
372
  end
@@ -374,7 +384,7 @@ module Twilio
374
384
  end
375
385
 
376
386
  ##
377
- # @return [String] The SID of the Role to assign to the participant
387
+ # @return [String] The SID of a conversation-level Role to assign to the participant
378
388
  def role_sid
379
389
  @properties['role_sid']
380
390
  end
@@ -405,17 +415,22 @@ module Twilio
405
415
  # store any data you wish. The string value must contain structurally valid JSON
406
416
  # if specified. **Note** that if the attributes are not set "{}" will be
407
417
  # returned.
408
- # @param [String] role_sid The SID of the
409
- # [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the
410
- # participant.
418
+ # @param [String] role_sid The SID of a conversation-level
419
+ # [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to
420
+ # the participant.
411
421
  # @param [String] messaging_binding_proxy_address The address of the Twilio phone
412
422
  # number that the participant is in contact with. 'null' value will remove it.
413
423
  # @param [String] messaging_binding_projected_address The address of the Twilio
414
424
  # phone number that is used in Group MMS. 'null' value will remove it.
425
+ # @param [String] identity A unique string identifier for the conversation
426
+ # participant as [Conversation
427
+ # User](https://www.twilio.com/docs/conversations/api/user-resource). This
428
+ # parameter is non-null if (and only if) the participant is using the
429
+ # Conversations SDK to communicate. Limited to 256 characters.
415
430
  # @param [participant.WebhookEnabledType] x_twilio_webhook_enabled The
416
431
  # X-Twilio-Webhook-Enabled HTTP request header
417
432
  # @return [ParticipantInstance] Updated ParticipantInstance
418
- def update(date_created: :unset, date_updated: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, x_twilio_webhook_enabled: :unset)
433
+ def update(date_created: :unset, date_updated: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, identity: :unset, x_twilio_webhook_enabled: :unset)
419
434
  context.update(
420
435
  date_created: date_created,
421
436
  date_updated: date_updated,
@@ -423,6 +438,7 @@ module Twilio
423
438
  role_sid: role_sid,
424
439
  messaging_binding_proxy_address: messaging_binding_proxy_address,
425
440
  messaging_binding_projected_address: messaging_binding_projected_address,
441
+ identity: identity,
426
442
  x_twilio_webhook_enabled: x_twilio_webhook_enabled,
427
443
  )
428
444
  end
@@ -17,8 +17,9 @@ module Twilio
17
17
  ##
18
18
  # Initialize the WebhookList
19
19
  # @param [Version] version Version that contains the resource
20
- # @param [String] conversation_sid The unique id of the
21
- # [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this webhook.
20
+ # @param [String] conversation_sid The unique ID of the
21
+ # [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
22
+ # for this webhook.
22
23
  # @return [WebhookList] WebhookList
23
24
  def initialize(version, conversation_sid: nil)
24
25
  super(version)
@@ -120,7 +121,7 @@ module Twilio
120
121
  # for this Conversation.
121
122
  # @param [String] configuration_triggers The list of keywords, firing webhook
122
123
  # event for this Conversation.
123
- # @param [String] configuration_flow_sid The studio flow sid, where the webhook
124
+ # @param [String] configuration_flow_sid The studio flow SID, where the webhook
124
125
  # should be sent to.
125
126
  # @param [String] configuration_replay_after The message index for which and it's
126
127
  # successors the webhook will be replayed. Not set by default
@@ -185,8 +186,9 @@ module Twilio
185
186
  ##
186
187
  # Initialize the WebhookContext
187
188
  # @param [Version] version Version that contains the resource
188
- # @param [String] conversation_sid The unique id of the
189
- # [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this webhook.
189
+ # @param [String] conversation_sid The unique ID of the
190
+ # [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
191
+ # for this webhook.
190
192
  # @param [String] sid A 34 character string that uniquely identifies this
191
193
  # resource.
192
194
  # @return [WebhookContext] WebhookContext
@@ -222,7 +224,7 @@ module Twilio
222
224
  # for this Conversation.
223
225
  # @param [String] configuration_triggers The list of keywords, firing webhook
224
226
  # event for this Conversation.
225
- # @param [String] configuration_flow_sid The studio flow sid, where the webhook
227
+ # @param [String] configuration_flow_sid The studio flow SID, where the webhook
226
228
  # should be sent to.
227
229
  # @return [WebhookInstance] Updated WebhookInstance
228
230
  def update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset)
@@ -273,8 +275,9 @@ module Twilio
273
275
  # Initialize the WebhookInstance
274
276
  # @param [Version] version Version that contains the resource
275
277
  # @param [Hash] payload payload that contains response from Twilio
276
- # @param [String] conversation_sid The unique id of the
277
- # [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this webhook.
278
+ # @param [String] conversation_sid The unique ID of the
279
+ # [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource)
280
+ # for this webhook.
278
281
  # @param [String] sid A 34 character string that uniquely identifies this
279
282
  # resource.
280
283
  # @return [WebhookInstance] WebhookInstance
@@ -316,13 +319,13 @@ module Twilio
316
319
  end
317
320
 
318
321
  ##
319
- # @return [String] The unique id of the Account responsible for this conversation.
322
+ # @return [String] The unique ID of the Account responsible for this conversation.
320
323
  def account_sid
321
324
  @properties['account_sid']
322
325
  end
323
326
 
324
327
  ##
325
- # @return [String] The unique id of the Conversation for this webhook.
328
+ # @return [String] The unique ID of the Conversation for this webhook.
326
329
  def conversation_sid
327
330
  @properties['conversation_sid']
328
331
  end
@@ -374,7 +377,7 @@ module Twilio
374
377
  # for this Conversation.
375
378
  # @param [String] configuration_triggers The list of keywords, firing webhook
376
379
  # event for this Conversation.
377
- # @param [String] configuration_flow_sid The studio flow sid, where the webhook
380
+ # @param [String] configuration_flow_sid The studio flow SID, where the webhook
378
381
  # should be sent to.
379
382
  # @return [WebhookInstance] Updated WebhookInstance
380
383
  def update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset)
@@ -0,0 +1,427 @@
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 Conversations < Domain
12
+ class V1 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
15
+ class CredentialList < ListResource
16
+ ##
17
+ # Initialize the CredentialList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [CredentialList] CredentialList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ @uri = "/Credentials"
26
+ end
27
+
28
+ ##
29
+ # Create the CredentialInstance
30
+ # @param [credential.PushType] type The type of push-notification service the
31
+ # credential is for. Can be: `fcm`, `gcm`, or `apn`.
32
+ # @param [String] friendly_name A descriptive string that you create to describe
33
+ # the new resource. It can be up to 64 characters long.
34
+ # @param [String] certificate [APN only] The URL encoded representation of the
35
+ # certificate. For example,
36
+ # `-----BEGIN CERTIFICATE-----
37
+ # MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A==
38
+ # -----END CERTIFICATE-----`.
39
+ # @param [String] private_key [APN only] The URL encoded representation of the
40
+ # private key. For example,
41
+ # `-----BEGIN RSA PRIVATE KEY-----
42
+ # MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG...
43
+ # -----END RSA PRIVATE KEY-----`.
44
+ # @param [Boolean] sandbox [APN only] Whether to send the credential to sandbox
45
+ # APNs. Can be `true` to send to sandbox APNs or `false` to send to production.
46
+ # @param [String] api_key [GCM only] The API key for the project that was obtained
47
+ # from the Google Developer console for your GCM Service application credential.
48
+ # @param [String] secret [FCM only] The **Server key** of your project from the
49
+ # Firebase console, found under Settings / Cloud messaging.
50
+ # @return [CredentialInstance] Created CredentialInstance
51
+ def create(type: nil, friendly_name: :unset, certificate: :unset, private_key: :unset, sandbox: :unset, api_key: :unset, secret: :unset)
52
+ data = Twilio::Values.of({
53
+ 'Type' => type,
54
+ 'FriendlyName' => friendly_name,
55
+ 'Certificate' => certificate,
56
+ 'PrivateKey' => private_key,
57
+ 'Sandbox' => sandbox,
58
+ 'ApiKey' => api_key,
59
+ 'Secret' => secret,
60
+ })
61
+
62
+ payload = @version.create('POST', @uri, data: data)
63
+
64
+ CredentialInstance.new(@version, payload, )
65
+ end
66
+
67
+ ##
68
+ # Lists CredentialInstance records from the API as a list.
69
+ # Unlike stream(), this operation is eager and will load `limit` records into
70
+ # memory before returning.
71
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
72
+ # guarantees to never return more than limit. Default is no limit
73
+ # @param [Integer] page_size Number of records to fetch per request, when
74
+ # not set will use the default value of 50 records. If no page_size is defined
75
+ # but a limit is defined, stream() will attempt to read the limit with the most
76
+ # efficient page size, i.e. min(limit, 1000)
77
+ # @return [Array] Array of up to limit results
78
+ def list(limit: nil, page_size: nil)
79
+ self.stream(limit: limit, page_size: page_size).entries
80
+ end
81
+
82
+ ##
83
+ # Streams CredentialInstance records from the API as an Enumerable.
84
+ # This operation lazily loads records as efficiently as possible until the limit
85
+ # is reached.
86
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
87
+ # guarantees to never return more than limit. Default is no limit.
88
+ # @param [Integer] page_size Number of records to fetch per request, when
89
+ # not set will use the default value of 50 records. If no page_size is defined
90
+ # but a limit is defined, stream() will attempt to read the limit with the most
91
+ # efficient page size, i.e. min(limit, 1000)
92
+ # @return [Enumerable] Enumerable that will yield up to limit results
93
+ def stream(limit: nil, page_size: nil)
94
+ limits = @version.read_limits(limit, page_size)
95
+
96
+ page = self.page(page_size: limits[:page_size], )
97
+
98
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
99
+ end
100
+
101
+ ##
102
+ # When passed a block, yields CredentialInstance records from the API.
103
+ # This operation lazily loads records as efficiently as possible until the limit
104
+ # is reached.
105
+ def each
106
+ limits = @version.read_limits
107
+
108
+ page = self.page(page_size: limits[:page_size], )
109
+
110
+ @version.stream(page,
111
+ limit: limits[:limit],
112
+ page_limit: limits[:page_limit]).each {|x| yield x}
113
+ end
114
+
115
+ ##
116
+ # Retrieve a single page of CredentialInstance records from the API.
117
+ # Request is executed immediately.
118
+ # @param [String] page_token PageToken provided by the API
119
+ # @param [Integer] page_number Page Number, this value is simply for client state
120
+ # @param [Integer] page_size Number of records to return, defaults to 50
121
+ # @return [Page] Page of CredentialInstance
122
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
123
+ params = Twilio::Values.of({
124
+ 'PageToken' => page_token,
125
+ 'Page' => page_number,
126
+ 'PageSize' => page_size,
127
+ })
128
+
129
+ response = @version.page('GET', @uri, params: params)
130
+
131
+ CredentialPage.new(@version, response, @solution)
132
+ end
133
+
134
+ ##
135
+ # Retrieve a single page of CredentialInstance records from the API.
136
+ # Request is executed immediately.
137
+ # @param [String] target_url API-generated URL for the requested results page
138
+ # @return [Page] Page of CredentialInstance
139
+ def get_page(target_url)
140
+ response = @version.domain.request(
141
+ 'GET',
142
+ target_url
143
+ )
144
+ CredentialPage.new(@version, response, @solution)
145
+ end
146
+
147
+ ##
148
+ # Provide a user friendly representation
149
+ def to_s
150
+ '#<Twilio.Conversations.V1.CredentialList>'
151
+ end
152
+ end
153
+
154
+ ##
155
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
156
+ class CredentialPage < Page
157
+ ##
158
+ # Initialize the CredentialPage
159
+ # @param [Version] version Version that contains the resource
160
+ # @param [Response] response Response from the API
161
+ # @param [Hash] solution Path solution for the resource
162
+ # @return [CredentialPage] CredentialPage
163
+ def initialize(version, response, solution)
164
+ super(version, response)
165
+
166
+ # Path Solution
167
+ @solution = solution
168
+ end
169
+
170
+ ##
171
+ # Build an instance of CredentialInstance
172
+ # @param [Hash] payload Payload response from the API
173
+ # @return [CredentialInstance] CredentialInstance
174
+ def get_instance(payload)
175
+ CredentialInstance.new(@version, payload, )
176
+ end
177
+
178
+ ##
179
+ # Provide a user friendly representation
180
+ def to_s
181
+ '<Twilio.Conversations.V1.CredentialPage>'
182
+ end
183
+ end
184
+
185
+ ##
186
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
187
+ class CredentialContext < InstanceContext
188
+ ##
189
+ # Initialize the CredentialContext
190
+ # @param [Version] version Version that contains the resource
191
+ # @param [String] sid A 34 character string that uniquely identifies this
192
+ # resource.
193
+ # @return [CredentialContext] CredentialContext
194
+ def initialize(version, sid)
195
+ super(version)
196
+
197
+ # Path Solution
198
+ @solution = {sid: sid, }
199
+ @uri = "/Credentials/#{@solution[:sid]}"
200
+ end
201
+
202
+ ##
203
+ # Update the CredentialInstance
204
+ # @param [credential.PushType] type The type of push-notification service the
205
+ # credential is for. Can be: `fcm`, `gcm`, or `apn`.
206
+ # @param [String] friendly_name A descriptive string that you create to describe
207
+ # the new resource. It can be up to 64 characters long.
208
+ # @param [String] certificate [APN only] The URL encoded representation of the
209
+ # certificate. For example,
210
+ # `-----BEGIN CERTIFICATE-----
211
+ # MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A==
212
+ # -----END CERTIFICATE-----`.
213
+ # @param [String] private_key [APN only] The URL encoded representation of the
214
+ # private key. For example,
215
+ # `-----BEGIN RSA PRIVATE KEY-----
216
+ # MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG...
217
+ # -----END RSA PRIVATE KEY-----`.
218
+ # @param [Boolean] sandbox [APN only] Whether to send the credential to sandbox
219
+ # APNs. Can be `true` to send to sandbox APNs or `false` to send to production.
220
+ # @param [String] api_key [GCM only] The API key for the project that was obtained
221
+ # from the Google Developer console for your GCM Service application credential.
222
+ # @param [String] secret [FCM only] The **Server key** of your project from the
223
+ # Firebase console, found under Settings / Cloud messaging.
224
+ # @return [CredentialInstance] Updated CredentialInstance
225
+ def update(type: :unset, friendly_name: :unset, certificate: :unset, private_key: :unset, sandbox: :unset, api_key: :unset, secret: :unset)
226
+ data = Twilio::Values.of({
227
+ 'Type' => type,
228
+ 'FriendlyName' => friendly_name,
229
+ 'Certificate' => certificate,
230
+ 'PrivateKey' => private_key,
231
+ 'Sandbox' => sandbox,
232
+ 'ApiKey' => api_key,
233
+ 'Secret' => secret,
234
+ })
235
+
236
+ payload = @version.update('POST', @uri, data: data)
237
+
238
+ CredentialInstance.new(@version, payload, sid: @solution[:sid], )
239
+ end
240
+
241
+ ##
242
+ # Delete the CredentialInstance
243
+ # @return [Boolean] true if delete succeeds, false otherwise
244
+ def delete
245
+ @version.delete('DELETE', @uri)
246
+ end
247
+
248
+ ##
249
+ # Fetch the CredentialInstance
250
+ # @return [CredentialInstance] Fetched CredentialInstance
251
+ def fetch
252
+ payload = @version.fetch('GET', @uri)
253
+
254
+ CredentialInstance.new(@version, payload, sid: @solution[:sid], )
255
+ end
256
+
257
+ ##
258
+ # Provide a user friendly representation
259
+ def to_s
260
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
261
+ "#<Twilio.Conversations.V1.CredentialContext #{context}>"
262
+ end
263
+
264
+ ##
265
+ # Provide a detailed, user friendly representation
266
+ def inspect
267
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
268
+ "#<Twilio.Conversations.V1.CredentialContext #{context}>"
269
+ end
270
+ end
271
+
272
+ ##
273
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
274
+ class CredentialInstance < InstanceResource
275
+ ##
276
+ # Initialize the CredentialInstance
277
+ # @param [Version] version Version that contains the resource
278
+ # @param [Hash] payload payload that contains response from Twilio
279
+ # @param [String] sid A 34 character string that uniquely identifies this
280
+ # resource.
281
+ # @return [CredentialInstance] CredentialInstance
282
+ def initialize(version, payload, sid: nil)
283
+ super(version)
284
+
285
+ # Marshaled Properties
286
+ @properties = {
287
+ 'sid' => payload['sid'],
288
+ 'account_sid' => payload['account_sid'],
289
+ 'friendly_name' => payload['friendly_name'],
290
+ 'type' => payload['type'],
291
+ 'sandbox' => payload['sandbox'],
292
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
293
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
294
+ 'url' => payload['url'],
295
+ }
296
+
297
+ # Context
298
+ @instance_context = nil
299
+ @params = {'sid' => sid || @properties['sid'], }
300
+ end
301
+
302
+ ##
303
+ # Generate an instance context for the instance, the context is capable of
304
+ # performing various actions. All instance actions are proxied to the context
305
+ # @return [CredentialContext] CredentialContext for this CredentialInstance
306
+ def context
307
+ unless @instance_context
308
+ @instance_context = CredentialContext.new(@version, @params['sid'], )
309
+ end
310
+ @instance_context
311
+ end
312
+
313
+ ##
314
+ # @return [String] A 34 character string that uniquely identifies this resource.
315
+ def sid
316
+ @properties['sid']
317
+ end
318
+
319
+ ##
320
+ # @return [String] The unique ID of the Account responsible for this credential.
321
+ def account_sid
322
+ @properties['account_sid']
323
+ end
324
+
325
+ ##
326
+ # @return [String] The human-readable name of this credential.
327
+ def friendly_name
328
+ @properties['friendly_name']
329
+ end
330
+
331
+ ##
332
+ # @return [credential.PushType] The type of push-notification service the credential is for.
333
+ def type
334
+ @properties['type']
335
+ end
336
+
337
+ ##
338
+ # @return [String] [APN only] Whether to send the credential to sandbox APNs.
339
+ def sandbox
340
+ @properties['sandbox']
341
+ end
342
+
343
+ ##
344
+ # @return [Time] The date that this resource was created.
345
+ def date_created
346
+ @properties['date_created']
347
+ end
348
+
349
+ ##
350
+ # @return [Time] The date that this resource was last updated.
351
+ def date_updated
352
+ @properties['date_updated']
353
+ end
354
+
355
+ ##
356
+ # @return [String] An absolute URL for this credential.
357
+ def url
358
+ @properties['url']
359
+ end
360
+
361
+ ##
362
+ # Update the CredentialInstance
363
+ # @param [credential.PushType] type The type of push-notification service the
364
+ # credential is for. Can be: `fcm`, `gcm`, or `apn`.
365
+ # @param [String] friendly_name A descriptive string that you create to describe
366
+ # the new resource. It can be up to 64 characters long.
367
+ # @param [String] certificate [APN only] The URL encoded representation of the
368
+ # certificate. For example,
369
+ # `-----BEGIN CERTIFICATE-----
370
+ # MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A==
371
+ # -----END CERTIFICATE-----`.
372
+ # @param [String] private_key [APN only] The URL encoded representation of the
373
+ # private key. For example,
374
+ # `-----BEGIN RSA PRIVATE KEY-----
375
+ # MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG...
376
+ # -----END RSA PRIVATE KEY-----`.
377
+ # @param [Boolean] sandbox [APN only] Whether to send the credential to sandbox
378
+ # APNs. Can be `true` to send to sandbox APNs or `false` to send to production.
379
+ # @param [String] api_key [GCM only] The API key for the project that was obtained
380
+ # from the Google Developer console for your GCM Service application credential.
381
+ # @param [String] secret [FCM only] The **Server key** of your project from the
382
+ # Firebase console, found under Settings / Cloud messaging.
383
+ # @return [CredentialInstance] Updated CredentialInstance
384
+ def update(type: :unset, friendly_name: :unset, certificate: :unset, private_key: :unset, sandbox: :unset, api_key: :unset, secret: :unset)
385
+ context.update(
386
+ type: type,
387
+ friendly_name: friendly_name,
388
+ certificate: certificate,
389
+ private_key: private_key,
390
+ sandbox: sandbox,
391
+ api_key: api_key,
392
+ secret: secret,
393
+ )
394
+ end
395
+
396
+ ##
397
+ # Delete the CredentialInstance
398
+ # @return [Boolean] true if delete succeeds, false otherwise
399
+ def delete
400
+ context.delete
401
+ end
402
+
403
+ ##
404
+ # Fetch the CredentialInstance
405
+ # @return [CredentialInstance] Fetched CredentialInstance
406
+ def fetch
407
+ context.fetch
408
+ end
409
+
410
+ ##
411
+ # Provide a user friendly representation
412
+ def to_s
413
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
414
+ "<Twilio.Conversations.V1.CredentialInstance #{values}>"
415
+ end
416
+
417
+ ##
418
+ # Provide a detailed, user friendly representation
419
+ def inspect
420
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
421
+ "<Twilio.Conversations.V1.CredentialInstance #{values}>"
422
+ end
423
+ end
424
+ end
425
+ end
426
+ end
427
+ end