twilio-ruby 5.52.0 → 5.67.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/pr-lint.yml +15 -0
  3. data/.github/workflows/test-and-deploy.yml +129 -0
  4. data/.gitignore +5 -1
  5. data/.rubocop.yml +1 -1
  6. data/.rubocop_todo.yml +91 -28
  7. data/CHANGES.md +563 -0
  8. data/Gemfile +1 -0
  9. data/Makefile +8 -11
  10. data/README.md +13 -6
  11. data/examples/examples.rb +1 -1
  12. data/lib/rack/twilio_webhook_authentication.rb +25 -1
  13. data/lib/twilio-ruby/http/http_client.rb +20 -4
  14. data/lib/twilio-ruby/http.rb +5 -0
  15. data/lib/twilio-ruby/jwt/access_token.rb +13 -0
  16. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +23 -23
  17. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
  18. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +8 -8
  19. data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +674 -0
  20. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +674 -0
  21. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +68 -14
  22. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +12 -8
  23. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
  24. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +11 -4
  25. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +11 -4
  26. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +11 -4
  27. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +17 -10
  28. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +18 -5
  29. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +34 -7
  30. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
  31. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
  32. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +0 -8
  33. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +0 -6
  34. data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +0 -8
  35. data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +0 -8
  36. data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +0 -8
  37. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +10 -4
  38. data/lib/twilio-ruby/rest/chat/v3/channel.rb +275 -0
  39. data/lib/twilio-ruby/rest/chat/v3.rb +48 -0
  40. data/lib/twilio-ruby/rest/chat.rb +16 -0
  41. data/lib/twilio-ruby/rest/client.rb +21 -12
  42. data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +454 -0
  43. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +12 -5
  44. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +7 -0
  45. data/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb +312 -0
  46. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +18 -2
  47. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +269 -0
  48. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +8 -0
  49. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +12 -5
  50. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +7 -0
  51. data/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb +324 -0
  52. data/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +466 -0
  53. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +44 -0
  54. data/lib/twilio-ruby/rest/conversations/v1/service.rb +23 -0
  55. data/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +442 -0
  56. data/lib/twilio-ruby/rest/conversations/v1/user.rb +35 -0
  57. data/lib/twilio-ruby/rest/conversations/v1.rb +24 -0
  58. data/lib/twilio-ruby/rest/conversations.rb +15 -0
  59. data/lib/twilio-ruby/rest/events/v1/event_type.rb +12 -5
  60. data/lib/twilio-ruby/rest/events/v1/sink.rb +41 -5
  61. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +28 -0
  62. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +55 -34
  63. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb +236 -0
  64. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +330 -0
  65. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +384 -0
  66. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +233 -0
  67. data/lib/twilio-ruby/rest/flex_api/v1.rb +16 -0
  68. data/lib/twilio-ruby/rest/flex_api.rb +9 -0
  69. data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +258 -0
  70. data/lib/twilio-ruby/rest/{fax → frontline_api}/v1.rb +11 -11
  71. data/lib/twilio-ruby/rest/{fax.rb → frontline_api.rb} +11 -11
  72. data/lib/twilio-ruby/rest/insights/v1/annotation.rb +271 -0
  73. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +434 -0
  74. data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +474 -0
  75. data/lib/twilio-ruby/rest/insights/v1/conference.rb +512 -0
  76. data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
  77. data/lib/twilio-ruby/rest/insights/v1.rb +46 -0
  78. data/lib/twilio-ruby/rest/insights.rb +28 -0
  79. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +268 -0
  80. data/lib/twilio-ruby/rest/lookups/v2.rb +45 -0
  81. data/lib/twilio-ruby/rest/lookups.rb +7 -0
  82. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +397 -0
  83. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +406 -0
  84. data/lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb +221 -0
  85. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +403 -0
  86. data/lib/twilio-ruby/rest/media/v1.rb +76 -0
  87. data/lib/twilio-ruby/rest/media.rb +65 -0
  88. data/lib/twilio-ruby/rest/{fax/v1/fax/fax_media.rb → messaging/v1/brand_registration/brand_vetting.rb} +134 -95
  89. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +127 -2
  90. data/lib/twilio-ruby/rest/messaging/v1/external_campaign.rb +7 -0
  91. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +187 -20
  92. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +6 -2
  93. data/lib/twilio-ruby/rest/messaging/v1/service.rb +37 -5
  94. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +268 -0
  95. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/replace_items.rb +188 -0
  96. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +128 -26
  97. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +7 -0
  98. data/lib/twilio-ruby/rest/pricing/v2/country.rb +280 -0
  99. data/lib/twilio-ruby/rest/pricing/v2/number.rb +225 -0
  100. data/lib/twilio-ruby/rest/pricing/v2.rb +37 -0
  101. data/lib/twilio-ruby/rest/pricing.rb +19 -0
  102. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +1 -1
  103. data/lib/twilio-ruby/rest/serverless/v1/service.rb +7 -0
  104. data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +1 -1
  105. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +1 -1
  106. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
  107. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +44 -55
  108. data/lib/twilio-ruby/rest/supersim/v1/{command.rb → ip_command.rb} +132 -84
  109. data/lib/twilio-ruby/rest/supersim/v1/sim/billing_period.rb +231 -0
  110. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +30 -1
  111. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
  112. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +23 -9
  113. data/lib/twilio-ruby/rest/supersim/v1.rb +23 -7
  114. data/lib/twilio-ruby/rest/supersim.rb +15 -6
  115. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +7 -0
  116. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +7 -3
  117. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +6 -2
  118. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +7 -3
  119. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +23 -11
  120. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +4 -2
  121. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +4 -2
  122. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +38 -22
  123. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +19 -3
  124. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +155 -10
  125. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +12 -9
  126. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +74 -22
  127. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +34 -15
  128. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +66 -31
  129. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +7 -3
  130. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +25 -7
  131. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +24 -5
  132. data/lib/twilio-ruby/rest/verify/v2/service.rb +40 -11
  133. data/lib/twilio-ruby/rest/verify/v2/template.rb +206 -0
  134. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
  135. data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +234 -0
  136. data/lib/twilio-ruby/rest/verify/v2.rb +14 -0
  137. data/lib/twilio-ruby/rest/verify.rb +14 -2
  138. data/lib/twilio-ruby/rest/video/v1/composition.rb +21 -8
  139. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +0 -8
  140. data/lib/twilio-ruby/rest/video/v1/recording.rb +21 -0
  141. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
  142. data/lib/twilio-ruby/rest/video/v1/room.rb +62 -5
  143. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
  144. data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
  145. data/lib/twilio-ruby/rest/voice.rb +8 -0
  146. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
  147. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +16 -26
  148. data/lib/twilio-ruby/rest.rb +13 -0
  149. data/lib/twilio-ruby/twiml/voice_response.rb +727 -87
  150. data/lib/twilio-ruby/version.rb +1 -1
  151. data/lib/twilio-ruby.rb +6 -16
  152. data/sonar-project.properties +13 -0
  153. data/twilio-ruby.gemspec +1 -2
  154. metadata +59 -32
  155. data/.travis.yml +0 -45
  156. data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -536
  157. /data/lib/twilio-ruby/framework/{domain.rb → rest/domain.rb} +0 -0
  158. /data/lib/twilio-ruby/framework/{error.rb → rest/error.rb} +0 -0
  159. /data/lib/twilio-ruby/framework/{helper.rb → rest/helper.rb} +0 -0
  160. /data/lib/twilio-ruby/framework/{obsolete_client.rb → rest/obsolete_client.rb} +0 -0
  161. /data/lib/twilio-ruby/framework/{page.rb → rest/page.rb} +0 -0
  162. /data/lib/twilio-ruby/framework/{resource.rb → rest/resource.rb} +0 -0
  163. /data/lib/twilio-ruby/framework/{version.rb → rest/version.rb} +0 -0
