twilio-ruby 5.67.3 → 5.74.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/pr-lint.yml +8 -2
  3. data/.github/workflows/test-and-deploy.yml +3 -3
  4. data/CHANGES.md +288 -0
  5. data/LICENSE +1 -1
  6. data/Makefile +6 -2
  7. data/PULL_REQUEST_TEMPLATE.md +1 -1
  8. data/README.md +2 -2
  9. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +19 -3
  10. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +22 -3
  11. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +2 -2
  12. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +2 -2
  13. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +2 -2
  14. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +2 -2
  15. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +2 -2
  16. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +2 -2
  17. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +2 -2
  18. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +1 -1
  19. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
  20. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +2 -2
  21. data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb +160 -0
  22. data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message_subscription.rb +251 -0
  23. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +59 -0
  24. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +56 -17
  25. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
  26. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +5 -5
  27. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +17 -1
  28. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +2 -2
  29. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +3 -3
  30. data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +1 -1
  31. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +1 -1
  32. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +5 -5
  33. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +3 -3
  34. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +1 -1
  35. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +1 -1
  36. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +1 -1
  37. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +1 -1
  38. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +1 -1
  39. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +1 -1
  40. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +1 -1
  41. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +1 -1
  42. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +1 -1
  43. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +1 -1
  44. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +2 -2
  45. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +1 -1
  46. data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +1 -1
  47. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +2 -2
  48. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +1 -1
  49. data/lib/twilio-ruby/rest/chat/v1/service.rb +2 -2
  50. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +1 -1
  51. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +2 -2
  52. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +1 -1
  53. data/lib/twilio-ruby/rest/chat/v2/service.rb +4 -4
  54. data/lib/twilio-ruby/rest/chat/v3/channel.rb +2 -2
  55. data/lib/twilio-ruby/rest/client.rb +28 -0
  56. data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +195 -0
  57. data/lib/twilio-ruby/rest/content/v1/content.rb +346 -0
  58. data/lib/twilio-ruby/rest/content/v1/legacy_content.rb +254 -0
  59. data/lib/twilio-ruby/rest/content/v1.rb +52 -0
  60. data/lib/twilio-ruby/rest/content.rb +53 -0
  61. data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +1 -1
  62. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +17 -2
  63. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +1 -1
  64. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +17 -2
  65. data/lib/twilio-ruby/rest/events/v1/schema/version.rb +1 -1
  66. data/lib/twilio-ruby/rest/events/v1/schema.rb +1 -1
  67. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +1 -1
  68. data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +397 -0
  69. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
  70. data/lib/twilio-ruby/rest/flex_api/v1/insights_assessments_comment.rb +314 -0
  71. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb +394 -0
  72. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb +313 -0
  73. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +390 -0
  74. data/lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb +413 -0
  75. data/lib/twilio-ruby/rest/{preview/trusted_comms/brands_information.rb → flex_api/v1/insights_session.rb} +58 -55
  76. data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_answersets.rb +144 -0
  77. data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_comment.rb +130 -0
  78. data/lib/twilio-ruby/rest/{preview/trusted_comms/cps.rb → flex_api/v1/insights_user_roles.rb} +42 -54
  79. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +22 -1
  80. data/lib/twilio-ruby/rest/flex_api/v1.rb +115 -0
  81. data/lib/twilio-ruby/rest/flex_api/v2/web_channels.rb +133 -0
  82. data/lib/twilio-ruby/rest/flex_api/v2.rb +35 -0
  83. data/lib/twilio-ruby/rest/flex_api.rb +83 -0
  84. data/lib/twilio-ruby/rest/insights/v1/call/annotation.rb +322 -0
  85. data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +14 -0
  86. data/lib/twilio-ruby/rest/insights/v1/call.rb +16 -8
  87. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +7 -0
  88. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +1 -1
  89. data/lib/twilio-ruby/rest/insights/v1/room.rb +3 -3
  90. data/lib/twilio-ruby/rest/insights/v1.rb +0 -16
  91. data/lib/twilio-ruby/rest/insights.rb +0 -8
  92. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +1 -1
  93. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +2 -2
  94. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +1 -1
  95. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +2 -2
  96. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +1 -1
  97. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +2 -2
  98. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +1 -1
  99. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +4 -4
  100. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +94 -12
  101. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +1 -1
  102. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +2 -9
  103. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +5 -5
  104. data/lib/twilio-ruby/rest/messaging/v1/domain_cert.rb +257 -0
  105. data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +267 -0
  106. data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +2 -2
  107. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +98 -3
  108. data/lib/twilio-ruby/rest/messaging/v1/service.rb +1 -1
  109. data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +709 -0
  110. data/lib/twilio-ruby/rest/messaging/v1.rb +50 -0
  111. data/lib/twilio-ruby/rest/messaging.rb +26 -0
  112. data/lib/twilio-ruby/rest/microvisor/v1/account_config.rb +317 -0
  113. data/lib/twilio-ruby/rest/microvisor/v1/account_secret.rb +310 -0
  114. data/lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb +192 -0
  115. data/lib/twilio-ruby/rest/microvisor/v1/app.rb +330 -0
  116. data/lib/twilio-ruby/rest/microvisor/v1/device/device_config.rb +342 -0
  117. data/lib/twilio-ruby/rest/{preview/bulk_exports/export/day.rb → microvisor/v1/device/device_secret.rb} +125 -84
  118. data/lib/twilio-ruby/rest/microvisor/v1/device.rb +393 -0
  119. data/lib/twilio-ruby/rest/microvisor/v1.rb +92 -0
  120. data/lib/twilio-ruby/rest/microvisor.rb +70 -0
  121. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +1 -1
  122. data/lib/twilio-ruby/rest/oauth/v1/device_code.rb +153 -0
  123. data/lib/twilio-ruby/rest/oauth/v1/oauth.rb +162 -0
  124. data/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb +242 -0
  125. data/lib/twilio-ruby/rest/oauth/v1/token.rb +157 -0
  126. data/lib/twilio-ruby/rest/oauth/v1/user_info.rb +193 -0
  127. data/lib/twilio-ruby/rest/oauth/v1.rb +63 -0
  128. data/lib/twilio-ruby/rest/oauth.rb +68 -0
  129. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +2 -2
  130. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +2 -2
  131. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +1 -1
  132. data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +2 -2
  133. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +1 -1
  134. data/lib/twilio-ruby/rest/preview.rb +0 -58
  135. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +1 -1
  136. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +1 -14
  137. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +5 -46
  138. data/lib/twilio-ruby/rest/proxy/v1/service.rb +1 -1
  139. data/lib/twilio-ruby/rest/routes/v2/phone_number.rb +235 -0
  140. data/lib/twilio-ruby/rest/routes/v2/sip_domain.rb +231 -0
  141. data/lib/twilio-ruby/rest/routes/v2/trunk.rb +235 -0
  142. data/lib/twilio-ruby/rest/routes/v2.rb +76 -0
  143. data/lib/twilio-ruby/rest/routes.rb +62 -0
  144. data/lib/twilio-ruby/rest/studio/v1/flow.rb +1 -1
  145. data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +1 -1
  146. data/lib/twilio-ruby/rest/studio/v2/flow.rb +1 -1
  147. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +21 -1
  148. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +17 -7
  149. data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +5 -2
  150. data/lib/twilio-ruby/rest/supersim/v1/settings_update.rb +247 -0
  151. data/lib/twilio-ruby/rest/supersim/v1/sim/sim_ip_address.rb +195 -0
  152. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +20 -0
  153. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +3 -3
  154. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +4 -4
  155. data/lib/twilio-ruby/rest/supersim/v1.rb +7 -0
  156. data/lib/twilio-ruby/rest/supersim.rb +6 -0
  157. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +1 -1
  158. data/lib/twilio-ruby/rest/sync/v1/service.rb +1 -1
  159. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +1 -1
  160. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +18 -5
  161. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +3 -3
  162. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +12 -12
  163. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +5 -5
  164. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +10 -4
  165. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +3 -3
  166. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +6 -6
  167. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +1 -1
  168. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +9 -3
  169. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +13 -13
  170. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +2 -2
  171. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +1 -1
  172. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +13 -13
  173. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +3 -3
  174. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +2 -2
  175. data/lib/twilio-ruby/rest/verify/v2/safelist.rb +215 -0
  176. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +1 -9
  177. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +1 -7
  178. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +0 -8
  179. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +0 -8
  180. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +0 -6
  181. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +0 -8
  182. data/lib/twilio-ruby/rest/verify/v2/service/rate_limit/bucket.rb +2 -2
  183. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +14 -10
  184. data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +8 -1
  185. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +0 -8
  186. data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
  187. data/lib/twilio-ruby/rest/verify/v2/template.rb +7 -0
  188. data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +4 -4
  189. data/lib/twilio-ruby/rest/verify/v2.rb +18 -0
  190. data/lib/twilio-ruby/rest/verify.rb +8 -0
  191. data/lib/twilio-ruby/rest/video/v1/composition.rb +3 -3
  192. data/lib/twilio-ruby/rest/video/v1/recording.rb +2 -2
  193. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +2 -2
  194. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_anonymize.rb +240 -0
  195. data/lib/twilio-ruby/rest/video/v1/room/room_participant.rb +16 -0
  196. data/lib/twilio-ruby/rest/video/v1/room.rb +4 -4
  197. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +2 -2
  198. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/bulk_country_update.rb +1 -1
  199. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +1 -1
  200. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
  201. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +2 -2
  202. data/lib/twilio-ruby/security/request_validator.rb +1 -1
  203. data/lib/twilio-ruby/twiml/voice_response.rb +135 -35
  204. data/lib/twilio-ruby/version.rb +1 -1
  205. data/twilio-ruby.gemspec +1 -1
  206. metadata +52 -17
  207. data/lib/twilio-ruby/rest/insights/v1/annotation.rb +0 -271
  208. data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +0 -275
  209. data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +0 -249
  210. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +0 -251
  211. data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +0 -234
  212. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +0 -62
  213. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb +0 -165
  214. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb +0 -225
  215. data/lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb +0 -277
  216. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +0 -65