@@ -19,8 +19,8 @@ module Twilio
19
19
  # @param [Version] version Version that contains the resource
20
20
  # @param [String] account_sid The unique id of the Account that is responsible for
21
21
  # this resource.
22
- # @param [String] domain_sid The unique string that that we created to identify
23
- # the SipDomain resource.
22
+ # @param [String] domain_sid The unique string that is created to identify the
23
+ # SipDomain resource.
24
24
  # @return [CredentialListMappingList] CredentialListMappingList
25
25
  def initialize(version, account_sid: nil, domain_sid: nil)
26
26
  super(version)
@@ -233,8 +233,8 @@ module Twilio
233
233
  # @param [Hash] payload payload that contains response from Twilio
234
234
  # @param [String] account_sid The unique id of the Account that is responsible for
235
235
  # this resource.
236
- # @param [String] domain_sid The unique string that that we created to identify
237
- # the SipDomain resource.
236
+ # @param [String] domain_sid The unique string that is created to identify the
237
+ # SipDomain resource.
238
238
  # @param [String] sid A 34 character string that uniquely identifies the resource
239
239
  # to fetch.
240
240
  # @return [CredentialListMappingInstance] CredentialListMappingInstance
@@ -246,10 +246,10 @@ module Twilio
246
246
  'account_sid' => payload['account_sid'],
247
247
  'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
248
248
  'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
249
+ 'domain_sid' => payload['domain_sid'],
249
250
  'friendly_name' => payload['friendly_name'],
250
251
  'sid' => payload['sid'],
251
252
  'uri' => payload['uri'],
252
- 'subresource_uris' => payload['subresource_uris'],
253
253
  }
254
254
 
255
255
  # Context
@@ -295,6 +295,12 @@ module Twilio
295
295
  @properties['date_updated']
296
296
  end
297
297
 
298
+ ##
299
+ # @return [String] The unique string that identifies the SipDomain resource.
300
+ def domain_sid
301
+ @properties['domain_sid']
302
+ end
303
+
298
304
  ##
299
305
  # @return [String] A human readable descriptive text for this resource, up to 64 characters long.
300
306
  def friendly_name
@@ -313,12 +319,6 @@ module Twilio
313
319
  @properties['uri']
314
320
  end
315
321
 
316
- ##
317
- # @return [String] The credentials associated with this resource.
318
- def subresource_uris
319
- @properties['subresource_uris']
320
- end
321
-
322
322
  ##
323
323
  # Fetch the CredentialListMappingInstance
324
324
  # @return [CredentialListMappingInstance] Fetched CredentialListMappingInstance
@@ -19,8 +19,8 @@ module Twilio
19
19
  # @param [Version] version Version that contains the resource
20
20
  # @param [String] account_sid The unique id of the Account that is responsible for
21
21
  # this resource.
22
- # @param [String] domain_sid The unique string that that we created to identify
23
- # the SipDomain resource.
22
+ # @param [String] domain_sid The unique string that is created to identify the
23
+ # SipDomain resource.
24
24
  # @return [IpAccessControlListMappingList] IpAccessControlListMappingList
25
25
  def initialize(version, account_sid: nil, domain_sid: nil)
26
26
  super(version)
@@ -232,8 +232,8 @@ module Twilio
232
232
  # @param [Hash] payload payload that contains response from Twilio
233
233
  # @param [String] account_sid The unique id of the Account that is responsible for
234
234
  # this resource.
235
- # @param [String] domain_sid The unique string that that we created to identify
236
- # the SipDomain resource.
235
+ # @param [String] domain_sid The unique string that is created to identify the
236
+ # SipDomain resource.
237
237
  # @param [String] sid A 34 character string that uniquely identifies the resource
238
238
  # to fetch.