@@ -127,20 +127,8 @@ module Twilio
127
127
  # on create.
128
128
  # @param [Array[Hash]] participants The Participant objects to include in the new
129
129
  # session.
130
- # @param [Boolean] fail_on_participant_conflict [Experimental] For accounts with
131
- # the ProxyAllowParticipantConflict account flag, setting to true enables
132
- # per-request opt-in to allowing Proxy to reject a Session create (with
133
- # Participants) request that could cause the same Identifier/ProxyIdentifier pair
134
- # to be active in multiple Sessions. Depending on the context, this could be a 409
135
- # error (Twilio error code 80623) or a 400 error (Twilio error code 80604). If not
136
- # provided, requests will be allowed to succeed and a Debugger notification
137
- # (80802) will be emitted. Having multiple, active Participants with the same
138
- # Identifier/ProxyIdentifier pair causes calls and messages from affected
139
- # Participants to be routed incorrectly. Please note, the default behavior for
140
- # accounts without the ProxyAllowParticipantConflict flag is to reject the request
141
- # as described. This will eventually be the default for all accounts.
142
130
  # @return [SessionInstance] Created SessionInstance
143
- def create(unique_name: :unset, date_expiry: :unset, ttl: :unset, mode: :unset, status: :unset, participants: :unset, fail_on_participant_conflict: :unset)
131
+ def create(unique_name: :unset, date_expiry: :unset, ttl: :unset, mode: :unset, status: :unset, participants: :unset)
144
132
  data = Twilio::Values.of({
145
133
  'UniqueName' => unique_name,
146
134
  'DateExpiry' => Twilio.serialize_iso8601_datetime(date_expiry),
@@ -148,7 +136,6 @@ module Twilio
148
136
  'Mode' => mode,
149
137
  'Status' => status,
150
138
  'Participants' => Twilio.serialize_list(participants) { |e| Twilio.serialize_object(e) },
151
- 'FailOnParticipantConflict' => fail_on_participant_conflict,
152
139
  })