239
239
  # @return [IpAccessControlListMappingInstance] IpAccessControlListMappingInstance
@@ -245,10 +245,10 @@ module Twilio
245
245
  'account_sid' => payload['account_sid'],
246
246
  'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
247
247
  'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
248
+ 'domain_sid' => payload['domain_sid'],
248
249
  'friendly_name' => payload['friendly_name'],
249
250
  'sid' => payload['sid'],
250
251
  'uri' => payload['uri'],
251
- 'subresource_uris' => payload['subresource_uris'],
252
252
  }
253
253
 
254
254
  # Context
@@ -294,6 +294,12 @@ module Twilio
294
294
  @properties['date_updated']
295
295
  end
296
296
 
297
+ ##
298
+ # @return [String] The unique string that identifies the SipDomain resource.
299
+ def domain_sid
300
+ @properties['domain_sid']
301
+ end
302
+
297
303
  ##
298
304
  # @return [String] A human readable descriptive text for this resource, up to 64 characters long.
299
305
  def friendly_name
@@ -312,12 +318,6 @@ module Twilio
312
318
  @properties['uri']
313
319
  end
314
320
 
315
- ##
316
- # @return [String] The list of IP addresses associated with this domain.
317
- def subresource_uris
318
- @properties['subresource_uris']
319
- end
320
-
321
321
  ##
322
322
  # Fetch the IpAccessControlListMappingInstance
323
323
  # @return [IpAccessControlListMappingInstance] Fetched IpAccessControlListMappingInstance
@@ -11,8 +11,6 @@ module Twilio
11
11
  class Bulkexports < Domain
12
12
  class V1 < Version
13
13
  class ExportContext < InstanceContext
14
- ##
15
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
16
14
  class DayList < ListResource
17
15
  ##
18
16
  # Initialize the DayList
@@ -115,8 +113,6 @@ module Twilio
115
113
  end
116
114
  end
117
115
 
118
- ##
119
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
120
116
  class DayPage < Page
121
117
  ##
122
118
  # Initialize the DayPage
@@ -146,8 +142,6 @@ module Twilio
146
142
  end
147
143
  end
148
144
 
149
- ##
150
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
151
145
  class DayContext < InstanceContext
152
146
  ##
153
147
  # Initialize the DayContext
@@ -189,8 +183,6 @@ module Twilio
189
183
  end
190
184
  end
191
185
 
192
- ##
193
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
194
186
  class DayInstance < InstanceResource
195
187
  ##
196
188
  # Initialize the DayInstance
@@ -11,8 +11,6 @@ module Twilio
11
11
  class Bulkexports < Domain
12
12
  class V1 < Version
13
13
  class ExportContext < InstanceContext
14
- ##
15
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
16
14
  class ExportCustomJobList < ListResource
17
15
  ##
18
16
  # Initialize the ExportCustomJobList
@@ -147,8 +145,6 @@ module Twilio
147
145
  end
148
146
  end
149
147
 
150
- ##
151
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
152
148
  class ExportCustomJobPage < Page
153
149
  ##
154
150
  # Initialize the ExportCustomJobPage
@@ -178,8 +174,6 @@ module Twilio
178
174
  end
179
175
  end
180
176
 
181
- ##
182
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
183
177
  class ExportCustomJobInstance < InstanceResource
184
178
  ##
185
179
  # Initialize the ExportCustomJobInstance
@@ -11,8 +11,6 @@ module Twilio
11
11
  class Bulkexports < Domain
12
12
  class V1 < Version
13
13
  class ExportList < ListResource
14
- ##
15
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
16
14
  class JobList < ListResource
17
15
  ##
18
16
  # Initialize the JobList
@@ -32,8 +30,6 @@ module Twilio
32
30
  end
33
31
  end
34
32
 
35
- ##
36
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
37
33
  class JobPage < Page
38
34
  ##
39
35
  # Initialize the JobPage