153
140
 
154
141
  payload = @version.create('POST', @uri, data: data)
@@ -243,24 +230,12 @@ module Twilio
243
230
  # is measured from the last Session create or the Session's last Interaction.
244
231
  # @param [session.Status] status The new status of the resource. Can be:
245
232
  # `in-progress` to re-open a session or `closed` to close a session.
246
- # @param [Boolean] fail_on_participant_conflict [Experimental] For accounts with
247
- # the ProxyAllowParticipantConflict account flag, setting to true enables
248
- # per-request opt-in to allowing Proxy to return a 400 error (Twilio error code
249
- # 80604) when a request to set a Session to in-progress would cause Participants
250
- # with the same Identifier/ProxyIdentifier pair to be active in multiple Sessions.
251
- # If not provided, requests will be allowed to succeed, and a Debugger
252
- # notification (80801) will be emitted. Having multiple, active Participants with
253
- # the same Identifier/ProxyIdentifier pair causes calls and messages from affected
254
- # Participants to be routed incorrectly. Please note, the default behavior for
255
- # accounts without the ProxyAllowParticipantConflict flag is to reject the request
256
- # as described. This will eventually be the default for all accounts.
257
233
  # @return [SessionInstance] Updated SessionInstance
258
- def update(date_expiry: :unset, ttl: :unset, status: :unset, fail_on_participant_conflict: :unset)
234
+ def update(date_expiry: :unset, ttl: :unset, status: :unset)
259
235
  data = Twilio::Values.of({
260
236
  'DateExpiry' => Twilio.serialize_iso8601_datetime(date_expiry),
261
237
  'Ttl' => ttl,
262
238
  'Status' => status,
263
- 'FailOnParticipantConflict' => fail_on_participant_conflict,
264
239
  })
265
240
 
266
241
  payload = @version.update('POST', @uri, data: data)
@@ -355,7 +330,7 @@ module Twilio
355
330
  'unique_name' => payload['unique_name'],
356
331
  'status' => payload['status'],
357
332
  'closed_reason' => payload['closed_reason'],
358
- 'ttl' => payload['ttl'].to_i,
333
+ 'ttl' => payload['ttl'] == nil ? payload['ttl'] : payload['ttl'].to_i,
359
334
  'mode' => payload['mode'],
360
335
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
361
336
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
@@ -498,25 +473,9 @@ module Twilio
498
473
  # is measured from the last Session create or the Session's last Interaction.
499
474
  # @param [session.Status] status The new status of the resource. Can be:
500
475
  # `in-progress` to re-open a session or `closed` to close a session.
501
- # @param [Boolean] fail_on_participant_conflict [Experimental] For accounts with
502
- # the ProxyAllowParticipantConflict account flag, setting to true enables
503
- # per-request opt-in to allowing Proxy to return a 400 error (Twilio error code
504
- # 80604) when a request to set a Session to in-progress would cause Participants
505
- # with the same Identifier/ProxyIdentifier pair to be active in multiple Sessions.
506
- # If not provided, requests will be allowed to succeed, and a Debugger
507
- # notification (80801) will be emitted. Having multiple, active Participants with
508
- # the same Identifier/ProxyIdentifier pair causes calls and messages from affected
509
- # Participants to be routed incorrectly. Please note, the default behavior for
510
- # accounts without the ProxyAllowParticipantConflict flag is to reject the request
511
- # as described. This will eventually be the default for all accounts.
512
476
  # @return [SessionInstance] Updated SessionInstance
513
- def update(date_expiry: :unset, ttl: :unset, status: :unset, fail_on_participant_conflict: :unset)
514
- context.update(
515
- date_expiry: date_expiry,
516
- ttl: ttl,
517
- status: status,
518
- fail_on_participant_conflict: fail_on_participant_conflict,
519
- )
477
+ def update(date_expiry: :unset, ttl: :unset, status: :unset)
478
+ context.update(date_expiry: date_expiry, ttl: ttl, status: status, )
520
479
  end
521
480
 
522
481
  ##
@@ -386,7 +386,7 @@ module Twilio
386
386
  'account_sid' => payload['account_sid'],
387
387
  'chat_instance_sid' => payload['chat_instance_sid'],
388
388
  'callback_url' => payload['callback_url'],
389
- 'default_ttl' => payload['default_ttl'].to_i,
389
+ 'default_ttl' => payload['default_ttl'] == nil ? payload['default_ttl'] : payload['default_ttl'].to_i,
390
390
  'number_selection_behavior' => payload['number_selection_behavior'],
391
391
  'geo_match_level' => payload['geo_match_level'],
392
392
  'intercept_callback_url' => payload['intercept_callback_url'],