@@ -63,8 +59,6 @@ module Twilio
63
59
  end
64
60
  end
65
61
 
66
- ##
67
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
68
62
  class JobContext < InstanceContext
69
63
  ##
70
64
  # Initialize the JobContext
@@ -111,8 +105,6 @@ module Twilio
111
105
  end
112
106
  end
113
107
 
114
- ##
115
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
116
108
  class JobInstance < InstanceResource
117
109
  ##
118
110
  # Initialize the JobInstance
@@ -10,8 +10,6 @@ module Twilio
10
10
  module REST
11
11
  class Bulkexports < Domain
12
12
  class V1 < Version
13
- ##
14
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
15
13
  class ExportList < ListResource
16
14
  ##
17
15
  # Initialize the ExportList
@@ -50,8 +48,6 @@ module Twilio
50
48
  end
51
49
  end
52
50
 
53
- ##
54
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
55
51
  class ExportPage < Page
56
52
  ##
57
53
  # Initialize the ExportPage
@@ -81,8 +77,6 @@ module Twilio
81
77
  end
82
78
  end
83
79
 
84
- ##
85
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
86
80
  class ExportContext < InstanceContext
87
81
  ##
88
82
  # Initialize the ExportContext
@@ -156,8 +150,6 @@ module Twilio
156
150
  end
157
151
  end
158
152
 
159
- ##
160
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
161
153
  class ExportInstance < InstanceResource
162
154
  ##
163
155
  # Initialize the ExportInstance
@@ -10,8 +10,6 @@ module Twilio
10
10
  module REST
11
11
  class Bulkexports < Domain
12
12
  class V1 < Version
13
- ##
14
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
15
13
  class ExportConfigurationList < ListResource
16
14
  ##
17
15
  # Initialize the ExportConfigurationList
@@ -31,8 +29,6 @@ module Twilio
31
29
  end
32
30
  end
33
31
 
34
- ##
35
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
36
32
  class ExportConfigurationPage < Page
37
33
  ##
38
34
  # Initialize the ExportConfigurationPage
@@ -62,8 +58,6 @@ module Twilio
62
58
  end
63
59
  end
64
60
 
65
- ##
66
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
67
61
  class ExportConfigurationContext < InstanceContext
68
62
  ##
69
63
  # Initialize the ExportConfigurationContext
@@ -125,8 +119,6 @@ module Twilio
125
119
  end
126
120
  end
127
121
 
128
- ##
129
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
130
122
  class ExportConfigurationInstance < InstanceResource
131
123
  ##
132
124
  # Initialize the ExportConfigurationInstance
@@ -193,9 +193,13 @@ module Twilio
193
193
 
194
194
  ##
195
195
  # Delete the UserChannelInstance
196
+ # @param [user_channel.WebhookEnabledType] x_twilio_webhook_enabled The
197
+ # X-Twilio-Webhook-Enabled HTTP request header
196
198
  # @return [Boolean] true if delete succeeds, false otherwise
197
- def delete
198
- @version.delete('DELETE', @uri)
199
+ def delete(x_twilio_webhook_enabled: :unset)
200
+ headers = Twilio::Values.of({'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, })
201
+
202
+ @version.delete('DELETE', @uri, headers: headers)
199
203
  end
200
204
 
201
205
  ##
@@ -377,9 +381,11 @@ module Twilio
377
381
 
378
382
  ##
379
383
  # Delete the UserChannelInstance
384
+ # @param [user_channel.WebhookEnabledType] x_twilio_webhook_enabled The
385
+ # X-Twilio-Webhook-Enabled HTTP request header
380
386
  # @return [Boolean] true if delete succeeds, false otherwise
381
- def delete
382
- context.delete
387
+ def delete(x_twilio_webhook_enabled: :unset)
388
+ context.delete(x_twilio_webhook_enabled: x_twilio_webhook_enabled, )
383
389
  end
384
390
 
385
391
  ##
@@ -0,0 +1,275 @@
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 Chat < Domain
12
+ class V3 < Version
13
+ class ChannelList < ListResource
14
+ ##
15
+ # Initialize the ChannelList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [ChannelList] ChannelList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ end
24
+
25
+ ##
26
+ # Provide a user friendly representation
27
+ def to_s
28
+ '#<Twilio.Chat.V3.ChannelList>'
29
+ end
30
+ end
31
+
32
+ class ChannelPage < Page
33
+ ##
34
+ # Initialize the ChannelPage
35
+ # @param [Version] version Version that contains the resource
36
+ # @param [Response] response Response from the API
37
+ # @param [Hash] solution Path solution for the resource
38
+ # @return [ChannelPage] ChannelPage
39
+ def initialize(version, response, solution)
40
+ super(version, response)
41
+
42
+ # Path Solution
43
+ @solution = solution
44
+ end
45
+
46
+ ##
47
+ # Build an instance of ChannelInstance
48
+ # @param [Hash] payload Payload response from the API
49
+ # @return [ChannelInstance] ChannelInstance
50
+ def get_instance(payload)
51
+ ChannelInstance.new(@version, payload, )
52
+ end
53
+
54
+ ##
55
+ # Provide a user friendly representation
56
+ def to_s
57
+ '<Twilio.Chat.V3.ChannelPage>'
58
+ end
59
+ end
60
+
61
+ class ChannelContext < InstanceContext
62
+ ##
63
+ # Initialize the ChannelContext
64
+ # @param [Version] version Version that contains the resource
65
+ # @param [String] service_sid The unique SID identifier of the Service.
66
+ # @param [String] sid A 34 character string that uniquely identifies this Channel.
67
+ # @return [ChannelContext] ChannelContext
68
+ def initialize(version, service_sid, sid)
69
+ super(version)
70
+
71
+ # Path Solution
72
+ @solution = {service_sid: service_sid, sid: sid, }
73
+ @uri = "/Services/#{@solution[:service_sid]}/Channels/#{@solution[:sid]}"
74
+ end
75
+
76
+ ##
77
+ # Update the ChannelInstance
78
+ # @param [channel.ChannelType] type TThe Type for this Channel to migrate to. Can
79
+ # only be `private`. Migration to 'public' is not allowed.
80
+ # @param [String] messaging_service_sid The unique ID of the {Messaging
81
+ # Service}[https://www.twilio.com/docs/sms/services/api] this channel belongs to.
82
+ # @param [channel.WebhookEnabledType] x_twilio_webhook_enabled The
83
+ # X-Twilio-Webhook-Enabled HTTP request header
84
+ # @return [ChannelInstance] Updated ChannelInstance
85
+ def update(type: :unset, messaging_service_sid: :unset, x_twilio_webhook_enabled: :unset)
86
+ data = Twilio::Values.of({'Type' => type, 'MessagingServiceSid' => messaging_service_sid, })
87
+ headers = Twilio::Values.of({'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, })
88
+
89
+ payload = @version.update('POST', @uri, data: data, headers: headers)
90
+
91
+ ChannelInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], )
92
+ end
93
+
94
+ ##
95
+ # Provide a user friendly representation
96
+ def to_s
97
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
98
+ "#<Twilio.Chat.V3.ChannelContext #{context}>"
99
+ end
100
+
101
+ ##
102
+ # Provide a detailed, user friendly representation
103
+ def inspect
104
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
105
+ "#<Twilio.Chat.V3.ChannelContext #{context}>"
106
+ end
107
+ end
108
+
109
+ class ChannelInstance < InstanceResource
110
+ ##
111
+ # Initialize the ChannelInstance
112
+ # @param [Version] version Version that contains the resource
113
+ # @param [Hash] payload payload that contains response from Twilio
114
+ # @param [String] service_sid The unique SID identifier of the Service.
115
+ # @param [String] sid A 34 character string that uniquely identifies this Channel.
116
+ # @return [ChannelInstance] ChannelInstance
117
+ def initialize(version, payload, service_sid: nil, sid: nil)
118
+ super(version)
119
+
120
+ # Marshaled Properties
121
+ @properties = {
122
+ 'sid' => payload['sid'],
123
+ 'account_sid' => payload['account_sid'],
124
+ 'service_sid' => payload['service_sid'],
125
+ 'friendly_name' => payload['friendly_name'],
126
+ 'unique_name' => payload['unique_name'],
127
+ 'attributes' => payload['attributes'],
128
+ 'type' => payload['type'],
129
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
130
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
131
+ 'created_by' => payload['created_by'],
132
+ 'members_count' => payload['members_count'].to_i,
133
+ 'messages_count' => payload['messages_count'].to_i,
134
+ 'messaging_service_sid' => payload['messaging_service_sid'],
135
+ 'url' => payload['url'],
136
+ }
137
+
138
+ # Context
139
+ @instance_context = nil
140
+ @params = {
141
+ 'service_sid' => service_sid || @properties['service_sid'],
142
+ 'sid' => sid || @properties['sid'],
143
+ }
144
+ end
145
+
146
+ ##
147
+ # Generate an instance context for the instance, the context is capable of
148
+ # performing various actions. All instance actions are proxied to the context
149
+ # @return [ChannelContext] ChannelContext for this ChannelInstance
150
+ def context
151
+ unless @instance_context
152
+ @instance_context = ChannelContext.new(@version, @params['service_sid'], @params['sid'], )
153
+ end
154
+ @instance_context
155
+ end
156
+
157
+ ##
158
+ # @return [String] The unique string that identifies the resource
159
+ def sid
160
+ @properties['sid']
161
+ end
162
+
163
+ ##
164
+ # @return [String] The SID of the Account that created the resource
165
+ def account_sid
166
+ @properties['account_sid']
167
+ end
168
+
169
+ ##
170
+ # @return [String] The SID of the Service that the resource is associated with
171
+ def service_sid
172
+ @properties['service_sid']
173
+ end
174
+
175
+ ##
176
+ # @return [String] The string that you assigned to describe the resource
177
+ def friendly_name
178
+ @properties['friendly_name']
179
+ end
180
+
181
+ ##
182
+ # @return [String] An application-defined string that uniquely identifies the resource
183
+ def unique_name
184
+ @properties['unique_name']
185
+ end
186
+
187
+ ##
188
+ # @return [String] The JSON string that stores application-specific data
189
+ def attributes
190
+ @properties['attributes']
191
+ end
192
+
193
+ ##
194
+ # @return [channel.ChannelType] The visibility of the channel. Can be: `public` or `private`
195
+ def type
196
+ @properties['type']
197
+ end
198
+
199
+ ##
200
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was created
201
+ def date_created
202
+ @properties['date_created']
203
+ end
204
+
205
+ ##
206
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
207
+ def date_updated
208
+ @properties['date_updated']
209
+ end
210
+
211
+ ##
212
+ # @return [String] The identity of the User that created the channel
213
+ def created_by
214
+ @properties['created_by']
215
+ end
216
+
217
+ ##
218
+ # @return [String] The number of Members in the Channel
219
+ def members_count
220
+ @properties['members_count']
221
+ end
222
+
223
+ ##
224
+ # @return [String] The number of Messages that have been passed in the Channel
225
+ def messages_count
226
+ @properties['messages_count']
227
+ end
228
+
229
+ ##
230
+ # @return [String] The unique ID of the Messaging Service this channel belongs to.
231
+ def messaging_service_sid
232
+ @properties['messaging_service_sid']
233
+ end
234
+
235
+ ##
236
+ # @return [String] The absolute URL of the Channel resource
237
+ def url
238
+ @properties['url']
239
+ end
240
+
241
+ ##
242
+ # Update the ChannelInstance
243
+ # @param [channel.ChannelType] type TThe Type for this Channel to migrate to. Can
244
+ # only be `private`. Migration to 'public' is not allowed.
245
+ # @param [String] messaging_service_sid The unique ID of the {Messaging
246
+ # Service}[https://www.twilio.com/docs/sms/services/api] this channel belongs to.
247
+ # @param [channel.WebhookEnabledType] x_twilio_webhook_enabled The
248
+ # X-Twilio-Webhook-Enabled HTTP request header
249
+ # @return [ChannelInstance] Updated ChannelInstance
250
+ def update(type: :unset, messaging_service_sid: :unset, x_twilio_webhook_enabled: :unset)
251
+ context.update(
252
+ type: type,
253
+ messaging_service_sid: messaging_service_sid,
254
+ x_twilio_webhook_enabled: x_twilio_webhook_enabled,
255
+ )
256
+ end
257
+
258
+ ##
259
+ # Provide a user friendly representation
260
+ def to_s
261
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
262
+ "<Twilio.Chat.V3.ChannelInstance #{values}>"
263
+ end
264
+
265
+ ##
266
+ # Provide a detailed, user friendly representation
267
+ def inspect
268
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
269
+ "<Twilio.Chat.V3.ChannelInstance #{values}>"
270
+ end
271
+ end
272
+ end
273
+ end
274
+ end
275
+ end
@@ -0,0 +1,48 @@
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 Chat
12
+ class V3 < Version
13
+ ##
14
+ # Initialize the V3 version of Chat
15
+ def initialize(domain)
16
+ super
17
+ @version = 'v3'
18
+ @channels = nil
19
+ end
20
+
21
+ ##
22
+ # @param [String] service_sid The unique SID identifier of the Service.
23
+ # @param [String] sid A 34 character string that uniquely identifies this Channel.
24
+ # @return [Twilio::REST::Chat::V3::ChannelContext] if sid was passed.
25
+ # @return [Twilio::REST::Chat::V3::ChannelList]
26
+ def channels(service_sid=:unset, sid=:unset)
27
+ if service_sid.nil?
28
+ raise ArgumentError, 'service_sid cannot be nil'
29
+ end
30
+ if sid.nil?
31
+ raise ArgumentError, 'sid cannot be nil'
32
+ end
33
+ if service_sid == :unset && sid == :unset
34
+ @channels ||= ChannelList.new self
35
+ else
36
+ ChannelContext.new(self, service_sid, sid)
37
+ end
38
+ end
39
+
40
+ ##
41
+ # Provide a user friendly representation
42
+ def to_s
43
+ '<Twilio::REST::Chat::V3>'
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -21,6 +21,7 @@ module Twilio
21
21
  # Versions
22
22
  @v1 = nil
23
23
  @v2 = nil
24
+ @v3 = nil
24
25
  end
25
26
 
26
27
  ##
@@ -35,6 +36,12 @@ module Twilio
35
36
  @v2 ||= V2.new self
36
37
  end
37
38
 
39
+ ##
40
+ # Version v3 of chat
41
+ def v3
42
+ @v3 ||= V3.new self
43
+ end
44
+
38
45
  ##
39
46
  # @param [String] sid The unique string that we created to identify the Credential
40
47
  # resource.
@@ -53,6 +60,15 @@ module Twilio
53
60
  self.v2.services(sid)
54
61
  end
55
62
 
63
+ ##
64
+ # @param [String] sid The unique string that we created to identify the Channel
65
+ # resource.
66
+ # @return [Twilio::REST::Chat::V3::ChannelInstance] if sid was passed.
67
+ # @return [Twilio::REST::Chat::V3::ChannelList]
68
+ def channels(service_sid=:unset, sid=:unset)
69
+ self.v3.channels(service_sid, sid)
70
+ end
71
+
56
72
  ##
57
73
  # Provide a user friendly representation
58
74
  def to_s