@@ -0,0 +1,235 @@
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 Routes < Domain
12
+ class V2 < Version
13
+ class PhoneNumberList < ListResource
14
+ ##
15
+ # Initialize the PhoneNumberList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [PhoneNumberList] PhoneNumberList
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.Routes.V2.PhoneNumberList>'
29
+ end
30
+ end
31
+
32
+ class PhoneNumberPage < Page
33
+ ##
34
+ # Initialize the PhoneNumberPage
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 [PhoneNumberPage] PhoneNumberPage
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 PhoneNumberInstance
48
+ # @param [Hash] payload Payload response from the API
49
+ # @return [PhoneNumberInstance] PhoneNumberInstance
50
+ def get_instance(payload)
51
+ PhoneNumberInstance.new(@version, payload, )
52
+ end
53
+
54
+ ##
55
+ # Provide a user friendly representation
56
+ def to_s
57
+ '<Twilio.Routes.V2.PhoneNumberPage>'
58
+ end
59
+ end
60
+
61
+ class PhoneNumberContext < InstanceContext
62
+ ##
63
+ # Initialize the PhoneNumberContext
64
+ # @param [Version] version Version that contains the resource
65
+ # @param [String] phone_number The phone number in E.164 format
66
+ # @return [PhoneNumberContext] PhoneNumberContext
67
+ def initialize(version, phone_number)
68
+ super(version)
69
+
70
+ # Path Solution
71
+ @solution = {phone_number: phone_number, }
72
+ @uri = "/PhoneNumbers/#{@solution[:phone_number]}"
73
+ end
74
+
75
+ ##
76
+ # Update the PhoneNumberInstance
77
+ # @param [String] voice_region The Inbound Processing Region used for this phone
78
+ # number for voice
79
+ # @param [String] friendly_name A human readable description of this resource, up
80
+ # to 64 characters.
81
+ # @return [PhoneNumberInstance] Updated PhoneNumberInstance
82
+ def update(voice_region: :unset, friendly_name: :unset)
83
+ data = Twilio::Values.of({'VoiceRegion' => voice_region, 'FriendlyName' => friendly_name, })
84
+
85
+ payload = @version.update('POST', @uri, data: data)
86
+
87
+ PhoneNumberInstance.new(@version, payload, phone_number: @solution[:phone_number], )
88
+ end
89
+
90
+ ##
91
+ # Fetch the PhoneNumberInstance
92
+ # @return [PhoneNumberInstance] Fetched PhoneNumberInstance
93
+ def fetch
94
+ payload = @version.fetch('GET', @uri)
95
+
96
+ PhoneNumberInstance.new(@version, payload, phone_number: @solution[:phone_number], )
97
+ end
98
+
99
+ ##
100
+ # Provide a user friendly representation
101
+ def to_s
102
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
103
+ "#<Twilio.Routes.V2.PhoneNumberContext #{context}>"
104
+ end
105
+
106
+ ##
107
+ # Provide a detailed, user friendly representation
108
+ def inspect
109
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
110
+ "#<Twilio.Routes.V2.PhoneNumberContext #{context}>"
111
+ end
112
+ end
113
+
114
+ class PhoneNumberInstance < InstanceResource
115
+ ##
116
+ # Initialize the PhoneNumberInstance
117
+ # @param [Version] version Version that contains the resource
118
+ # @param [Hash] payload payload that contains response from Twilio
119
+ # @param [String] phone_number The phone number in E.164 format
120
+ # @return [PhoneNumberInstance] PhoneNumberInstance
121
+ def initialize(version, payload, phone_number: nil)
122
+ super(version)
123
+
124
+ # Marshaled Properties
125
+ @properties = {
126
+ 'phone_number' => payload['phone_number'],
127
+ 'url' => payload['url'],
128
+ 'sid' => payload['sid'],
129
+ 'account_sid' => payload['account_sid'],
130
+ 'friendly_name' => payload['friendly_name'],
131
+ 'voice_region' => payload['voice_region'],
132
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
133
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
134
+ }
135
+
136
+ # Context
137
+ @instance_context = nil
138
+ @params = {'phone_number' => phone_number || @properties['phone_number'], }
139
+ end
140
+
141
+ ##
142
+ # Generate an instance context for the instance, the context is capable of
143
+ # performing various actions. All instance actions are proxied to the context
144
+ # @return [PhoneNumberContext] PhoneNumberContext for this PhoneNumberInstance
145
+ def context
146
+ unless @instance_context
147
+ @instance_context = PhoneNumberContext.new(@version, @params['phone_number'], )
148
+ end
149
+ @instance_context
150
+ end
151
+
152
+ ##
153
+ # @return [String] The phone number
154
+ def phone_number
155
+ @properties['phone_number']
156
+ end
157
+
158
+ ##
159
+ # @return [String] The absolute URL of the resource
160
+ def url
161
+ @properties['url']
162
+ end
163
+
164
+ ##
165
+ # @return [String] A string that uniquely identifies the Inbound Processing Region assignments for this phone number.
166
+ def sid
167
+ @properties['sid']
168
+ end
169
+
170
+ ##
171
+ # @return [String] Account Sid.
172
+ def account_sid
173
+ @properties['account_sid']
174
+ end
175
+
176
+ ##
177
+ # @return [String] A human readable description of the Inbound Processing Region assignments for this phone number.
178
+ def friendly_name
179
+ @properties['friendly_name']
180
+ end
181
+
182
+ ##
183
+ # @return [String] The Inbound Processing Region used for this phone number for voice.
184
+ def voice_region
185
+ @properties['voice_region']
186
+ end
187
+
188
+ ##
189
+ # @return [Time] The date that this phone number was assigned an Inbound Processing Region.
190
+ def date_created
191
+ @properties['date_created']
192
+ end
193
+
194
+ ##
195
+ # @return [Time] The date that the Inbound Processing Region was updated for this phone number.
196
+ def date_updated
197
+ @properties['date_updated']
198
+ end
199
+
200
+ ##
201
+ # Update the PhoneNumberInstance
202
+ # @param [String] voice_region The Inbound Processing Region used for this phone
203
+ # number for voice
204
+ # @param [String] friendly_name A human readable description of this resource, up
205
+ # to 64 characters.
206
+ # @return [PhoneNumberInstance] Updated PhoneNumberInstance
207
+ def update(voice_region: :unset, friendly_name: :unset)
208
+ context.update(voice_region: voice_region, friendly_name: friendly_name, )
209
+ end
210
+
211
+ ##
212
+ # Fetch the PhoneNumberInstance
213
+ # @return [PhoneNumberInstance] Fetched PhoneNumberInstance
214
+ def fetch
215
+ context.fetch
216
+ end
217
+
218
+ ##
219
+ # Provide a user friendly representation
220
+ def to_s
221
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
222
+ "<Twilio.Routes.V2.PhoneNumberInstance #{values}>"
223
+ end
224
+
225
+ ##
226
+ # Provide a detailed, user friendly representation
227
+ def inspect
228
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
229
+ "<Twilio.Routes.V2.PhoneNumberInstance #{values}>"
230
+ end
231
+ end
232
+ end
233
+ end
234
+ end
235
+ end
@@ -0,0 +1,231 @@
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 Routes < Domain
12
+ class V2 < Version
13
+ class SipDomainList < ListResource
14
+ ##
15
+ # Initialize the SipDomainList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [SipDomainList] SipDomainList
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.Routes.V2.SipDomainList>'
29
+ end
30
+ end
31
+
32
+ class SipDomainPage < Page
33
+ ##
34
+ # Initialize the SipDomainPage
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 [SipDomainPage] SipDomainPage
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 SipDomainInstance
48
+ # @param [Hash] payload Payload response from the API
49
+ # @return [SipDomainInstance] SipDomainInstance
50
+ def get_instance(payload)
51
+ SipDomainInstance.new(@version, payload, )
52
+ end
53
+
54
+ ##
55
+ # Provide a user friendly representation
56
+ def to_s
57
+ '<Twilio.Routes.V2.SipDomainPage>'
58
+ end
59
+ end
60
+
61
+ class SipDomainContext < InstanceContext
62
+ ##
63
+ # Initialize the SipDomainContext
64
+ # @param [Version] version Version that contains the resource
65
+ # @param [String] sip_domain The sip_domain
66
+ # @return [SipDomainContext] SipDomainContext
67
+ def initialize(version, sip_domain)
68
+ super(version)
69
+
70
+ # Path Solution
71
+ @solution = {sip_domain: sip_domain, }
72
+ @uri = "/SipDomains/#{@solution[:sip_domain]}"
73
+ end
74
+
75
+ ##
76
+ # Update the SipDomainInstance
77
+ # @param [String] voice_region The voice_region
78
+ # @param [String] friendly_name The friendly_name
79
+ # @return [SipDomainInstance] Updated SipDomainInstance
80
+ def update(voice_region: :unset, friendly_name: :unset)
81
+ data = Twilio::Values.of({'VoiceRegion' => voice_region, 'FriendlyName' => friendly_name, })
82
+
83
+ payload = @version.update('POST', @uri, data: data)
84
+
85
+ SipDomainInstance.new(@version, payload, sip_domain: @solution[:sip_domain], )
86
+ end
87
+
88
+ ##
89
+ # Fetch the SipDomainInstance
90
+ # @return [SipDomainInstance] Fetched SipDomainInstance
91
+ def fetch
92
+ payload = @version.fetch('GET', @uri)
93
+
94
+ SipDomainInstance.new(@version, payload, sip_domain: @solution[:sip_domain], )
95
+ end
96
+
97
+ ##
98
+ # Provide a user friendly representation
99
+ def to_s
100
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
101
+ "#<Twilio.Routes.V2.SipDomainContext #{context}>"
102
+ end
103
+
104
+ ##
105
+ # Provide a detailed, user friendly representation
106
+ def inspect
107
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
108
+ "#<Twilio.Routes.V2.SipDomainContext #{context}>"
109
+ end
110
+ end
111
+
112
+ class SipDomainInstance < InstanceResource
113
+ ##
114
+ # Initialize the SipDomainInstance
115
+ # @param [Version] version Version that contains the resource
116
+ # @param [Hash] payload payload that contains response from Twilio
117
+ # @param [String] sip_domain The sip_domain
118
+ # @return [SipDomainInstance] SipDomainInstance
119
+ def initialize(version, payload, sip_domain: nil)
120
+ super(version)
121
+
122
+ # Marshaled Properties
123
+ @properties = {
124
+ 'sip_domain' => payload['sip_domain'],
125
+ 'url' => payload['url'],
126
+ 'sid' => payload['sid'],
127
+ 'account_sid' => payload['account_sid'],
128
+ 'friendly_name' => payload['friendly_name'],
129
+ 'voice_region' => payload['voice_region'],
130
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
131
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
132
+ }
133
+
134
+ # Context
135
+ @instance_context = nil
136
+ @params = {'sip_domain' => sip_domain || @properties['sip_domain'], }
137
+ end
138
+
139
+ ##
140
+ # Generate an instance context for the instance, the context is capable of
141
+ # performing various actions. All instance actions are proxied to the context
142
+ # @return [SipDomainContext] SipDomainContext for this SipDomainInstance
143
+ def context
144
+ unless @instance_context
145
+ @instance_context = SipDomainContext.new(@version, @params['sip_domain'], )
146
+ end
147
+ @instance_context
148
+ end
149
+
150
+ ##
151
+ # @return [String] The sip_domain
152
+ def sip_domain
153
+ @properties['sip_domain']
154
+ end
155
+
156
+ ##
157
+ # @return [String] The url
158
+ def url
159
+ @properties['url']
160
+ end
161
+
162
+ ##
163
+ # @return [String] The sid
164
+ def sid
165
+ @properties['sid']
166
+ end
167
+
168
+ ##
169
+ # @return [String] The account_sid
170
+ def account_sid
171
+ @properties['account_sid']
172
+ end
173
+
174
+ ##
175
+ # @return [String] The friendly_name
176
+ def friendly_name
177
+ @properties['friendly_name']
178
+ end
179
+
180
+ ##
181
+ # @return [String] The voice_region
182
+ def voice_region
183
+ @properties['voice_region']
184
+ end
185
+
186
+ ##
187
+ # @return [Time] The date_created
188
+ def date_created
189
+ @properties['date_created']
190
+ end
191
+
192
+ ##
193
+ # @return [Time] The date_updated
194
+ def date_updated
195
+ @properties['date_updated']
196
+ end
197
+
198
+ ##
199
+ # Update the SipDomainInstance
200
+ # @param [String] voice_region The voice_region
201
+ # @param [String] friendly_name The friendly_name
202
+ # @return [SipDomainInstance] Updated SipDomainInstance
203
+ def update(voice_region: :unset, friendly_name: :unset)
204
+ context.update(voice_region: voice_region, friendly_name: friendly_name, )
205
+ end
206
+
207
+ ##
208
+ # Fetch the SipDomainInstance
209
+ # @return [SipDomainInstance] Fetched SipDomainInstance
210
+ def fetch
211
+ context.fetch
212
+ end
213
+
214
+ ##
215
+ # Provide a user friendly representation
216
+ def to_s
217
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
218
+ "<Twilio.Routes.V2.SipDomainInstance #{values}>"
219
+ end
220
+
221
+ ##
222
+ # Provide a detailed, user friendly representation
223
+ def inspect
224
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
225
+ "<Twilio.Routes.V2.SipDomainInstance #{values}>"
226
+ end
227
+ end
228
+ end
229
+ end
230
+ end
231
+ end