twilio-ruby 5.74.0 → 7.10.1

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 (796) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +1 -1
  3. data/.github/ISSUE_TEMPLATE/bug_report.yml +69 -0
  4. data/.github/workflows/test-and-deploy.yml +20 -2
  5. data/.gitignore +4 -0
  6. data/.rubocop.yml +1 -0
  7. data/CHANGES.md +1367 -0
  8. data/CONTRIBUTING.md +11 -9
  9. data/Dockerfile +2 -1
  10. data/Gemfile +5 -0
  11. data/LICENSE +1 -1
  12. data/Makefile +6 -0
  13. data/README.md +138 -40
  14. data/UPGRADE.md +21 -0
  15. data/advanced-examples/custom-http-client.md +170 -0
  16. data/cluster/cluster_oauth_spec.rb +19 -0
  17. data/cluster/cluster_orgs_spec.rb +40 -0
  18. data/cluster/cluster_spec.rb +75 -0
  19. data/examples/public_oauth.rb +13 -0
  20. data/lib/twilio-ruby/auth_strategy/auth_strategy.rb +19 -0
  21. data/lib/twilio-ruby/auth_strategy/no_auth_strategy.rb +17 -0
  22. data/lib/twilio-ruby/auth_strategy/token_auth_strategy.rb +39 -0
  23. data/lib/twilio-ruby/base/client_base.rb +131 -0
  24. data/lib/twilio-ruby/credential/auth_type.rb +17 -0
  25. data/lib/twilio-ruby/credential/client_credential_provider.rb +28 -0
  26. data/lib/twilio-ruby/credential/credential_provider.rb +11 -0
  27. data/lib/twilio-ruby/credential/orgs_credential_provider.rb +30 -0
  28. data/lib/twilio-ruby/framework/request.rb +8 -1
  29. data/lib/twilio-ruby/framework/rest/api_v1_version.rb +22 -0
  30. data/lib/twilio-ruby/framework/rest/domain.rb +0 -1
  31. data/lib/twilio-ruby/framework/rest/error.rb +27 -12
  32. data/lib/twilio-ruby/framework/rest/page.rb +1 -0
  33. data/lib/twilio-ruby/framework/rest/page_metadata.rb +83 -0
  34. data/lib/twilio-ruby/framework/rest/resource.rb +16 -0
  35. data/lib/twilio-ruby/framework/rest/token_page.rb +73 -0
  36. data/lib/twilio-ruby/framework/rest/version.rb +91 -4
  37. data/lib/twilio-ruby/http/client_token_manager.rb +31 -0
  38. data/lib/twilio-ruby/http/http_client.rb +22 -5
  39. data/lib/twilio-ruby/http/org_token_manager.rb +31 -0
  40. data/lib/twilio-ruby/jwt/access_token.rb +0 -59
  41. data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +338 -176
  42. data/lib/twilio-ruby/rest/accounts/v1/bulk_consents.rb +231 -0
  43. data/lib/twilio-ruby/rest/accounts/v1/bulk_contacts.rb +231 -0
  44. data/lib/twilio-ruby/rest/accounts/v1/credential/aws.rb +644 -332
  45. data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +644 -332
  46. data/lib/twilio-ruby/rest/accounts/v1/credential.rb +185 -114
  47. data/lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb +285 -0
  48. data/lib/twilio-ruby/rest/accounts/v1/safelist.rb +336 -0
  49. data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +378 -190
  50. data/lib/twilio-ruby/rest/accounts/v1.rb +69 -42
  51. data/lib/twilio-ruby/rest/accounts.rb +4 -34
  52. data/lib/twilio-ruby/rest/accounts_base.rb +38 -0
  53. data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +459 -365
  54. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +886 -530
  55. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +977 -586
  56. data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +482 -320
  57. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/local.rb +519 -0
  58. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/machine_to_machine.rb +519 -0
  59. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/mobile.rb +519 -0
  60. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/national.rb +519 -0
  61. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/shared_cost.rb +519 -0
  62. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/toll_free.rb +519 -0
  63. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/voip.rb +519 -0
  64. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb +601 -0
  65. data/lib/twilio-ruby/rest/api/v2010/account/balance.rb +231 -118
  66. data/lib/twilio-ruby/rest/api/v2010/account/call/event.rb +289 -192
  67. data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +578 -417
  68. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +556 -364
  69. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +791 -511
  70. data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +1658 -663
  71. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +1658 -663
  72. data/lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb +541 -0
  73. data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb +260 -151
  74. data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message_subscription.rb +409 -240
  75. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +1368 -1050
  76. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +1124 -756
  77. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +694 -458
  78. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +719 -493
  79. data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +679 -407
  80. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +483 -344
  81. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +627 -416
  82. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +737 -554
  83. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +737 -553
  84. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +737 -553
  85. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +1261 -903
  86. data/lib/twilio-ruby/rest/api/v2010/account/key.rb +567 -302
  87. data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +268 -164
  88. data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +540 -350
  89. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +970 -641
  90. data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +246 -125
  91. data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +246 -125
  92. data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +577 -399
  93. data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +604 -358
  94. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +553 -338
  95. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +702 -390
  96. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb +343 -0
  97. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +572 -378
  98. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +560 -383
  99. data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +558 -372
  100. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +718 -513
  101. data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +644 -408
  102. data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +567 -306
  103. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +642 -359
  104. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +667 -371
  105. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.rb +579 -0
  106. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.rb +579 -0
  107. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls.rb +204 -0
  108. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.rb +579 -0
  109. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations.rb +190 -0
  110. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb +158 -103
  111. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +564 -331
  112. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +564 -330
  113. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +987 -641
  114. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +694 -418
  115. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +667 -372
  116. data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +205 -150
  117. data/lib/twilio-ruby/rest/api/v2010/account/token.rb +258 -139
  118. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +557 -350
  119. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +407 -335
  120. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +407 -335
  121. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +407 -335
  122. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +407 -335
  123. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +407 -335
  124. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +407 -335
  125. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +407 -335
  126. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +407 -335
  127. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +478 -416
  128. data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +785 -484
  129. data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +176 -104
  130. data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +278 -150
  131. data/lib/twilio-ruby/rest/api/v2010/account.rb +1229 -943
  132. data/lib/twilio-ruby/rest/api/v2010.rb +126 -148
  133. data/lib/twilio-ruby/rest/api.rb +25 -34
  134. data/lib/twilio-ruby/rest/api_base.rb +38 -0
  135. data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb +550 -0
  136. data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb +550 -0
  137. data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +423 -0
  138. data/lib/twilio-ruby/rest/assistants/v1/assistant/message.rb +296 -0
  139. data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +918 -0
  140. data/lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb +317 -0
  141. data/lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb +349 -0
  142. data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +862 -0
  143. data/lib/twilio-ruby/rest/assistants/v1/policy.rb +356 -0
  144. data/lib/twilio-ruby/rest/assistants/v1/session/message.rb +352 -0
  145. data/lib/twilio-ruby/rest/assistants/v1/session.rb +493 -0
  146. data/lib/twilio-ruby/rest/assistants/v1/tool.rb +838 -0
  147. data/lib/twilio-ruby/rest/assistants/v1.rb +100 -0
  148. data/lib/twilio-ruby/rest/assistants.rb +6 -0
  149. data/lib/twilio-ruby/rest/assistants_base.rb +38 -0
  150. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +468 -279
  151. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +440 -279
  152. data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +438 -248
  153. data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +389 -235
  154. data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +430 -216
  155. data/lib/twilio-ruby/rest/bulkexports/v1.rb +57 -55
  156. data/lib/twilio-ruby/rest/bulkexports.rb +3 -34
  157. data/lib/twilio-ruby/rest/bulkexports_base.rb +38 -0
  158. data/lib/twilio-ruby/rest/chat/v1/credential.rb +719 -403
  159. data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +613 -391
  160. data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +704 -440
  161. data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +722 -437
  162. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +822 -515
  163. data/lib/twilio-ruby/rest/chat/v1/service/role.rb +672 -367
  164. data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +331 -237
  165. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +750 -440
  166. data/lib/twilio-ruby/rest/chat/v1/service.rb +1287 -894
  167. data/lib/twilio-ruby/rest/chat/v1.rb +57 -55
  168. data/lib/twilio-ruby/rest/chat/v2/credential.rb +719 -401
  169. data/lib/twilio-ruby/rest/chat/v2/service/binding.rb +570 -370
  170. data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +613 -386
  171. data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +799 -527
  172. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +825 -533
  173. data/lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb +746 -467
  174. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +916 -605
  175. data/lib/twilio-ruby/rest/chat/v2/service/role.rb +672 -369
  176. data/lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb +561 -381
  177. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +648 -419
  178. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +796 -491
  179. data/lib/twilio-ruby/rest/chat/v2/service.rb +1121 -778
  180. data/lib/twilio-ruby/rest/chat/v2.rb +57 -53
  181. data/lib/twilio-ruby/rest/chat/v3/channel.rb +444 -267
  182. data/lib/twilio-ruby/rest/chat/v3.rb +64 -41
  183. data/lib/twilio-ruby/rest/chat.rb +4 -48
  184. data/lib/twilio-ruby/rest/chat_base.rb +48 -0
  185. data/lib/twilio-ruby/rest/client.rb +338 -584
  186. data/lib/twilio-ruby/rest/content/v1/content/approval_create.rb +280 -0
  187. data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +327 -173
  188. data/lib/twilio-ruby/rest/content/v1/content.rb +1909 -334
  189. data/lib/twilio-ruby/rest/content/v1/content_and_approvals.rb +340 -0
  190. data/lib/twilio-ruby/rest/content/v1/legacy_content.rb +354 -0
  191. data/lib/twilio-ruby/rest/content/v1.rb +54 -38
  192. data/lib/twilio-ruby/rest/content/v2/content.rb +425 -0
  193. data/lib/twilio-ruby/rest/content/v2/content_and_approvals.rb +418 -0
  194. data/lib/twilio-ruby/rest/content/v2.rb +46 -0
  195. data/lib/twilio-ruby/rest/content.rb +2 -34
  196. data/lib/twilio-ruby/rest/content_base.rb +43 -0
  197. data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +798 -444
  198. data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +445 -227
  199. data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +467 -252
  200. data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +504 -344
  201. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +852 -495
  202. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +817 -495
  203. data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +725 -403
  204. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +957 -552
  205. data/lib/twilio-ruby/rest/conversations/v1/conversation_with_participants.rb +392 -0
  206. data/lib/twilio-ruby/rest/conversations/v1/credential.rb +728 -409
  207. data/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb +397 -304
  208. data/lib/twilio-ruby/rest/conversations/v1/role.rb +657 -356
  209. data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +563 -373
  210. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +540 -312
  211. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +459 -258
  212. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +497 -279
  213. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +504 -363
  214. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +860 -533
  215. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +829 -530
  216. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +737 -438
  217. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +972 -588
  218. data/lib/twilio-ruby/rest/conversations/v1/service/conversation_with_participants.rb +399 -0
  219. data/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb +403 -317
  220. data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +672 -380
  221. data/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +686 -455
  222. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +773 -474
  223. data/lib/twilio-ruby/rest/conversations/v1/service.rb +724 -447
  224. data/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +683 -435
  225. data/lib/twilio-ruby/rest/conversations/v1/user.rb +758 -441
  226. data/lib/twilio-ruby/rest/conversations/v1.rb +135 -136
  227. data/lib/twilio-ruby/rest/conversations.rb +9 -34
  228. data/lib/twilio-ruby/rest/conversations_base.rb +38 -0
  229. data/lib/twilio-ruby/rest/events/v1/event_type.rb +486 -288
  230. data/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +468 -0
  231. data/lib/twilio-ruby/rest/events/v1/schema.rb +366 -214
  232. data/lib/twilio-ruby/rest/events/v1/sink/sink_test.rb +209 -100
  233. data/lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb +222 -103
  234. data/lib/twilio-ruby/rest/events/v1/sink.rb +711 -408
  235. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +638 -339
  236. data/lib/twilio-ruby/rest/events/v1/subscription.rb +685 -387
  237. data/lib/twilio-ruby/rest/events/v1.rb +87 -87
  238. data/lib/twilio-ruby/rest/events.rb +5 -34
  239. data/lib/twilio-ruby/rest/events_base.rb +38 -0
  240. data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +687 -146
  241. data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +621 -330
  242. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +722 -496
  243. data/lib/twilio-ruby/rest/flex_api/v1/create_flex_instance.rb +382 -0
  244. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +928 -570
  245. data/lib/twilio-ruby/rest/flex_api/v1/insights_assessments_comment.rb +475 -0
  246. data/lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb +321 -0
  247. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb +735 -0
  248. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb +598 -0
  249. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +710 -0
  250. data/lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb +457 -0
  251. data/lib/twilio-ruby/rest/flex_api/v1/insights_session.rb +359 -0
  252. data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_answer_sets.rb +251 -0
  253. data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_comment.rb +237 -0
  254. data/lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb +338 -0
  255. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb +370 -227
  256. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +560 -319
  257. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_transfer.rb +547 -0
  258. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +637 -398
  259. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +529 -225
  260. data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +621 -0
  261. data/lib/twilio-ruby/rest/flex_api/v1/plugin.rb +700 -0
  262. data/lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb +390 -0
  263. data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration/configured_plugin.rb +564 -0
  264. data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration.rb +599 -0
  265. data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration_archive.rb +376 -0
  266. data/lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb +539 -0
  267. data/lib/twilio-ruby/rest/flex_api/v1/plugin_version_archive.rb +400 -0
  268. data/lib/twilio-ruby/rest/flex_api/v1/provisioning_status.rb +327 -0
  269. data/lib/twilio-ruby/rest/flex_api/v1/web_channel.rb +663 -331
  270. data/lib/twilio-ruby/rest/flex_api/v1.rb +319 -113
  271. data/lib/twilio-ruby/rest/flex_api/v2/flex_user.rb +515 -0
  272. data/lib/twilio-ruby/rest/flex_api/v2/web_channels.rb +258 -125
  273. data/lib/twilio-ruby/rest/flex_api/v2.rb +70 -28
  274. data/lib/twilio-ruby/rest/flex_api.rb +9 -47
  275. data/lib/twilio-ruby/rest/flex_api_base.rb +43 -0
  276. data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +453 -248
  277. data/lib/twilio-ruby/rest/frontline_api/v1.rb +42 -38
  278. data/lib/twilio-ruby/rest/frontline_api.rb +2 -34
  279. data/lib/twilio-ruby/rest/frontline_api_base.rb +38 -0
  280. data/lib/twilio-ruby/rest/iam/v1/api_key.rb +471 -0
  281. data/lib/twilio-ruby/rest/iam/v1/get_api_keys.rb +320 -0
  282. data/lib/twilio-ruby/rest/iam/v1/new_api_key.rb +284 -0
  283. data/lib/twilio-ruby/rest/iam/v1/o_auth_app.rb +646 -0
  284. data/lib/twilio-ruby/rest/iam/v1/token.rb +301 -0
  285. data/lib/twilio-ruby/rest/iam/v1.rb +82 -0
  286. data/lib/twilio-ruby/rest/iam.rb +6 -0
  287. data/lib/twilio-ruby/rest/iam_base.rb +33 -0
  288. data/lib/twilio-ruby/rest/insights/v1/call/annotation.rb +509 -315
  289. data/lib/twilio-ruby/rest/insights/v1/call/call_summary.rb +499 -0
  290. data/lib/twilio-ruby/rest/insights/v1/call/event.rb +360 -255
  291. data/lib/twilio-ruby/rest/insights/v1/call/metric.rb +333 -224
  292. data/lib/twilio-ruby/rest/insights/v1/call.rb +403 -236
  293. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +718 -433
  294. data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +665 -467
  295. data/lib/twilio-ruby/rest/insights/v1/conference.rb +683 -502
  296. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +545 -371
  297. data/lib/twilio-ruby/rest/insights/v1/room.rb +668 -489
  298. data/lib/twilio-ruby/rest/insights/v1/setting.rb +435 -205
  299. data/lib/twilio-ruby/rest/insights/v1.rb +84 -83
  300. data/lib/twilio-ruby/rest/insights.rb +6 -34
  301. data/lib/twilio-ruby/rest/insights_base.rb +38 -0
  302. data/lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb +720 -0
  303. data/lib/twilio-ruby/rest/intelligence/v2/operator.rb +525 -0
  304. data/lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb +380 -0
  305. data/lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb +337 -0
  306. data/lib/twilio-ruby/rest/intelligence/v2/operator_type.rb +523 -0
  307. data/lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb +525 -0
  308. data/lib/twilio-ruby/rest/intelligence/v2/service.rb +844 -0
  309. data/lib/twilio-ruby/rest/intelligence/v2/transcript/encrypted_operator_results.rb +359 -0
  310. data/lib/twilio-ruby/rest/intelligence/v2/transcript/encrypted_sentences.rb +359 -0
  311. data/lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb +373 -0
  312. data/lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb +570 -0
  313. data/lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb +354 -0
  314. data/lib/twilio-ruby/rest/intelligence/v2/transcript.rb +815 -0
  315. data/lib/twilio-ruby/rest/intelligence/v2.rb +176 -0
  316. data/lib/twilio-ruby/rest/intelligence.rb +6 -0
  317. data/lib/twilio-ruby/rest/intelligence_base.rb +38 -0
  318. data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +719 -364
  319. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +613 -359
  320. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +704 -397
  321. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +722 -409
  322. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +822 -488
  323. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +672 -347
  324. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +331 -231
  325. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +750 -418
  326. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +1287 -779
  327. data/lib/twilio-ruby/rest/ip_messaging/v1.rb +57 -53
  328. data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +719 -364
  329. data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +570 -343
  330. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +613 -359
  331. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +799 -451
  332. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +825 -479
  333. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +746 -411
  334. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +916 -555
  335. data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +672 -347
  336. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +561 -351
  337. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +637 -384
  338. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +796 -467
  339. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +1121 -689
  340. data/lib/twilio-ruby/rest/ip_messaging/v2.rb +57 -53
  341. data/lib/twilio-ruby/rest/ip_messaging.rb +3 -41
  342. data/lib/twilio-ruby/rest/ip_messaging_base.rb +43 -0
  343. data/lib/twilio-ruby/rest/knowledge/v1/knowledge/chunk.rb +317 -0
  344. data/lib/twilio-ruby/rest/knowledge/v1/knowledge/knowledge_status.rb +349 -0
  345. data/lib/twilio-ruby/rest/knowledge/v1/knowledge.rb +856 -0
  346. data/lib/twilio-ruby/rest/knowledge/v1.rb +49 -0
  347. data/lib/twilio-ruby/rest/knowledge.rb +6 -0
  348. data/lib/twilio-ruby/rest/knowledge_base.rb +38 -0
  349. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +399 -237
  350. data/lib/twilio-ruby/rest/lookups/v1.rb +42 -39
  351. data/lib/twilio-ruby/rest/lookups/v2/bucket.rb +500 -0
  352. data/lib/twilio-ruby/rest/lookups/v2/lookup_override.rb +603 -0
  353. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +570 -328
  354. data/lib/twilio-ruby/rest/lookups/v2/query.rb +351 -0
  355. data/lib/twilio-ruby/rest/lookups/v2/rate_limit.rb +229 -0
  356. data/lib/twilio-ruby/rest/lookups/v2.rb +128 -38
  357. data/lib/twilio-ruby/rest/lookups.rb +2 -41
  358. data/lib/twilio-ruby/rest/lookups_base.rb +43 -0
  359. data/lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb +475 -0
  360. data/lib/twilio-ruby/rest/marketplace/v1/available_add_on.rb +501 -0
  361. data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_extension.rb +555 -0
  362. data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_usage.rb +252 -0
  363. data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb +735 -0
  364. data/lib/twilio-ruby/rest/marketplace/v1/module_data.rb +342 -0
  365. data/lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb +511 -0
  366. data/lib/twilio-ruby/rest/marketplace/v1/referral_conversion.rb +235 -0
  367. data/lib/twilio-ruby/rest/marketplace/v1.rb +91 -0
  368. data/lib/twilio-ruby/rest/marketplace.rb +6 -0
  369. data/lib/twilio-ruby/rest/marketplace_base.rb +38 -0
  370. data/lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_registration_otp.rb +231 -0
  371. data/lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_vetting.rb +568 -346
  372. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +758 -443
  373. data/lib/twilio-ruby/rest/messaging/v1/deactivations.rb +337 -0
  374. data/lib/twilio-ruby/rest/messaging/v1/domain_certs.rb +483 -0
  375. data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +469 -259
  376. data/lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb +379 -0
  377. data/lib/twilio-ruby/rest/messaging/v1/domain_validate_dn.rb +344 -0
  378. data/lib/twilio-ruby/rest/messaging/v1/external_campaign.rb +263 -142
  379. data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb +380 -0
  380. data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service_domain_association.rb +337 -0
  381. data/lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb +379 -0
  382. data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +580 -335
  383. data/lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb +594 -0
  384. data/lib/twilio-ruby/rest/messaging/v1/service/destination_alpha_sender.rb +608 -0
  385. data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +587 -341
  386. data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +587 -336
  387. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +937 -521
  388. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +222 -115
  389. data/lib/twilio-ruby/rest/messaging/v1/service.rb +1149 -763
  390. data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +1517 -549
  391. data/lib/twilio-ruby/rest/messaging/v1/usecase.rb +209 -103
  392. data/lib/twilio-ruby/rest/messaging/v1.rb +217 -124
  393. data/lib/twilio-ruby/rest/messaging/v2/channels_sender.rb +1002 -0
  394. data/lib/twilio-ruby/rest/messaging/v2/domain_certs.rb +386 -0
  395. data/lib/twilio-ruby/rest/messaging/v2/typing_indicator.rb +237 -0
  396. data/lib/twilio-ruby/rest/messaging/v2.rb +70 -0
  397. data/lib/twilio-ruby/rest/messaging.rb +10 -35
  398. data/lib/twilio-ruby/rest/messaging_base.rb +43 -0
  399. data/lib/twilio-ruby/rest/monitor/v1/alert.rb +572 -395
  400. data/lib/twilio-ruby/rest/monitor/v1/event.rb +561 -390
  401. data/lib/twilio-ruby/rest/monitor/v1.rb +57 -53
  402. data/lib/twilio-ruby/rest/monitor.rb +3 -34
  403. data/lib/twilio-ruby/rest/monitor_base.rb +38 -0
  404. data/lib/twilio-ruby/rest/notify/v1/credential.rb +719 -408
  405. data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +694 -452
  406. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +466 -362
  407. data/lib/twilio-ruby/rest/notify/v1/service.rb +971 -622
  408. data/lib/twilio-ruby/rest/notify/v1.rb +57 -55
  409. data/lib/twilio-ruby/rest/notify.rb +3 -34
  410. data/lib/twilio-ruby/rest/notify_base.rb +38 -0
  411. data/lib/twilio-ruby/rest/numbers/v1/bulk_eligibility.rb +411 -0
  412. data/lib/twilio-ruby/rest/numbers/v1/eligibility.rb +221 -0
  413. data/lib/twilio-ruby/rest/numbers/v1/porting_all_port_in.rb +367 -0
  414. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +616 -0
  415. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb +485 -0
  416. data/lib/twilio-ruby/rest/numbers/v1/porting_portability.rb +405 -0
  417. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration.rb +242 -0
  418. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_delete.rb +301 -0
  419. data/lib/twilio-ruby/rest/numbers/v1/signing_request_configuration.rb +395 -0
  420. data/lib/twilio-ruby/rest/numbers/v1/webhook.rb +252 -0
  421. data/lib/twilio-ruby/rest/numbers/v1.rb +161 -0
  422. data/lib/twilio-ruby/rest/numbers/v2/application.rb +562 -0
  423. data/lib/twilio-ruby/rest/numbers/v2/authorization_document/dependent_hosted_number_order.rb +440 -0
  424. data/lib/twilio-ruby/rest/numbers/v2/authorization_document.rb +649 -0
  425. data/lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb +442 -0
  426. data/lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb +430 -0
  427. data/lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb +915 -0
  428. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +405 -261
  429. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +524 -298
  430. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb +564 -309
  431. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/replace_items.rb +294 -179
  432. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +923 -607
  433. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb +667 -351
  434. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb +458 -266
  435. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb +521 -307
  436. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +695 -371
  437. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb +458 -266
  438. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +241 -181
  439. data/lib/twilio-ruby/rest/numbers/v2.rb +108 -28
  440. data/lib/twilio-ruby/rest/numbers/v3/hosted_number_order.rb +484 -0
  441. data/lib/twilio-ruby/rest/numbers/v3.rb +40 -0
  442. data/lib/twilio-ruby/rest/numbers.rb +2 -34
  443. data/lib/twilio-ruby/rest/numbers_base.rb +48 -0
  444. data/lib/twilio-ruby/rest/oauth/v1/authorize.rb +253 -0
  445. data/lib/twilio-ruby/rest/oauth/v1/token.rb +293 -149
  446. data/lib/twilio-ruby/rest/oauth/v1.rb +39 -56
  447. data/lib/twilio-ruby/rest/oauth/v2/authorize.rb +253 -0
  448. data/lib/twilio-ruby/rest/oauth/v2/token.rb +311 -0
  449. data/lib/twilio-ruby/rest/oauth/v2.rb +46 -0
  450. data/lib/twilio-ruby/rest/oauth.rb +3 -65
  451. data/lib/twilio-ruby/rest/oauth_base.rb +43 -0
  452. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +469 -396
  453. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +724 -446
  454. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +960 -625
  455. data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +57 -55
  456. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +468 -298
  457. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +491 -309
  458. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +548 -330
  459. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +706 -398
  460. data/lib/twilio-ruby/rest/preview/marketplace.rb +57 -53
  461. data/lib/twilio-ruby/rest/preview/wireless/command.rb +616 -364
  462. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +743 -398
  463. data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +382 -205
  464. data/lib/twilio-ruby/rest/preview/wireless/sim.rb +833 -523
  465. data/lib/twilio-ruby/rest/preview/wireless.rb +72 -69
  466. data/lib/twilio-ruby/rest/preview.rb +10 -87
  467. data/lib/twilio-ruby/rest/preview_base.rb +48 -0
  468. data/lib/twilio-ruby/rest/preview_iam/v1/authorize.rb +253 -0
  469. data/lib/twilio-ruby/rest/preview_iam/v1/token.rb +301 -0
  470. data/lib/twilio-ruby/rest/preview_iam/v1.rb +46 -0
  471. data/lib/twilio-ruby/rest/preview_iam/versionless/organization/account.rb +468 -0
  472. data/lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb +559 -0
  473. data/lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb +768 -0
  474. data/lib/twilio-ruby/rest/preview_iam/versionless/organization.rb +413 -0
  475. data/lib/twilio-ruby/rest/preview_iam/versionless.rb +49 -0
  476. data/lib/twilio-ruby/rest/preview_iam.rb +9 -0
  477. data/lib/twilio-ruby/rest/preview_iam_base.rb +38 -0
  478. data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +465 -275
  479. data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +172 -120
  480. data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +458 -268
  481. data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +172 -120
  482. data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +465 -275
  483. data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +345 -179
  484. data/lib/twilio-ruby/rest/pricing/v1/voice.rb +185 -135
  485. data/lib/twilio-ruby/rest/pricing/v1.rb +45 -42
  486. data/lib/twilio-ruby/rest/pricing/v2/country.rb +457 -270
  487. data/lib/twilio-ruby/rest/pricing/v2/number.rb +379 -215
  488. data/lib/twilio-ruby/rest/pricing/v2/voice/country.rb +465 -275
  489. data/lib/twilio-ruby/rest/pricing/v2/voice/number.rb +367 -200
  490. data/lib/twilio-ruby/rest/pricing/v2/voice.rb +185 -138
  491. data/lib/twilio-ruby/rest/pricing/v2.rb +63 -65
  492. data/lib/twilio-ruby/rest/pricing.rb +6 -41
  493. data/lib/twilio-ruby/rest/pricing_base.rb +43 -0
  494. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +693 -403
  495. data/lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb +600 -418
  496. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +640 -447
  497. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +659 -440
  498. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +811 -506
  499. data/lib/twilio-ruby/rest/proxy/v1/service.rb +839 -596
  500. data/lib/twilio-ruby/rest/proxy/v1.rb +42 -38
  501. data/lib/twilio-ruby/rest/proxy.rb +2 -34
  502. data/lib/twilio-ruby/rest/proxy_base.rb +38 -0
  503. data/lib/twilio-ruby/rest/routes/v2/phone_number.rb +444 -227
  504. data/lib/twilio-ruby/rest/routes/v2/sip_domain.rb +444 -223
  505. data/lib/twilio-ruby/rest/routes/v2/trunk.rb +444 -227
  506. data/lib/twilio-ruby/rest/routes/v2.rb +72 -69
  507. data/lib/twilio-ruby/rest/routes.rb +4 -34
  508. data/lib/twilio-ruby/rest/routes_base.rb +38 -0
  509. data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +483 -323
  510. data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +680 -380
  511. data/lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb +350 -208
  512. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +645 -384
  513. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +549 -338
  514. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +535 -383
  515. data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +680 -396
  516. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +688 -447
  517. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +342 -210
  518. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +510 -353
  519. data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +680 -380
  520. data/lib/twilio-ruby/rest/serverless/v1/service.rb +803 -493
  521. data/lib/twilio-ruby/rest/serverless/v1.rb +42 -37
  522. data/lib/twilio-ruby/rest/serverless.rb +2 -34
  523. data/lib/twilio-ruby/rest/serverless_base.rb +38 -0
  524. data/lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb +350 -199
  525. data/lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb +342 -194
  526. data/lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb +545 -355
  527. data/lib/twilio-ruby/rest/studio/v1/flow/engagement.rb +659 -394
  528. data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_context.rb +350 -200
  529. data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step/execution_step_context.rb +342 -197
  530. data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step.rb +545 -361
  531. data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +748 -449
  532. data/lib/twilio-ruby/rest/studio/v1/flow.rb +572 -355
  533. data/lib/twilio-ruby/rest/studio/v1.rb +42 -37
  534. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +350 -200
  535. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +342 -197
  536. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +545 -361
  537. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +741 -442
  538. data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +510 -320
  539. data/lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb +413 -0
  540. data/lib/twilio-ruby/rest/studio/v2/flow.rb +804 -472
  541. data/lib/twilio-ruby/rest/studio/v2/flow_validate.rb +241 -109
  542. data/lib/twilio-ruby/rest/studio/v2.rb +48 -44
  543. data/lib/twilio-ruby/rest/studio.rb +3 -41
  544. data/lib/twilio-ruby/rest/studio_base.rb +43 -0
  545. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +611 -362
  546. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +757 -483
  547. data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +624 -406
  548. data/lib/twilio-ruby/rest/supersim/v1/network.rb +474 -297
  549. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +566 -332
  550. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +624 -351
  551. data/lib/twilio-ruby/rest/supersim/v1/settings_update.rb +339 -237
  552. data/lib/twilio-ruby/rest/supersim/v1/sim/billing_period.rb +311 -204
  553. data/lib/twilio-ruby/rest/supersim/v1/sim/sim_ip_address.rb +275 -174
  554. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +725 -453
  555. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +576 -361
  556. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +410 -344
  557. data/lib/twilio-ruby/rest/supersim/v1.rb +144 -147
  558. data/lib/twilio-ruby/rest/supersim.rb +10 -34
  559. data/lib/twilio-ruby/rest/supersim_base.rb +38 -0
  560. data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +616 -371
  561. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +736 -423
  562. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +766 -490
  563. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +616 -370
  564. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +749 -445
  565. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +772 -495
  566. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +616 -368
  567. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +749 -444
  568. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb +242 -132
  569. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +692 -400
  570. data/lib/twilio-ruby/rest/sync/v1/service.rb +878 -567
  571. data/lib/twilio-ruby/rest/sync/v1.rb +42 -37
  572. data/lib/twilio-ruby/rest/sync.rb +2 -34
  573. data/lib/twilio-ruby/rest/sync_base.rb +38 -0
  574. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +682 -395
  575. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +633 -464
  576. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +1079 -749
  577. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +985 -661
  578. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +688 -382
  579. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.rb +258 -0
  580. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +522 -370
  581. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +430 -276
  582. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +410 -254
  583. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +358 -276
  584. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +882 -572
  585. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +1053 -732
  586. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +602 -388
  587. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +394 -239
  588. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +440 -266
  589. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +364 -193
  590. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +418 -234
  591. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +927 -637
  592. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +522 -376
  593. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +395 -241
  594. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +410 -262
  595. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +822 -510
  596. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +514 -356
  597. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +379 -205
  598. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +387 -219
  599. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +1022 -730
  600. data/lib/twilio-ruby/rest/taskrouter/v1.rb +42 -37
  601. data/lib/twilio-ruby/rest/taskrouter.rb +2 -34
  602. data/lib/twilio-ruby/rest/taskrouter_base.rb +38 -0
  603. data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +573 -320
  604. data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +573 -317
  605. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +734 -419
  606. data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +706 -451
  607. data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +391 -174
  608. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +939 -630
  609. data/lib/twilio-ruby/rest/trunking/v1.rb +42 -38
  610. data/lib/twilio-ruby/rest/trunking.rb +2 -34
  611. data/lib/twilio-ruby/rest/trunking_base.rb +38 -0
  612. data/lib/twilio-ruby/rest/trusthub/v1/compliance_inquiries.rb +440 -0
  613. data/lib/twilio-ruby/rest/trusthub/v1/compliance_registration_inquiries.rb +656 -0
  614. data/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +474 -0
  615. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb +595 -352
  616. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb +574 -323
  617. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.rb +540 -321
  618. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +823 -513
  619. data/lib/twilio-ruby/rest/trusthub/v1/end_user.rb +659 -346
  620. data/lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb +450 -261
  621. data/lib/twilio-ruby/rest/trusthub/v1/policies.rb +443 -252
  622. data/lib/twilio-ruby/rest/trusthub/v1/supporting_document.rb +673 -359
  623. data/lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb +450 -261
  624. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb +595 -352
  625. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_entity_assignments.rb +574 -323
  626. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb +540 -321
  627. data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +823 -513
  628. data/lib/twilio-ruby/rest/trusthub/v1.rb +168 -139
  629. data/lib/twilio-ruby/rest/trusthub.rb +8 -34
  630. data/lib/twilio-ruby/rest/trusthub_base.rb +38 -0
  631. data/lib/twilio-ruby/rest/verify/v2/form.rb +334 -181
  632. data/lib/twilio-ruby/rest/verify/v2/safelist.rb +423 -205
  633. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +463 -254
  634. data/lib/twilio-ruby/rest/verify/v2/service/approve_challenge.rb +402 -0
  635. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +275 -172
  636. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +768 -530
  637. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +705 -453
  638. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +386 -271
  639. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +653 -414
  640. data/lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb +652 -363
  641. data/lib/twilio-ruby/rest/verify/v2/service/new_challenge.rb +478 -0
  642. data/lib/twilio-ruby/rest/verify/v2/service/new_factor.rb +387 -0
  643. data/lib/twilio-ruby/rest/verify/v2/service/new_verify_factor.rb +357 -0
  644. data/lib/twilio-ruby/rest/verify/v2/service/rate_limit/bucket.rb +680 -388
  645. data/lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb +693 -384
  646. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +655 -366
  647. data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +320 -187
  648. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +741 -412
  649. data/lib/twilio-ruby/rest/verify/v2/service.rb +1360 -780
  650. data/lib/twilio-ruby/rest/verify/v2/template.rb +310 -203
  651. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +556 -387
  652. data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +400 -224
  653. data/lib/twilio-ruby/rest/verify/v2.rb +99 -103
  654. data/lib/twilio-ruby/rest/verify.rb +7 -34
  655. data/lib/twilio-ruby/rest/verify_base.rb +38 -0
  656. data/lib/twilio-ruby/rest/video/v1/composition.rb +738 -507
  657. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +854 -647
  658. data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +475 -261
  659. data/lib/twilio-ruby/rest/video/v1/recording.rb +631 -426
  660. data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +475 -261
  661. data/lib/twilio-ruby/rest/video/v1/room/participant/anonymize.rb +403 -0
  662. data/lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb +501 -0
  663. data/lib/twilio-ruby/rest/video/v1/room/participant/subscribe_rules.rb +316 -0
  664. data/lib/twilio-ruby/rest/video/v1/room/participant/subscribed_track.rb +508 -0
  665. data/lib/twilio-ruby/rest/video/v1/room/participant.rb +714 -0
  666. data/lib/twilio-ruby/rest/video/v1/room/recording_rules.rb +303 -0
  667. data/lib/twilio-ruby/rest/video/v1/room/room_recording.rb +624 -0
  668. data/lib/twilio-ruby/rest/video/v1/room/transcriptions.rb +648 -0
  669. data/lib/twilio-ruby/rest/video/v1/room.rb +938 -602
  670. data/lib/twilio-ruby/rest/video/v1.rb +99 -99
  671. data/lib/twilio-ruby/rest/video.rb +7 -34
  672. data/lib/twilio-ruby/rest/video_base.rb +38 -0
  673. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +292 -174
  674. data/lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb +822 -486
  675. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +734 -434
  676. data/lib/twilio-ruby/rest/voice/v1/connection_policy.rb +658 -352
  677. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/bulk_country_update.rb +236 -121
  678. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.rb +282 -181
  679. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +553 -397
  680. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb +377 -173
  681. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +187 -122
  682. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +650 -339
  683. data/lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb +630 -319
  684. data/lib/twilio-ruby/rest/voice/v1.rb +130 -117
  685. data/lib/twilio-ruby/rest/voice.rb +7 -34
  686. data/lib/twilio-ruby/rest/voice_base.rb +38 -0
  687. data/lib/twilio-ruby/rest/wireless/v1/command.rb +663 -406
  688. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +769 -436
  689. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +387 -284
  690. data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +317 -226
  691. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +925 -647
  692. data/lib/twilio-ruby/rest/wireless/v1/usage_record.rb +319 -219
  693. data/lib/twilio-ruby/rest/wireless/v1.rb +78 -76
  694. data/lib/twilio-ruby/rest/wireless.rb +5 -34
  695. data/lib/twilio-ruby/rest/wireless_base.rb +38 -0
  696. data/lib/twilio-ruby/rest.rb +1 -0
  697. data/lib/twilio-ruby/twiml/messaging_response.rb +1 -1
  698. data/lib/twilio-ruby/twiml/voice_response.rb +481 -26
  699. data/lib/twilio-ruby/version.rb +1 -1
  700. data/sonar-project.properties +1 -1
  701. data/twilio-ruby.gemspec +3 -2
  702. metadata +238 -105
  703. data/conf/cacert.pem +0 -3376
  704. data/lib/twilio-ruby/framework/twilio_response.rb +0 -19
  705. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +0 -500
  706. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +0 -500
  707. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +0 -500
  708. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +0 -500
  709. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +0 -500
  710. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +0 -500
  711. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +0 -500
  712. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +0 -464
  713. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +0 -301
  714. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +0 -314
  715. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb +0 -348
  716. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping.rb +0 -348
  717. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping.rb +0 -163
  718. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.rb +0 -348
  719. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping.rb +0 -137
  720. data/lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb +0 -220
  721. data/lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb +0 -214
  722. data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +0 -399
  723. data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb +0 -418
  724. data/lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb +0 -392
  725. data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +0 -469
  726. data/lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb +0 -218
  727. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb +0 -386
  728. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +0 -456
  729. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb +0 -255
  730. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +0 -237
  731. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb +0 -507
  732. data/lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb +0 -420
  733. data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +0 -650
  734. data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +0 -194
  735. data/lib/twilio-ruby/rest/autopilot/v1.rb +0 -52
  736. data/lib/twilio-ruby/rest/autopilot.rb +0 -53
  737. data/lib/twilio-ruby/rest/events/v1/schema/version.rb +0 -290
  738. data/lib/twilio-ruby/rest/flex_api/v1/good_data.rb +0 -190
  739. data/lib/twilio-ruby/rest/flex_api/v1/user_roles.rb +0 -166
  740. data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +0 -321
  741. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +0 -397
  742. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +0 -399
  743. data/lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb +0 -221
  744. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +0 -403
  745. data/lib/twilio-ruby/rest/media/v1.rb +0 -76
  746. data/lib/twilio-ruby/rest/media.rb +0 -65
  747. data/lib/twilio-ruby/rest/messaging/v1/deactivation.rb +0 -164
  748. data/lib/twilio-ruby/rest/messaging/v1/domain_cert.rb +0 -257
  749. data/lib/twilio-ruby/rest/microvisor/v1/app.rb +0 -305
  750. data/lib/twilio-ruby/rest/microvisor/v1/device.rb +0 -339
  751. data/lib/twilio-ruby/rest/microvisor/v1.rb +0 -60
  752. data/lib/twilio-ruby/rest/microvisor.rb +0 -54
  753. data/lib/twilio-ruby/rest/oauth/v1/device_code.rb +0 -153
  754. data/lib/twilio-ruby/rest/oauth/v1/oauth.rb +0 -162
  755. data/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb +0 -242
  756. data/lib/twilio-ruby/rest/oauth/v1/user_info.rb +0 -193
  757. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb +0 -382
  758. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb +0 -365
  759. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb +0 -425
  760. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb +0 -376
  761. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +0 -469
  762. data/lib/twilio-ruby/rest/preview/deployed_devices.rb +0 -45
  763. data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +0 -385
  764. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +0 -406
  765. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +0 -418
  766. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +0 -385
  767. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +0 -405
  768. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +0 -415
  769. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +0 -385
  770. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +0 -405
  771. data/lib/twilio-ruby/rest/preview/sync/service.rb +0 -462
  772. data/lib/twilio-ruby/rest/preview/sync.rb +0 -44
  773. data/lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb +0 -212
  774. data/lib/twilio-ruby/rest/preview/understand/assistant/assistant_initiation_actions.rb +0 -212
  775. data/lib/twilio-ruby/rest/preview/understand/assistant/dialogue.rb +0 -206
  776. data/lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb +0 -386
  777. data/lib/twilio-ruby/rest/preview/understand/assistant/field_type.rb +0 -407
  778. data/lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb +0 -380
  779. data/lib/twilio-ruby/rest/preview/understand/assistant/query.rb +0 -437
  780. data/lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb +0 -212
  781. data/lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb +0 -373
  782. data/lib/twilio-ruby/rest/preview/understand/assistant/task/sample.rb +0 -428
  783. data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_actions.rb +0 -241
  784. data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +0 -225
  785. data/lib/twilio-ruby/rest/preview/understand/assistant/task.rb +0 -495
  786. data/lib/twilio-ruby/rest/preview/understand/assistant.rb +0 -629
  787. data/lib/twilio-ruby/rest/preview/understand.rb +0 -45
  788. data/lib/twilio-ruby/rest/proxy/v1/service/short_code.rb +0 -377
  789. data/lib/twilio-ruby/rest/studio/v2/flow/test_user.rb +0 -199
  790. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +0 -413
  791. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_anonymize.rb +0 -240
  792. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb +0 -335
  793. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +0 -175
  794. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb +0 -340
  795. data/lib/twilio-ruby/rest/video/v1/room/room_participant.rb +0 -499
  796. data/lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb +0 -144
@@ -1,1057 +1,1375 @@
1
1
  ##
2
- # This code was generated by
3
- # \ / _ _ _| _ _
4
- # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
- # / /
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Api
8
+ # This is the public Twilio REST API.
9
+ #
10
+ # NOTE: This class is auto generated by OpenAPI Generator.
11
+ # https://openapi-generator.tech
12
+ # Do not edit the class manually.
6
13
  #
7
- # frozen_string_literal: true
8
-
9
- module Twilio
10
- module REST
11
- class Api < Domain
12
- class V2010 < Version
13
- class AccountContext < InstanceContext
14
- class CallList < ListResource
15
- ##
16
- # Initialize the CallList
17
- # @param [Version] version Version that contains the resource
18
- # @param [String] account_sid The SID of the
19
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Call
20
- # resource.
21
- # @return [CallList] CallList
22
- def initialize(version, account_sid: nil)
23
- super(version)
24
-
25
- # Path Solution
26
- @solution = {account_sid: account_sid}
27
- @uri = "/Accounts/#{@solution[:account_sid]}/Calls.json"
28
-
29
- # Components
30
- @feedback_summaries = nil
31
- end
32
-
33
- ##
34
- # Create the CallInstance
35
- # @param [String] to The phone number, SIP address, or client identifier to call.
36
- # @param [String] from The phone number or client identifier to use as the caller
37
- # id. If using a phone number, it must be a Twilio number or a Verified {outgoing
38
- # caller id}[https://www.twilio.com/docs/voice/api/outgoing-caller-ids] for your
39
- # account. If the `to` parameter is a phone number, `From` must also be a phone
40
- # number.
41
- # @param [String] method The HTTP method we should use when calling the `url`
42
- # parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an
43
- # `application_sid` parameter is present, this parameter is ignored.
44
- # @param [String] fallback_url The URL that we call using the `fallback_method` if
45
- # an error occurs when requesting or executing the TwiML at `url`. If an
46
- # `application_sid` parameter is present, this parameter is ignored.
47
- # @param [String] fallback_method The HTTP method that we should use to request
48
- # the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an
49
- # `application_sid` parameter is present, this parameter is ignored.
50
- # @param [String] status_callback The URL we should call using the
51
- # `status_callback_method` to send status information to your application. If no
52
- # `status_callback_event` is specified, we will send the `completed` status. If an
53
- # `application_sid` parameter is present, this parameter is ignored. URLs must
54
- # contain a valid hostname (underscores are not permitted).
55
- # @param [Array[String]] status_callback_event The call progress events that we
56
- # will send to the `status_callback` URL. Can be: `initiated`, `ringing`,
57
- # `answered`, and `completed`. If no event is specified, we send the `completed`
58
- # status. If you want to receive multiple events, specify each one in a separate
59
- # `status_callback_event` parameter. See the code sample for {monitoring call
60
- # progress}[https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json].
61
- # If an `application_sid` is present, this parameter is ignored.
62
- # @param [String] status_callback_method The HTTP method we should use when
63
- # calling the `status_callback` URL. Can be: `GET` or `POST` and the default is
64
- # `POST`. If an `application_sid` parameter is present, this parameter is ignored.
65
- # @param [String] send_digits A string of keys to dial after connecting to the
66
- # number, maximum of 32 digits. Valid digits in the string include: any digit
67
- # (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example,
68
- # if you connected to a company phone number and wanted to pause for one second,
69
- # and then dial extension 1234 followed by the pound key, the value of this
70
- # parameter would be `ww1234#`. Remember to URL-encode this string, since the
71
- # '`#`' character has special meaning in a URL. If both `SendDigits` and
72
- # `MachineDetection` parameters are provided, then `MachineDetection` will be
73
- # ignored.
74
- # @param [String] timeout The integer number of seconds that we should allow the
75
- # phone to ring before assuming there is no answer. The default is `60` seconds
76
- # and the maximum is `600` seconds. For some call flows, we will add a 5-second
77
- # buffer to the timeout value you provide. For this reason, a timeout value of 10
78
- # seconds could result in an actual timeout closer to 15 seconds. You can set this
79
- # to a short time, such as `15` seconds, to hang up before reaching an answering
80
- # machine or voicemail.
81
- # @param [Boolean] record Whether to record the call. Can be `true` to record the
82
- # phone call, or `false` to not. The default is `false`. The `recording_url` is
83
- # sent to the `status_callback` URL.
84
- # @param [String] recording_channels The number of channels in the final
85
- # recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both
86
- # legs of the call in a single channel of the recording file. `dual` records each
87
- # leg to a separate channel of the recording file. The first channel of a
88
- # dual-channel recording contains the parent call and the second channel contains
89
- # the child call.
90
- # @param [String] recording_status_callback The URL that we call when the
91
- # recording is available to be accessed.
92
- # @param [String] recording_status_callback_method The HTTP method we should use
93
- # when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and
94
- # the default is `POST`.
95
- # @param [String] sip_auth_username The username used to authenticate the caller
96
- # making a SIP call.
97
- # @param [String] sip_auth_password The password required to authenticate the user
98
- # account specified in `sip_auth_username`.
99
- # @param [String] machine_detection Whether to detect if a human, answering
100
- # machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`.
101
- # Use `Enable` if you would like us to return `AnsweredBy` as soon as the called
102
- # party is identified. Use `DetectMessageEnd`, if you would like to leave a
103
- # message on an answering machine. If `send_digits` is provided, this parameter is
104
- # ignored. For more information, see {Answering Machine
105
- # Detection}[https://www.twilio.com/docs/voice/answering-machine-detection].
106
- # @param [String] machine_detection_timeout The number of seconds that we should
107
- # attempt to detect an answering machine before timing out and sending a voice
108
- # request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds.
109
- # @param [Array[String]] recording_status_callback_event The recording status
110
- # events that will trigger calls to the URL specified in
111
- # `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`.
112
- # Defaults to `completed`. Separate multiple values with a space.
113
- # @param [String] trim Whether to trim any leading and trailing silence from the
114
- # recording. Can be: `trim-silence` or `do-not-trim` and the default is
115
- # `trim-silence`.
116
- # @param [String] caller_id The phone number, SIP address, or Client identifier
117
- # that made this call. Phone numbers are in {E.164
118
- # format}[https://wwnw.twilio.com/docs/glossary/what-e164] (e.g., +16175551212).
119
- # SIP addresses are formatted as `name@company.com`.
120
- # @param [String] machine_detection_speech_threshold The number of milliseconds
121
- # that is used as the measuring stick for the length of the speech activity, where
122
- # durations lower than this value will be interpreted as a human and longer than
123
- # this value as a machine. Possible Values: 1000-6000. Default: 2400.
124
- # @param [String] machine_detection_speech_end_threshold The number of
125
- # milliseconds of silence after speech activity at which point the speech activity
126
- # is considered complete. Possible Values: 500-5000. Default: 1200.
127
- # @param [String] machine_detection_silence_timeout The number of milliseconds of
128
- # initial silence after which an `unknown` AnsweredBy result will be returned.
129
- # Possible Values: 2000-10000. Default: 5000.
130
- # @param [String] async_amd Select whether to perform answering machine detection
131
- # in the background. Default, blocks the execution of the call until Answering
132
- # Machine Detection is completed. Can be: `true` or `false`.
133
- # @param [String] async_amd_status_callback The URL that we should call using the
134
- # `async_amd_status_callback_method` to notify customer application whether the
135
- # call was answered by human, machine or fax.
136
- # @param [String] async_amd_status_callback_method The HTTP method we should use
137
- # when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and
138
- # the default is `POST`.
139
- # @param [String] byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route
140
- # this call with. Note that `byoc` is only meaningful when `to` is a phone number;
141
- # it will otherwise be ignored. (Beta)
142
- # @param [String] call_reason The Reason for the outgoing call. Use it to specify
143
- # the purpose of the call that is presented on the called party's phone. (Branded
144
- # Calls Beta)
145
- # @param [String] call_token A token string needed to invoke a forwarded call. A
146
- # call_token is generated when an incoming call is received on a Twilio number.
147
- # Pass an incoming call's call_token value to a forwarded call via the call_token
148
- # parameter when creating a new call. A forwarded call should bear the same
149
- # CallerID of the original incoming call.
150
- # @param [String] recording_track The audio track to record for the call. Can be:
151
- # `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the
152
- # audio that is received by Twilio. `outbound` records the audio that is generated
153
- # from Twilio. `both` records the audio that is received and generated by Twilio.
154
- # @param [String] time_limit The maximum duration of the call in seconds.
155
- # Constraints depend on account and configuration.
156
- # @param [String] url The absolute URL that returns the TwiML instructions for the
157
- # call. We will call this URL using the `method` when the call connects. For more
158
- # information, see the {Url
159
- # Parameter}[https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter]
160
- # section in {Making Calls}[https://www.twilio.com/docs/voice/make-calls].
161
- # @param [String] twiml TwiML instructions for the call Twilio will use without
162
- # fetching Twiml from url parameter. If both `twiml` and `url` are provided then
163
- # `twiml` parameter will be ignored. Max 4000 characters.
164
- # @param [String] application_sid The SID of the Application resource that will
165
- # handle the call, if the call will be handled by an application.
166
- # @return [CallInstance] Created CallInstance
167
- def create(to: nil, from: nil, method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_event: :unset, status_callback_method: :unset, send_digits: :unset, timeout: :unset, record: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, machine_detection: :unset, machine_detection_timeout: :unset, recording_status_callback_event: :unset, trim: :unset, caller_id: :unset, machine_detection_speech_threshold: :unset, machine_detection_speech_end_threshold: :unset, machine_detection_silence_timeout: :unset, async_amd: :unset, async_amd_status_callback: :unset, async_amd_status_callback_method: :unset, byoc: :unset, call_reason: :unset, call_token: :unset, recording_track: :unset, time_limit: :unset, url: :unset, twiml: :unset, application_sid: :unset)
168
- data = Twilio::Values.of({
169
- 'To' => to,
170
- 'From' => from,
171
- 'Url' => url,
172
- 'Twiml' => twiml,
173
- 'ApplicationSid' => application_sid,
174
- 'Method' => method,
175
- 'FallbackUrl' => fallback_url,
176
- 'FallbackMethod' => fallback_method,
177
- 'StatusCallback' => status_callback,
178
- 'StatusCallbackEvent' => Twilio.serialize_list(status_callback_event) { |e| e },
179
- 'StatusCallbackMethod' => status_callback_method,
180
- 'SendDigits' => send_digits,
181
- 'Timeout' => timeout,
182
- 'Record' => record,
183
- 'RecordingChannels' => recording_channels,
184
- 'RecordingStatusCallback' => recording_status_callback,
185
- 'RecordingStatusCallbackMethod' => recording_status_callback_method,
186
- 'SipAuthUsername' => sip_auth_username,
187
- 'SipAuthPassword' => sip_auth_password,
188
- 'MachineDetection' => machine_detection,
189
- 'MachineDetectionTimeout' => machine_detection_timeout,
190
- 'RecordingStatusCallbackEvent' => Twilio.serialize_list(recording_status_callback_event) { |e| e },
191
- 'Trim' => trim,
192
- 'CallerId' => caller_id,
193
- 'MachineDetectionSpeechThreshold' => machine_detection_speech_threshold,
194
- 'MachineDetectionSpeechEndThreshold' => machine_detection_speech_end_threshold,
195
- 'MachineDetectionSilenceTimeout' => machine_detection_silence_timeout,
196
- 'AsyncAmd' => async_amd,
197
- 'AsyncAmdStatusCallback' => async_amd_status_callback,
198
- 'AsyncAmdStatusCallbackMethod' => async_amd_status_callback_method,
199
- 'Byoc' => byoc,
200
- 'CallReason' => call_reason,
201
- 'CallToken' => call_token,
202
- 'RecordingTrack' => recording_track,
203
- 'TimeLimit' => time_limit,
204
- })
205
-
206
- payload = @version.create('POST', @uri, data: data)
207
-
208
- CallInstance.new(@version, payload, account_sid: @solution[:account_sid], )
209
- end
210
-
211
- ##
212
- # Lists CallInstance records from the API as a list.
213
- # Unlike stream(), this operation is eager and will load `limit` records into
214
- # memory before returning.
215
- # @param [String] to Only show calls made to this phone number, SIP address,
216
- # Client identifier or SIM SID.
217
- # @param [String] from Only include calls from this phone number, SIP address,
218
- # Client identifier or SIM SID.
219
- # @param [String] parent_call_sid Only include calls spawned by calls with this
220
- # SID.
221
- # @param [call.Status] status The status of the calls to include. Can be:
222
- # `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`,
223
- # or `no-answer`.
224
- # @param [Time] start_time_before Only include calls that started on this date
225
- # @param [Time] start_time Only include calls that started on this date
226
- # @param [Time] start_time_after Only include calls that started on this date
227
- # @param [Time] end_time_before Only include calls that ended on this date
228
- # @param [Time] end_time Only include calls that ended on this date
229
- # @param [Time] end_time_after Only include calls that ended on this date
230
- # @param [Integer] limit Upper limit for the number of records to return. stream()
231
- # guarantees to never return more than limit. Default is no limit
232
- # @param [Integer] page_size Number of records to fetch per request, when
233
- # not set will use the default value of 50 records. If no page_size is defined
234
- # but a limit is defined, stream() will attempt to read the limit with the most
235
- # efficient page size, i.e. min(limit, 1000)
236
- # @return [Array] Array of up to limit results
237
- def list(to: :unset, from: :unset, parent_call_sid: :unset, status: :unset, start_time_before: :unset, start_time: :unset, start_time_after: :unset, end_time_before: :unset, end_time: :unset, end_time_after: :unset, limit: nil, page_size: nil)
238
- self.stream(
239
- to: to,
240
- from: from,
241
- parent_call_sid: parent_call_sid,
242
- status: status,
243
- start_time_before: start_time_before,
244
- start_time: start_time,
245
- start_time_after: start_time_after,
246
- end_time_before: end_time_before,
247
- end_time: end_time,
248
- end_time_after: end_time_after,
249
- limit: limit,
250
- page_size: page_size
251
- ).entries
252
- end
253
-
254
- ##
255
- # Streams CallInstance records from the API as an Enumerable.
256
- # This operation lazily loads records as efficiently as possible until the limit
257
- # is reached.
258
- # @param [String] to Only show calls made to this phone number, SIP address,
259
- # Client identifier or SIM SID.
260
- # @param [String] from Only include calls from this phone number, SIP address,
261
- # Client identifier or SIM SID.
262
- # @param [String] parent_call_sid Only include calls spawned by calls with this
263
- # SID.
264
- # @param [call.Status] status The status of the calls to include. Can be:
265
- # `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`,
266
- # or `no-answer`.
267
- # @param [Time] start_time_before Only include calls that started on this date
268
- # @param [Time] start_time Only include calls that started on this date
269
- # @param [Time] start_time_after Only include calls that started on this date
270
- # @param [Time] end_time_before Only include calls that ended on this date
271
- # @param [Time] end_time Only include calls that ended on this date
272
- # @param [Time] end_time_after Only include calls that ended on this date
273
- # @param [Integer] limit Upper limit for the number of records to return. stream()
274
- # guarantees to never return more than limit. Default is no limit.
275
- # @param [Integer] page_size Number of records to fetch per request, when
276
- # not set will use the default value of 50 records. If no page_size is defined
277
- # but a limit is defined, stream() will attempt to read the limit with the most
278
- # efficient page size, i.e. min(limit, 1000)
279
- # @return [Enumerable] Enumerable that will yield up to limit results
280
- def stream(to: :unset, from: :unset, parent_call_sid: :unset, status: :unset, start_time_before: :unset, start_time: :unset, start_time_after: :unset, end_time_before: :unset, end_time: :unset, end_time_after: :unset, limit: nil, page_size: nil)
281
- limits = @version.read_limits(limit, page_size)
282
-
283
- page = self.page(
284
- to: to,
285
- from: from,
286
- parent_call_sid: parent_call_sid,
287
- status: status,
288
- start_time_before: start_time_before,
289
- start_time: start_time,
290
- start_time_after: start_time_after,
291
- end_time_before: end_time_before,
292
- end_time: end_time,
293
- end_time_after: end_time_after,
294
- page_size: limits[:page_size],
295
- )
296
-
297
- @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
298
- end
299
-
300
- ##
301
- # When passed a block, yields CallInstance records from the API.
302
- # This operation lazily loads records as efficiently as possible until the limit
303
- # is reached.
304
- def each
305
- limits = @version.read_limits
306
-
307
- page = self.page(page_size: limits[:page_size], )
308
-
309
- @version.stream(page,
310
- limit: limits[:limit],
311
- page_limit: limits[:page_limit]).each {|x| yield x}
312
- end
313
-
314
- ##
315
- # Retrieve a single page of CallInstance records from the API.
316
- # Request is executed immediately.
317
- # @param [String] to Only show calls made to this phone number, SIP address,
318
- # Client identifier or SIM SID.
319
- # @param [String] from Only include calls from this phone number, SIP address,
320
- # Client identifier or SIM SID.
321
- # @param [String] parent_call_sid Only include calls spawned by calls with this
322
- # SID.
323
- # @param [call.Status] status The status of the calls to include. Can be:
324
- # `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`,
325
- # or `no-answer`.
326
- # @param [Time] start_time_before Only include calls that started on this date
327
- # @param [Time] start_time Only include calls that started on this date
328
- # @param [Time] start_time_after Only include calls that started on this date
329
- # @param [Time] end_time_before Only include calls that ended on this date
330
- # @param [Time] end_time Only include calls that ended on this date
331
- # @param [Time] end_time_after Only include calls that ended on this date
332
- # @param [String] page_token PageToken provided by the API
333
- # @param [Integer] page_number Page Number, this value is simply for client state
334
- # @param [Integer] page_size Number of records to return, defaults to 50
335
- # @return [Page] Page of CallInstance
336
- def page(to: :unset, from: :unset, parent_call_sid: :unset, status: :unset, start_time_before: :unset, start_time: :unset, start_time_after: :unset, end_time_before: :unset, end_time: :unset, end_time_after: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
337
- params = Twilio::Values.of({
338
- 'To' => to,
339
- 'From' => from,
340
- 'ParentCallSid' => parent_call_sid,
341
- 'Status' => status,
342
- 'StartTime<' => Twilio.serialize_iso8601_datetime(start_time_before),
343
- 'StartTime' => Twilio.serialize_iso8601_datetime(start_time),
344
- 'StartTime>' => Twilio.serialize_iso8601_datetime(start_time_after),
345
- 'EndTime<' => Twilio.serialize_iso8601_datetime(end_time_before),
346
- 'EndTime' => Twilio.serialize_iso8601_datetime(end_time),
347
- 'EndTime>' => Twilio.serialize_iso8601_datetime(end_time_after),
348
- 'PageToken' => page_token,
349
- 'Page' => page_number,
350
- 'PageSize' => page_size,
351
- })
352
-
353
- response = @version.page('GET', @uri, params: params)
354
-
355
- CallPage.new(@version, response, @solution)
356
- end
357
-
358
- ##
359
- # Retrieve a single page of CallInstance records from the API.
360
- # Request is executed immediately.
361
- # @param [String] target_url API-generated URL for the requested results page
362
- # @return [Page] Page of CallInstance
363
- def get_page(target_url)
364
- response = @version.domain.request(
365
- 'GET',
366
- target_url
367
- )
368
- CallPage.new(@version, response, @solution)
369
- end
370
-
371
- ##
372
- # Access the feedback_summaries
373
- # @param [String] sid A 34 character string that uniquely identifies this
374
- # resource.
375
- # @return [FeedbackSummaryList]
376
- # @return [FeedbackSummaryContext] if sid was passed.
377
- def feedback_summaries(sid=:unset)
378
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
379
-
380
- if sid != :unset
381
- return FeedbackSummaryContext.new(@version, @solution[:account_sid], sid, )
382
- end
383
-
384
- @feedback_summaries ||= FeedbackSummaryList.new(@version, account_sid: @solution[:account_sid], )
385
- end
386
-
387
- ##
388
- # Provide a user friendly representation
389
- def to_s
390
- '#<Twilio.Api.V2010.CallList>'
391
- end
392
- end
393
-
394
- class CallPage < Page
395
- ##
396
- # Initialize the CallPage
397
- # @param [Version] version Version that contains the resource
398
- # @param [Response] response Response from the API
399
- # @param [Hash] solution Path solution for the resource
400
- # @return [CallPage] CallPage
401
- def initialize(version, response, solution)
402
- super(version, response)
403
-
404
- # Path Solution
405
- @solution = solution
406
- end
407
-
408
- ##
409
- # Build an instance of CallInstance
410
- # @param [Hash] payload Payload response from the API
411
- # @return [CallInstance] CallInstance
412
- def get_instance(payload)
413
- CallInstance.new(@version, payload, account_sid: @solution[:account_sid], )
414
- end
415
-
416
- ##
417
- # Provide a user friendly representation
418
- def to_s
419
- '<Twilio.Api.V2010.CallPage>'
420
- end
421
- end
422
-
423
- class CallContext < InstanceContext
424
- ##
425
- # Initialize the CallContext
426
- # @param [Version] version Version that contains the resource
427
- # @param [String] account_sid The SID of the
428
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created the Call
429
- # resource(s) to fetch.
430
- # @param [String] sid The SID of the Call resource to fetch.
431
- # @return [CallContext] CallContext
432
- def initialize(version, account_sid, sid)
433
- super(version)
434
-
435
- # Path Solution
436
- @solution = {account_sid: account_sid, sid: sid, }
437
- @uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:sid]}.json"
438
-
439
- # Dependents
440
- @recordings = nil
441
- @notifications = nil
442
- @feedback = nil
443
- @events = nil
444
- @payments = nil
445
- @siprec = nil
446
- @streams = nil
447
- @user_defined_message_subscriptions = nil
448
- @user_defined_messages = nil
449
- end
450
-
451
- ##
452
- # Delete the CallInstance
453
- # @return [Boolean] true if delete succeeds, false otherwise
454
- def delete
455
- @version.delete('DELETE', @uri)
456
- end
457
-
458
- ##
459
- # Fetch the CallInstance
460
- # @return [CallInstance] Fetched CallInstance
461
- def fetch
462
- payload = @version.fetch('GET', @uri)
463
-
464
- CallInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], )
465
- end
466
-
467
- ##
468
- # Update the CallInstance
469
- # @param [String] url The absolute URL that returns the TwiML instructions for the
470
- # call. We will call this URL using the `method` when the call connects. For more
471
- # information, see the {Url
472
- # Parameter}[https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter]
473
- # section in {Making Calls}[https://www.twilio.com/docs/voice/make-calls].
474
- # @param [String] method The HTTP method we should use when calling the `url`. Can
475
- # be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter
476
- # is present, this parameter is ignored.
477
- # @param [call.UpdateStatus] status The new status of the resource. Can be:
478
- # `canceled` or `completed`. Specifying `canceled` will attempt to hang up calls
479
- # that are queued or ringing; however, it will not affect calls already in
480
- # progress. Specifying `completed` will attempt to hang up a call even if it's
481
- # already in progress.
482
- # @param [String] fallback_url The URL that we call using the `fallback_method` if
483
- # an error occurs when requesting or executing the TwiML at `url`. If an
484
- # `application_sid` parameter is present, this parameter is ignored.
485
- # @param [String] fallback_method The HTTP method that we should use to request
486
- # the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an
487
- # `application_sid` parameter is present, this parameter is ignored.
488
- # @param [String] status_callback The URL we should call using the
489
- # `status_callback_method` to send status information to your application. If no
490
- # `status_callback_event` is specified, we will send the `completed` status. If an
491
- # `application_sid` parameter is present, this parameter is ignored. URLs must
492
- # contain a valid hostname (underscores are not permitted).
493
- # @param [String] status_callback_method The HTTP method we should use when
494
- # requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is
495
- # `POST`. If an `application_sid` parameter is present, this parameter is ignored.
496
- # @param [String] twiml TwiML instructions for the call Twilio will use without
497
- # fetching Twiml from url. Twiml and url parameters are mutually exclusive
498
- # @param [String] time_limit The maximum duration of the call in seconds.
499
- # Constraints depend on account and configuration.
500
- # @return [CallInstance] Updated CallInstance
501
- def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset, time_limit: :unset)
502
- data = Twilio::Values.of({
503
- 'Url' => url,
504
- 'Method' => method,
505
- 'Status' => status,
506
- 'FallbackUrl' => fallback_url,
507
- 'FallbackMethod' => fallback_method,
508
- 'StatusCallback' => status_callback,
509
- 'StatusCallbackMethod' => status_callback_method,
510
- 'Twiml' => twiml,
511
- 'TimeLimit' => time_limit,
512
- })
513
-
514
- payload = @version.update('POST', @uri, data: data)
515
-
516
- CallInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], )
517
- end
518
-
519
- ##
520
- # Access the recordings
521
- # @return [RecordingList]
522
- # @return [RecordingContext] if sid was passed.
523
- def recordings(sid=:unset)
524
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
525
-
526
- if sid != :unset
527
- return RecordingContext.new(@version, @solution[:account_sid], @solution[:sid], sid, )
528
- end
529
-
530
- unless @recordings
531
- @recordings = RecordingList.new(
532
- @version,
533
- account_sid: @solution[:account_sid],
534
- call_sid: @solution[:sid],
535
- )
536
- end
537
-
538
- @recordings
539
- end
540
-
541
- ##
542
- # Access the notifications
543
- # @return [NotificationList]
544
- # @return [NotificationContext] if sid was passed.
545
- def notifications(sid=:unset)
546
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
547
-
548
- if sid != :unset
549
- return NotificationContext.new(@version, @solution[:account_sid], @solution[:sid], sid, )
550
- end
551
-
552
- unless @notifications
553
- @notifications = NotificationList.new(
554
- @version,
555
- account_sid: @solution[:account_sid],
556
- call_sid: @solution[:sid],
557
- )
558
- end
559
-
560
- @notifications
561
- end
562
-
563
- ##
564
- # Access the feedback
565
- # @return [FeedbackList]
566
- # @return [FeedbackContext]
567
- def feedback
568
- FeedbackContext.new(@version, @solution[:account_sid], @solution[:sid], )
569
- end
570
-
571
- ##
572
- # Access the events
573
- # @return [EventList]
574
- # @return [EventContext]
575
- def events
576
- unless @events
577
- @events = EventList.new(@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
578
- end
579
-
580
- @events
581
- end
582
-
583
- ##
584
- # Access the payments
585
- # @return [PaymentList]
586
- # @return [PaymentContext] if sid was passed.
587
- def payments(sid=:unset)
588
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
589
-
590
- if sid != :unset
591
- return PaymentContext.new(@version, @solution[:account_sid], @solution[:sid], sid, )
592
- end
593
-
594
- unless @payments
595
- @payments = PaymentList.new(
596
- @version,
597
- account_sid: @solution[:account_sid],
598
- call_sid: @solution[:sid],
599
- )
600
- end
601
-
602
- @payments
603
- end
604
-
605
- ##
606
- # Access the siprec
607
- # @return [SiprecList]
608
- # @return [SiprecContext] if sid was passed.
609
- def siprec(sid=:unset)
610
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
611
-
612
- if sid != :unset
613
- return SiprecContext.new(@version, @solution[:account_sid], @solution[:sid], sid, )
614
- end
615
-
616
- unless @siprec
617
- @siprec = SiprecList.new(@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
618
- end
619
-
620
- @siprec
621
- end
622
-
623
- ##
624
- # Access the streams
625
- # @return [StreamList]
626
- # @return [StreamContext] if sid was passed.
627
- def streams(sid=:unset)
628
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
629
-
630
- if sid != :unset
631
- return StreamContext.new(@version, @solution[:account_sid], @solution[:sid], sid, )
632
- end
633
-
634
- unless @streams
635
- @streams = StreamList.new(@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
636
- end
637
-
638
- @streams
639
- end
640
-
641
- ##
642
- # Access the user_defined_message_subscriptions
643
- # @return [UserDefinedMessageSubscriptionList]
644
- # @return [UserDefinedMessageSubscriptionContext] if sid was passed.
645
- def user_defined_message_subscriptions(sid=:unset)
646
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
647
-
648
- if sid != :unset
649
- return UserDefinedMessageSubscriptionContext.new(
650
- @version,
651
- @solution[:account_sid],
652
- @solution[:sid],
653
- sid,
654
- )
655
- end
656
-
657
- unless @user_defined_message_subscriptions
658
- @user_defined_message_subscriptions = UserDefinedMessageSubscriptionList.new(
659
- @version,
660
- account_sid: @solution[:account_sid],
661
- call_sid: @solution[:sid],
662
- )
663
- end
664
-
665
- @user_defined_message_subscriptions
666
- end
667
-
668
- ##
669
- # Access the user_defined_messages
670
- # @return [UserDefinedMessageList]
671
- # @return [UserDefinedMessageContext]
672
- def user_defined_messages
673
- unless @user_defined_messages
674
- @user_defined_messages = UserDefinedMessageList.new(
675
- @version,
676
- account_sid: @solution[:account_sid],
677
- call_sid: @solution[:sid],
678
- )
679
- end
680
-
681
- @user_defined_messages
682
- end
683
-
684
- ##
685
- # Provide a user friendly representation
686
- def to_s
687
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
688
- "#<Twilio.Api.V2010.CallContext #{context}>"
689
- end
690
-
691
- ##
692
- # Provide a detailed, user friendly representation
693
- def inspect
694
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
695
- "#<Twilio.Api.V2010.CallContext #{context}>"
696
- end
697
- end
698
-
699
- class CallInstance < InstanceResource
700
- ##
701
- # Initialize the CallInstance
702
- # @param [Version] version Version that contains the resource
703
- # @param [Hash] payload payload that contains response from Twilio
704
- # @param [String] account_sid The SID of the
705
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Call
706
- # resource.
707
- # @param [String] sid The SID of the Call resource to fetch.
708
- # @return [CallInstance] CallInstance
709
- def initialize(version, payload, account_sid: nil, sid: nil)
710
- super(version)
711
-
712
- # Marshaled Properties
713
- @properties = {
714
- 'sid' => payload['sid'],
715
- 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
716
- 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
717
- 'parent_call_sid' => payload['parent_call_sid'],
718
- 'account_sid' => payload['account_sid'],
719
- 'to' => payload['to'],
720
- 'to_formatted' => payload['to_formatted'],
721
- 'from' => payload['from'],
722
- 'from_formatted' => payload['from_formatted'],
723
- 'phone_number_sid' => payload['phone_number_sid'],
724
- 'status' => payload['status'],
725
- 'start_time' => Twilio.deserialize_rfc2822(payload['start_time']),
726
- 'end_time' => Twilio.deserialize_rfc2822(payload['end_time']),
727
- 'duration' => payload['duration'],
728
- 'price' => payload['price'],
729
- 'price_unit' => payload['price_unit'],
730
- 'direction' => payload['direction'],
731
- 'answered_by' => payload['answered_by'],
732
- 'api_version' => payload['api_version'],
733
- 'forwarded_from' => payload['forwarded_from'],
734
- 'group_sid' => payload['group_sid'],
735
- 'caller_name' => payload['caller_name'],
736
- 'queue_time' => payload['queue_time'],
737
- 'trunk_sid' => payload['trunk_sid'],
738
- 'uri' => payload['uri'],
739
- 'subresource_uris' => payload['subresource_uris'],
740
- }
741
-
742
- # Context
743
- @instance_context = nil
744
- @params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], }
745
- end
746
-
747
- ##
748
- # Generate an instance context for the instance, the context is capable of
749
- # performing various actions. All instance actions are proxied to the context
750
- # @return [CallContext] CallContext for this CallInstance
751
- def context
752
- unless @instance_context
753
- @instance_context = CallContext.new(@version, @params['account_sid'], @params['sid'], )
754
- end
755
- @instance_context
756
- end
757
-
758
- ##
759
- # @return [String] The unique string that identifies this resource
760
- def sid
761
- @properties['sid']
762
- end
763
-
764
- ##
765
- # @return [Time] The RFC 2822 date and time in GMT that this resource was created
766
- def date_created
767
- @properties['date_created']
768
- end
769
-
770
- ##
771
- # @return [Time] The RFC 2822 date and time in GMT that this resource was last updated
772
- def date_updated
773
- @properties['date_updated']
774
- end
775
-
776
- ##
777
- # @return [String] The SID that identifies the call that created this leg.
778
- def parent_call_sid
779
- @properties['parent_call_sid']
780
- end
781
-
782
- ##
783
- # @return [String] The SID of the Account that created this resource
784
- def account_sid
785
- @properties['account_sid']
786
- end
787
-
788
- ##
789
- # @return [String] The phone number, SIP address or Client identifier that received this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`.
790
- def to
791
- @properties['to']
792
- end
793
-
794
- ##
795
- # @return [String] The phone number, SIP address or Client identifier that received this call. Formatted for display.
796
- def to_formatted
797
- @properties['to_formatted']
798
- end
799
-
800
- ##
801
- # @return [String] The phone number, SIP address or Client identifier that made this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`.
802
- def from
803
- @properties['from']
804
- end
805
-
806
- ##
807
- # @return [String] The calling phone number, SIP address, or Client identifier formatted for display.
808
- def from_formatted
809
- @properties['from_formatted']
810
- end
811
-
812
- ##
813
- # @return [String] If the call was inbound, this is the SID of the IncomingPhoneNumber resource that received the call. If the call was outbound, it is the SID of the OutgoingCallerId resource from which the call was placed.
814
- def phone_number_sid
815
- @properties['phone_number_sid']
816
- end
817
-
818
- ##
819
- # @return [call.Status] The status of this call.
820
- def status
821
- @properties['status']
822
- end
823
-
824
- ##
825
- # @return [Time] The start time of the call. Null if the call has not yet been dialed.
826
- def start_time
827
- @properties['start_time']
828
- end
829
-
830
- ##
831
- # @return [Time] The end time of the call. Null if the call did not complete successfully.
832
- def end_time
833
- @properties['end_time']
834
- end
835
-
836
- ##
837
- # @return [String] The length of the call in seconds.
838
- def duration
839
- @properties['duration']
840
- end
841
-
842
- ##
843
- # @return [String] The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available.
844
- def price
845
- @properties['price']
846
- end
847
-
848
- ##
849
- # @return [String] The currency in which `Price` is measured.
850
- def price_unit
851
- @properties['price_unit']
852
- end
853
-
854
- ##
855
- # @return [String] A string describing the direction of the call. `inbound` for inbound calls, `outbound-api` for calls initiated via the REST API or `outbound-dial` for calls initiated by a `Dial` verb.
856
- def direction
857
- @properties['direction']
858
- end
859
-
860
- ##
861
- # @return [String] Either `human` or `machine` if this call was initiated with answering machine detection. Empty otherwise.
862
- def answered_by
863
- @properties['answered_by']
864
- end
865
-
866
- ##
867
- # @return [String] The API Version used to create the call
868
- def api_version
869
- @properties['api_version']
870
- end
871
-
872
- ##
873
- # @return [String] The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding). Otherwise, empty.
874
- def forwarded_from
875
- @properties['forwarded_from']
876
- end
877
-
878
- ##
879
- # @return [String] The Group SID associated with this call. If no Group is associated with the call, the field is empty.
880
- def group_sid
881
- @properties['group_sid']
882
- end
883
-
884
- ##
885
- # @return [String] The caller's name if this call was an incoming call to a phone number with caller ID Lookup enabled. Otherwise, empty.
886
- def caller_name
887
- @properties['caller_name']
888
- end
889
-
890
- ##
891
- # @return [String] The wait time in milliseconds before the call is placed.
892
- def queue_time
893
- @properties['queue_time']
894
- end
895
-
896
- ##
897
- # @return [String] The (optional) unique identifier of the trunk resource that was used for this call.
898
- def trunk_sid
899
- @properties['trunk_sid']
900
- end
901
-
902
- ##
903
- # @return [String] The URI of this resource, relative to `https://api.twilio.com`
904
- def uri
905
- @properties['uri']
906
- end
907
-
908
- ##
909
- # @return [String] A list of related subresources identified by their relative URIs
910
- def subresource_uris
911
- @properties['subresource_uris']
912
- end
913
-
914
- ##
915
- # Delete the CallInstance
916
- # @return [Boolean] true if delete succeeds, false otherwise
917
- def delete
918
- context.delete
919
- end
920
-
921
- ##
922
- # Fetch the CallInstance
923
- # @return [CallInstance] Fetched CallInstance
924
- def fetch
925
- context.fetch
926
- end
927
-
928
- ##
929
- # Update the CallInstance
930
- # @param [String] url The absolute URL that returns the TwiML instructions for the
931
- # call. We will call this URL using the `method` when the call connects. For more
932
- # information, see the {Url
933
- # Parameter}[https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter]
934
- # section in {Making Calls}[https://www.twilio.com/docs/voice/make-calls].
935
- # @param [String] method The HTTP method we should use when calling the `url`. Can
936
- # be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter
937
- # is present, this parameter is ignored.
938
- # @param [call.UpdateStatus] status The new status of the resource. Can be:
939
- # `canceled` or `completed`. Specifying `canceled` will attempt to hang up calls
940
- # that are queued or ringing; however, it will not affect calls already in
941
- # progress. Specifying `completed` will attempt to hang up a call even if it's
942
- # already in progress.
943
- # @param [String] fallback_url The URL that we call using the `fallback_method` if
944
- # an error occurs when requesting or executing the TwiML at `url`. If an
945
- # `application_sid` parameter is present, this parameter is ignored.
946
- # @param [String] fallback_method The HTTP method that we should use to request
947
- # the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an
948
- # `application_sid` parameter is present, this parameter is ignored.
949
- # @param [String] status_callback The URL we should call using the
950
- # `status_callback_method` to send status information to your application. If no
951
- # `status_callback_event` is specified, we will send the `completed` status. If an
952
- # `application_sid` parameter is present, this parameter is ignored. URLs must
953
- # contain a valid hostname (underscores are not permitted).
954
- # @param [String] status_callback_method The HTTP method we should use when
955
- # requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is
956
- # `POST`. If an `application_sid` parameter is present, this parameter is ignored.
957
- # @param [String] twiml TwiML instructions for the call Twilio will use without
958
- # fetching Twiml from url. Twiml and url parameters are mutually exclusive
959
- # @param [String] time_limit The maximum duration of the call in seconds.
960
- # Constraints depend on account and configuration.
961
- # @return [CallInstance] Updated CallInstance
962
- def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset, time_limit: :unset)
963
- context.update(
964
- url: url,
965
- method: method,
966
- status: status,
967
- fallback_url: fallback_url,
968
- fallback_method: fallback_method,
969
- status_callback: status_callback,
970
- status_callback_method: status_callback_method,
971
- twiml: twiml,
972
- time_limit: time_limit,
973
- )
974
- end
975
-
976
- ##
977
- # Access the recordings
978
- # @return [recordings] recordings
979
- def recordings
980
- context.recordings
981
- end
982
-
983
- ##
984
- # Access the notifications
985
- # @return [notifications] notifications
986
- def notifications
987
- context.notifications
988
- end
989
-
990
- ##
991
- # Access the feedback
992
- # @return [feedback] feedback
993
- def feedback
994
- context.feedback
995
- end
996
-
997
- ##
998
- # Access the events
999
- # @return [events] events
1000
- def events
1001
- context.events
1002
- end
1003
-
1004
- ##
1005
- # Access the payments
1006
- # @return [payments] payments
1007
- def payments
1008
- context.payments
1009
- end
1010
-
1011
- ##
1012
- # Access the siprec
1013
- # @return [siprec] siprec
1014
- def siprec
1015
- context.siprec
1016
- end
1017
-
1018
- ##
1019
- # Access the streams
1020
- # @return [streams] streams
1021
- def streams
1022
- context.streams
1023
- end
1024
-
1025
- ##
1026
- # Access the user_defined_message_subscriptions
1027
- # @return [user_defined_message_subscriptions] user_defined_message_subscriptions
1028
- def user_defined_message_subscriptions
1029
- context.user_defined_message_subscriptions
1030
- end
1031
14
 
1032
- ##
1033
- # Access the user_defined_messages
1034
- # @return [user_defined_messages] user_defined_messages
1035
- def user_defined_messages
1036
- context.user_defined_messages
1037
- end
1038
15
 
1039
- ##
1040
- # Provide a user friendly representation
1041
- def to_s
1042
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
1043
- "<Twilio.Api.V2010.CallInstance #{values}>"
1044
- end
1045
-
1046
- ##
1047
- # Provide a detailed, user friendly representation
1048
- def inspect
1049
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
1050
- "<Twilio.Api.V2010.CallInstance #{values}>"
16
+ module Twilio
17
+ module REST
18
+ class Api < ApiBase
19
+ class V2010 < Version
20
+ class AccountContext < InstanceContext
21
+
22
+ class CallList < ListResource
23
+
24
+ ##
25
+ # Initialize the CallList
26
+ # @param [Version] version Version that contains the resource
27
+ # @return [CallList] CallList
28
+ def initialize(version, account_sid: nil)
29
+ super(version)
30
+
31
+ # Path Solution
32
+ @solution = { account_sid: account_sid }
33
+ @uri = "/Accounts/#{@solution[:account_sid]}/Calls.json"
34
+
35
+ end
36
+ ##
37
+ # Create the CallInstance
38
+ # @param [String] to The phone number, SIP address, or client identifier to call.
39
+ # @param [String] from The phone number or client identifier to use as the caller id. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `From` must also be a phone number.
40
+ # @param [String] method The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
41
+ # @param [String] fallback_url The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored.
42
+ # @param [String] fallback_method The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
43
+ # @param [String] status_callback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted).
44
+ # @param [Array[String]] status_callback_event The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored.
45
+ # @param [String] status_callback_method The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
46
+ # @param [String] send_digits The string of keys to dial after connecting to the number, with a maximum length of 32 digits. Valid digits in the string include any digit (`0`-`9`), '`A`', '`B`', '`C`', '`D`', '`#`', and '`*`'. You can also use '`w`' to insert a half-second pause and '`W`' to insert a one-second pause. For example, to pause for one second after connecting and then dial extension 1234 followed by the # key, set this parameter to `W1234#`. Be sure to URL-encode this string because the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored.
47
+ # @param [String] timeout The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail.
48
+ # @param [Boolean] record Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL.
49
+ # @param [String] recording_channels The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call.
50
+ # @param [String] recording_status_callback The URL that we call when the recording is available to be accessed.
51
+ # @param [String] recording_status_callback_method The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`.
52
+ # @param [String] sip_auth_username The username used to authenticate the caller making a SIP call.
53
+ # @param [String] sip_auth_password The password required to authenticate the user account specified in `sip_auth_username`.
54
+ # @param [String] machine_detection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection).
55
+ # @param [String] machine_detection_timeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds.
56
+ # @param [Array[String]] recording_status_callback_event The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space.
57
+ # @param [String] trim Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`.
58
+ # @param [String] caller_id The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`.
59
+ # @param [String] machine_detection_speech_threshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400.
60
+ # @param [String] machine_detection_speech_end_threshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200.
61
+ # @param [String] machine_detection_silence_timeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000.
62
+ # @param [String] async_amd Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`.
63
+ # @param [String] async_amd_status_callback The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax.
64
+ # @param [String] async_amd_status_callback_method The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`.
65
+ # @param [String] byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta)
66
+ # @param [String] call_reason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta)
67
+ # @param [String] call_token A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call.
68
+ # @param [String] recording_track The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio.
69
+ # @param [String] time_limit The maximum duration of the call in seconds. Constraints depend on account and configuration.
70
+ # @param [String] client_notification_url The URL that we should use to deliver `push call notification`.
71
+ # @param [String] url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls).
72
+ # @param [String] twiml TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters.
73
+ # @param [String] application_sid The SID of the Application resource that will handle the call, if the call will be handled by an application.
74
+ # @return [CallInstance] Created CallInstance
75
+ def create(
76
+ to: nil,
77
+ from: nil,
78
+ method: :unset,
79
+ fallback_url: :unset,
80
+ fallback_method: :unset,
81
+ status_callback: :unset,
82
+ status_callback_event: :unset,
83
+ status_callback_method: :unset,
84
+ send_digits: :unset,
85
+ timeout: :unset,
86
+ record: :unset,
87
+ recording_channels: :unset,
88
+ recording_status_callback: :unset,
89
+ recording_status_callback_method: :unset,
90
+ sip_auth_username: :unset,
91
+ sip_auth_password: :unset,
92
+ machine_detection: :unset,
93
+ machine_detection_timeout: :unset,
94
+ recording_status_callback_event: :unset,
95
+ trim: :unset,
96
+ caller_id: :unset,
97
+ machine_detection_speech_threshold: :unset,
98
+ machine_detection_speech_end_threshold: :unset,
99
+ machine_detection_silence_timeout: :unset,
100
+ async_amd: :unset,
101
+ async_amd_status_callback: :unset,
102
+ async_amd_status_callback_method: :unset,
103
+ byoc: :unset,
104
+ call_reason: :unset,
105
+ call_token: :unset,
106
+ recording_track: :unset,
107
+ time_limit: :unset,
108
+ client_notification_url: :unset,
109
+ url: :unset,
110
+ twiml: :unset,
111
+ application_sid: :unset
112
+ )
113
+
114
+ data = Twilio::Values.of({
115
+ 'To' => to,
116
+ 'From' => from,
117
+ 'Method' => method,
118
+ 'FallbackUrl' => fallback_url,
119
+ 'FallbackMethod' => fallback_method,
120
+ 'StatusCallback' => status_callback,
121
+ 'StatusCallbackEvent' => Twilio.serialize_list(status_callback_event) { |e| e },
122
+ 'StatusCallbackMethod' => status_callback_method,
123
+ 'SendDigits' => send_digits,
124
+ 'Timeout' => timeout,
125
+ 'Record' => record,
126
+ 'RecordingChannels' => recording_channels,
127
+ 'RecordingStatusCallback' => recording_status_callback,
128
+ 'RecordingStatusCallbackMethod' => recording_status_callback_method,
129
+ 'SipAuthUsername' => sip_auth_username,
130
+ 'SipAuthPassword' => sip_auth_password,
131
+ 'MachineDetection' => machine_detection,
132
+ 'MachineDetectionTimeout' => machine_detection_timeout,
133
+ 'RecordingStatusCallbackEvent' => Twilio.serialize_list(recording_status_callback_event) { |e| e },
134
+ 'Trim' => trim,
135
+ 'CallerId' => caller_id,
136
+ 'MachineDetectionSpeechThreshold' => machine_detection_speech_threshold,
137
+ 'MachineDetectionSpeechEndThreshold' => machine_detection_speech_end_threshold,
138
+ 'MachineDetectionSilenceTimeout' => machine_detection_silence_timeout,
139
+ 'AsyncAmd' => async_amd,
140
+ 'AsyncAmdStatusCallback' => async_amd_status_callback,
141
+ 'AsyncAmdStatusCallbackMethod' => async_amd_status_callback_method,
142
+ 'Byoc' => byoc,
143
+ 'CallReason' => call_reason,
144
+ 'CallToken' => call_token,
145
+ 'RecordingTrack' => recording_track,
146
+ 'TimeLimit' => time_limit,
147
+ 'ClientNotificationUrl' => client_notification_url,
148
+ 'Url' => url,
149
+ 'Twiml' => twiml,
150
+ 'ApplicationSid' => application_sid,
151
+ })
152
+
153
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
154
+
155
+
156
+
157
+
158
+
159
+ payload = @version.create('POST', @uri, data: data, headers: headers)
160
+ CallInstance.new(
161
+ @version,
162
+ payload,
163
+ account_sid: @solution[:account_sid],
164
+ )
165
+ end
166
+
167
+ ##
168
+ # Create the CallInstanceMetadata
169
+ # @param [String] to The phone number, SIP address, or client identifier to call.
170
+ # @param [String] from The phone number or client identifier to use as the caller id. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `From` must also be a phone number.
171
+ # @param [String] method The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
172
+ # @param [String] fallback_url The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored.
173
+ # @param [String] fallback_method The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
174
+ # @param [String] status_callback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted).
175
+ # @param [Array[String]] status_callback_event The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored.
176
+ # @param [String] status_callback_method The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
177
+ # @param [String] send_digits The string of keys to dial after connecting to the number, with a maximum length of 32 digits. Valid digits in the string include any digit (`0`-`9`), '`A`', '`B`', '`C`', '`D`', '`#`', and '`*`'. You can also use '`w`' to insert a half-second pause and '`W`' to insert a one-second pause. For example, to pause for one second after connecting and then dial extension 1234 followed by the # key, set this parameter to `W1234#`. Be sure to URL-encode this string because the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored.
178
+ # @param [String] timeout The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail.
179
+ # @param [Boolean] record Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL.
180
+ # @param [String] recording_channels The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call.
181
+ # @param [String] recording_status_callback The URL that we call when the recording is available to be accessed.
182
+ # @param [String] recording_status_callback_method The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`.
183
+ # @param [String] sip_auth_username The username used to authenticate the caller making a SIP call.
184
+ # @param [String] sip_auth_password The password required to authenticate the user account specified in `sip_auth_username`.
185
+ # @param [String] machine_detection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection).
186
+ # @param [String] machine_detection_timeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds.
187
+ # @param [Array[String]] recording_status_callback_event The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space.
188
+ # @param [String] trim Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`.
189
+ # @param [String] caller_id The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`.
190
+ # @param [String] machine_detection_speech_threshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400.
191
+ # @param [String] machine_detection_speech_end_threshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200.
192
+ # @param [String] machine_detection_silence_timeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000.
193
+ # @param [String] async_amd Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`.
194
+ # @param [String] async_amd_status_callback The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax.
195
+ # @param [String] async_amd_status_callback_method The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`.
196
+ # @param [String] byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta)
197
+ # @param [String] call_reason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta)
198
+ # @param [String] call_token A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call.
199
+ # @param [String] recording_track The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio.
200
+ # @param [String] time_limit The maximum duration of the call in seconds. Constraints depend on account and configuration.
201
+ # @param [String] client_notification_url The URL that we should use to deliver `push call notification`.
202
+ # @param [String] url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls).
203
+ # @param [String] twiml TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters.
204
+ # @param [String] application_sid The SID of the Application resource that will handle the call, if the call will be handled by an application.
205
+ # @return [CallInstance] Created CallInstance
206
+ def create_with_metadata(
207
+ to: nil,
208
+ from: nil,
209
+ method: :unset,
210
+ fallback_url: :unset,
211
+ fallback_method: :unset,
212
+ status_callback: :unset,
213
+ status_callback_event: :unset,
214
+ status_callback_method: :unset,
215
+ send_digits: :unset,
216
+ timeout: :unset,
217
+ record: :unset,
218
+ recording_channels: :unset,
219
+ recording_status_callback: :unset,
220
+ recording_status_callback_method: :unset,
221
+ sip_auth_username: :unset,
222
+ sip_auth_password: :unset,
223
+ machine_detection: :unset,
224
+ machine_detection_timeout: :unset,
225
+ recording_status_callback_event: :unset,
226
+ trim: :unset,
227
+ caller_id: :unset,
228
+ machine_detection_speech_threshold: :unset,
229
+ machine_detection_speech_end_threshold: :unset,
230
+ machine_detection_silence_timeout: :unset,
231
+ async_amd: :unset,
232
+ async_amd_status_callback: :unset,
233
+ async_amd_status_callback_method: :unset,
234
+ byoc: :unset,
235
+ call_reason: :unset,
236
+ call_token: :unset,
237
+ recording_track: :unset,
238
+ time_limit: :unset,
239
+ client_notification_url: :unset,
240
+ url: :unset,
241
+ twiml: :unset,
242
+ application_sid: :unset
243
+ )
244
+
245
+ data = Twilio::Values.of({
246
+ 'To' => to,
247
+ 'From' => from,
248
+ 'Method' => method,
249
+ 'FallbackUrl' => fallback_url,
250
+ 'FallbackMethod' => fallback_method,
251
+ 'StatusCallback' => status_callback,
252
+ 'StatusCallbackEvent' => Twilio.serialize_list(status_callback_event) { |e| e },
253
+ 'StatusCallbackMethod' => status_callback_method,
254
+ 'SendDigits' => send_digits,
255
+ 'Timeout' => timeout,
256
+ 'Record' => record,
257
+ 'RecordingChannels' => recording_channels,
258
+ 'RecordingStatusCallback' => recording_status_callback,
259
+ 'RecordingStatusCallbackMethod' => recording_status_callback_method,
260
+ 'SipAuthUsername' => sip_auth_username,
261
+ 'SipAuthPassword' => sip_auth_password,
262
+ 'MachineDetection' => machine_detection,
263
+ 'MachineDetectionTimeout' => machine_detection_timeout,
264
+ 'RecordingStatusCallbackEvent' => Twilio.serialize_list(recording_status_callback_event) { |e| e },
265
+ 'Trim' => trim,
266
+ 'CallerId' => caller_id,
267
+ 'MachineDetectionSpeechThreshold' => machine_detection_speech_threshold,
268
+ 'MachineDetectionSpeechEndThreshold' => machine_detection_speech_end_threshold,
269
+ 'MachineDetectionSilenceTimeout' => machine_detection_silence_timeout,
270
+ 'AsyncAmd' => async_amd,
271
+ 'AsyncAmdStatusCallback' => async_amd_status_callback,
272
+ 'AsyncAmdStatusCallbackMethod' => async_amd_status_callback_method,
273
+ 'Byoc' => byoc,
274
+ 'CallReason' => call_reason,
275
+ 'CallToken' => call_token,
276
+ 'RecordingTrack' => recording_track,
277
+ 'TimeLimit' => time_limit,
278
+ 'ClientNotificationUrl' => client_notification_url,
279
+ 'Url' => url,
280
+ 'Twiml' => twiml,
281
+ 'ApplicationSid' => application_sid,
282
+ })
283
+
284
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
285
+
286
+
287
+
288
+
289
+
290
+ response = @version.create_with_metadata('POST', @uri, data: data, headers: headers)
291
+ call_instance = CallInstance.new(
292
+ @version,
293
+ response.body,
294
+ account_sid: @solution[:account_sid],
295
+ )
296
+ CallInstanceMetadata.new(
297
+ @version,
298
+ call_instance,
299
+ response.headers,
300
+ response.status_code
301
+ )
302
+ end
303
+
304
+
305
+ ##
306
+ # Lists CallInstance records from the API as a list.
307
+ # Unlike stream(), this operation is eager and will load `limit` records into
308
+ # memory before returning.
309
+ # @param [String] to Only show calls made to this phone number, SIP address, Client identifier or SIM SID.
310
+ # @param [String] from Only include calls from this phone number, SIP address, Client identifier or SIM SID.
311
+ # @param [String] parent_call_sid Only include calls spawned by calls with this SID.
312
+ # @param [Status] status The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`.
313
+ # @param [Time] start_time Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date.
314
+ # @param [Time] start_time_before Only include calls that started before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started before this date.
315
+ # @param [Time] start_time_after Only include calls that started on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on or after this date.
316
+ # @param [Time] end_time Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date.
317
+ # @param [Time] end_time_before Only include calls that ended before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended before this date.
318
+ # @param [Time] end_time_after Only include calls that ended on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on or after this date.
319
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
320
+ # guarantees to never return more than limit. Default is no limit
321
+ # @param [Integer] page_size Number of records to fetch per request, when
322
+ # not set will use the default value of 50 records. If no page_size is defined
323
+ # but a limit is defined, stream() will attempt to read the limit with the most
324
+ # efficient page size, i.e. min(limit, 1000)
325
+ # @return [Array] Array of up to limit results
326
+ def list(to: :unset, from: :unset, parent_call_sid: :unset, status: :unset, start_time: :unset, start_time_before: :unset, start_time_after: :unset, end_time: :unset, end_time_before: :unset, end_time_after: :unset, limit: nil, page_size: nil)
327
+ self.stream(
328
+ to: to,
329
+ from: from,
330
+ parent_call_sid: parent_call_sid,
331
+ status: status,
332
+ start_time: start_time,
333
+ start_time_before: start_time_before,
334
+ start_time_after: start_time_after,
335
+ end_time: end_time,
336
+ end_time_before: end_time_before,
337
+ end_time_after: end_time_after,
338
+ limit: limit,
339
+ page_size: page_size
340
+ ).entries
341
+ end
342
+
343
+ ##
344
+ # Streams Instance records from the API as an Enumerable.
345
+ # This operation lazily loads records as efficiently as possible until the limit
346
+ # is reached.
347
+ # @param [String] to Only show calls made to this phone number, SIP address, Client identifier or SIM SID.
348
+ # @param [String] from Only include calls from this phone number, SIP address, Client identifier or SIM SID.
349
+ # @param [String] parent_call_sid Only include calls spawned by calls with this SID.
350
+ # @param [Status] status The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`.
351
+ # @param [Time] start_time Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date.
352
+ # @param [Time] start_time_before Only include calls that started before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started before this date.
353
+ # @param [Time] start_time_after Only include calls that started on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on or after this date.
354
+ # @param [Time] end_time Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date.
355
+ # @param [Time] end_time_before Only include calls that ended before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended before this date.
356
+ # @param [Time] end_time_after Only include calls that ended on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on or after this date.
357
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
358
+ # guarantees to never return more than limit. Default is no limit
359
+ # @param [Integer] page_size Number of records to fetch per request, when
360
+ # not set will use the default value of 50 records. If no page_size is defined
361
+ # but a limit is defined, stream() will attempt to read the limit with the most
362
+ # efficient page size, i.e. min(limit, 1000)
363
+ # @return [Enumerable] Enumerable that will yield up to limit results
364
+ def stream(to: :unset, from: :unset, parent_call_sid: :unset, status: :unset, start_time: :unset, start_time_before: :unset, start_time_after: :unset, end_time: :unset, end_time_before: :unset, end_time_after: :unset, limit: nil, page_size: nil)
365
+ limits = @version.read_limits(limit, page_size)
366
+
367
+ page = self.page(
368
+ to: to,
369
+ from: from,
370
+ parent_call_sid: parent_call_sid,
371
+ status: status,
372
+ start_time: start_time,
373
+ start_time_before: start_time_before,
374
+ start_time_after: start_time_after,
375
+ end_time: end_time,
376
+ end_time_before: end_time_before,
377
+ end_time_after: end_time_after,
378
+ page_size: limits[:page_size], )
379
+
380
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
381
+ end
382
+
383
+ ##
384
+ # Lists CallPageMetadata records from the API as a list.
385
+ # @param [String] to Only show calls made to this phone number, SIP address, Client identifier or SIM SID.
386
+ # @param [String] from Only include calls from this phone number, SIP address, Client identifier or SIM SID.
387
+ # @param [String] parent_call_sid Only include calls spawned by calls with this SID.
388
+ # @param [Status] status The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`.
389
+ # @param [Time] start_time Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date.
390
+ # @param [Time] start_time_before Only include calls that started before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started before this date.
391
+ # @param [Time] start_time_after Only include calls that started on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on or after this date.
392
+ # @param [Time] end_time Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date.
393
+ # @param [Time] end_time_before Only include calls that ended before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended before this date.
394
+ # @param [Time] end_time_after Only include calls that ended on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on or after this date.
395
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
396
+ # guarantees to never return more than limit. Default is no limit
397
+ # @param [Integer] page_size Number of records to fetch per request, when
398
+ # not set will use the default value of 50 records. If no page_size is defined
399
+ # but a limit is defined, stream() will attempt to read the limit with the most
400
+ # efficient page size, i.e. min(limit, 1000)
401
+ # @return [Array] Array of up to limit results
402
+ def list_with_metadata(to: :unset, from: :unset, parent_call_sid: :unset, status: :unset, start_time: :unset, start_time_before: :unset, start_time_after: :unset, end_time: :unset, end_time_before: :unset, end_time_after: :unset, limit: nil, page_size: nil)
403
+ limits = @version.read_limits(limit, page_size)
404
+ params = Twilio::Values.of({
405
+ 'To' => to,
406
+ 'From' => from,
407
+ 'ParentCallSid' => parent_call_sid,
408
+ 'Status' => status,
409
+ 'StartTime' => Twilio.serialize_iso8601_datetime(start_time),
410
+ 'StartTime<' => Twilio.serialize_iso8601_datetime(start_time_before),
411
+ 'StartTime>' => Twilio.serialize_iso8601_datetime(start_time_after),
412
+ 'EndTime' => Twilio.serialize_iso8601_datetime(end_time),
413
+ 'EndTime<' => Twilio.serialize_iso8601_datetime(end_time_before),
414
+ 'EndTime>' => Twilio.serialize_iso8601_datetime(end_time_after),
415
+
416
+ 'PageSize' => limits[:page_size],
417
+ });
418
+ headers = Twilio::Values.of({})
419
+
420
+ response = @version.page('GET', @uri, params: params, headers: headers)
421
+
422
+ CallPageMetadata.new(@version, response, @solution, limits[:limit])
423
+ end
424
+
425
+ ##
426
+ # When passed a block, yields CallInstance records from the API.
427
+ # This operation lazily loads records as efficiently as possible until the limit
428
+ # is reached.
429
+ def each
430
+ limits = @version.read_limits
431
+
432
+ page = self.page(page_size: limits[:page_size], )
433
+
434
+ @version.stream(page,
435
+ limit: limits[:limit],
436
+ page_limit: limits[:page_limit]).each {|x| yield x}
437
+ end
438
+
439
+ ##
440
+ # Retrieve a single page of CallInstance records from the API.
441
+ # Request is executed immediately.
442
+ # @param [String] to Only show calls made to this phone number, SIP address, Client identifier or SIM SID.
443
+ # @param [String] from Only include calls from this phone number, SIP address, Client identifier or SIM SID.
444
+ # @param [String] parent_call_sid Only include calls spawned by calls with this SID.
445
+ # @param [Status] status The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`.
446
+ # @param [Time] start_time Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date.
447
+ # @param [Time] start_time_before Only include calls that started before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started before this date.
448
+ # @param [Time] start_time_after Only include calls that started on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on or after this date.
449
+ # @param [Time] end_time Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date.
450
+ # @param [Time] end_time_before Only include calls that ended before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended before this date.
451
+ # @param [Time] end_time_after Only include calls that ended on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on or after this date.
452
+ # @param [String] page_token PageToken provided by the API
453
+ # @param [Integer] page_number Page Number, this value is simply for client state
454
+ # @param [Integer] page_size Number of records to return, defaults to 50
455
+ # @return [Page] Page of CallInstance
456
+ def page(to: :unset, from: :unset, parent_call_sid: :unset, status: :unset, start_time: :unset, start_time_before: :unset, start_time_after: :unset, end_time: :unset, end_time_before: :unset, end_time_after: :unset, page_token: :unset, page_number: :unset,page_size: :unset)
457
+ params = Twilio::Values.of({
458
+ 'To' => to,
459
+ 'From' => from,
460
+ 'ParentCallSid' => parent_call_sid,
461
+ 'Status' => status,
462
+ 'StartTime' => Twilio.serialize_iso8601_datetime(start_time),
463
+ 'StartTime<' => Twilio.serialize_iso8601_datetime(start_time_before),
464
+ 'StartTime>' => Twilio.serialize_iso8601_datetime(start_time_after),
465
+ 'EndTime' => Twilio.serialize_iso8601_datetime(end_time),
466
+ 'EndTime<' => Twilio.serialize_iso8601_datetime(end_time_before),
467
+ 'EndTime>' => Twilio.serialize_iso8601_datetime(end_time_after),
468
+ 'PageToken' => page_token,
469
+ 'Page' => page_number,
470
+ 'PageSize' => page_size,
471
+ })
472
+ headers = Twilio::Values.of({})
473
+
474
+
475
+
476
+ response = @version.page('GET', @uri, params: params, headers: headers)
477
+
478
+ CallPage.new(@version, response, @solution)
479
+ end
480
+
481
+ ##
482
+ # Retrieve a single page of CallInstance records from the API.
483
+ # Request is executed immediately.
484
+ # @param [String] target_url API-generated URL for the requested results page
485
+ # @return [Page] Page of CallInstance
486
+ def get_page(target_url)
487
+ response = @version.domain.request(
488
+ 'GET',
489
+ target_url
490
+ )
491
+ CallPage.new(@version, response, @solution)
492
+ end
493
+
494
+
495
+
496
+ # Provide a user friendly representation
497
+ def to_s
498
+ '#<Twilio.Api.V2010.CallList>'
499
+ end
500
+ end
501
+
502
+
503
+ class CallContext < InstanceContext
504
+ ##
505
+ # Initialize the CallContext
506
+ # @param [Version] version Version that contains the resource
507
+ # @param [String] account_sid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call resource(s) to update.
508
+ # @param [String] sid The Twilio-provided string that uniquely identifies the Call resource to update
509
+ # @return [CallContext] CallContext
510
+ def initialize(version, account_sid, sid)
511
+ super(version)
512
+
513
+
514
+ # Path Solution
515
+ @solution = { account_sid: account_sid, sid: sid, }
516
+ @uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:sid]}.json"
517
+
518
+ # Dependents
519
+ @events = nil
520
+ @user_defined_messages = nil
521
+ @transcriptions = nil
522
+ @siprec = nil
523
+ @user_defined_message_subscriptions = nil
524
+ @payments = nil
525
+ @recordings = nil
526
+ @notifications = nil
527
+ @streams = nil
528
+ end
529
+ ##
530
+ # Delete the CallInstance
531
+ # @return [Boolean] True if delete succeeds, false otherwise
532
+ def delete
533
+
534
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
535
+
536
+
537
+
538
+
539
+ @version.delete('DELETE', @uri, headers: headers)
540
+ end
541
+
542
+ ##
543
+ # Delete the CallInstanceMetadata
544
+ # @return [Boolean] True if delete succeeds, false otherwise
545
+ def delete_with_metadata
546
+
547
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
548
+
549
+
550
+
551
+ response = @version.delete_with_metadata('DELETE', @uri, headers: headers)
552
+ call_instance = CallInstance.new(
553
+ @version,
554
+ response.body,
555
+ account_sid: @solution[:account_sid],
556
+ sid: @solution[:sid],
557
+ )
558
+ CallInstanceMetadata.new(@version, call_instance, response.headers, response.status_code)
559
+ end
560
+
561
+ ##
562
+ # Fetch the CallInstance
563
+ # @return [CallInstance] Fetched CallInstance
564
+ def fetch
565
+
566
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
567
+
568
+
569
+
570
+
571
+
572
+ payload = @version.fetch('GET', @uri, headers: headers)
573
+ CallInstance.new(
574
+ @version,
575
+ payload,
576
+ account_sid: @solution[:account_sid],
577
+ sid: @solution[:sid],
578
+ )
579
+ end
580
+
581
+ ##
582
+ # Fetch the CallInstanceMetadata
583
+ # @return [CallInstance] Fetched CallInstance
584
+ def fetch_with_metadata
585
+
586
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
587
+
588
+
589
+
590
+
591
+
592
+ response = @version.fetch_with_metadata('GET', @uri, headers: headers)
593
+ call_instance = CallInstance.new(
594
+ @version,
595
+ response.body,
596
+ account_sid: @solution[:account_sid],
597
+ sid: @solution[:sid],
598
+ )
599
+ CallInstanceMetadata.new(
600
+ @version,
601
+ call_instance,
602
+ response.headers,
603
+ response.status_code
604
+ )
605
+ end
606
+
607
+ ##
608
+ # Update the CallInstance
609
+ # @param [String] url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls).
610
+ # @param [String] method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
611
+ # @param [UpdateStatus] status
612
+ # @param [String] fallback_url The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored.
613
+ # @param [String] fallback_method The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
614
+ # @param [String] status_callback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted).
615
+ # @param [String] status_callback_method The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
616
+ # @param [String] twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive
617
+ # @param [String] time_limit The maximum duration of the call in seconds. Constraints depend on account and configuration.
618
+ # @return [CallInstance] Updated CallInstance
619
+ def update(
620
+ url: :unset,
621
+ method: :unset,
622
+ status: :unset,
623
+ fallback_url: :unset,
624
+ fallback_method: :unset,
625
+ status_callback: :unset,
626
+ status_callback_method: :unset,
627
+ twiml: :unset,
628
+ time_limit: :unset
629
+ )
630
+
631
+ data = Twilio::Values.of({
632
+ 'Url' => url,
633
+ 'Method' => method,
634
+ 'Status' => status,
635
+ 'FallbackUrl' => fallback_url,
636
+ 'FallbackMethod' => fallback_method,
637
+ 'StatusCallback' => status_callback,
638
+ 'StatusCallbackMethod' => status_callback_method,
639
+ 'Twiml' => twiml,
640
+ 'TimeLimit' => time_limit,
641
+ })
642
+
643
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
644
+
645
+
646
+
647
+
648
+
649
+ payload = @version.update('POST', @uri, data: data, headers: headers)
650
+ CallInstance.new(
651
+ @version,
652
+ payload,
653
+ account_sid: @solution[:account_sid],
654
+ sid: @solution[:sid],
655
+ )
656
+ end
657
+
658
+ ##
659
+ # Update the CallInstanceMetadata
660
+ # @param [String] url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls).
661
+ # @param [String] method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
662
+ # @param [UpdateStatus] status
663
+ # @param [String] fallback_url The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored.
664
+ # @param [String] fallback_method The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
665
+ # @param [String] status_callback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted).
666
+ # @param [String] status_callback_method The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
667
+ # @param [String] twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive
668
+ # @param [String] time_limit The maximum duration of the call in seconds. Constraints depend on account and configuration.
669
+ # @return [CallInstance] Updated CallInstance
670
+ def update_with_metadata(
671
+ url: :unset,
672
+ method: :unset,
673
+ status: :unset,
674
+ fallback_url: :unset,
675
+ fallback_method: :unset,
676
+ status_callback: :unset,
677
+ status_callback_method: :unset,
678
+ twiml: :unset,
679
+ time_limit: :unset
680
+ )
681
+
682
+ data = Twilio::Values.of({
683
+ 'Url' => url,
684
+ 'Method' => method,
685
+ 'Status' => status,
686
+ 'FallbackUrl' => fallback_url,
687
+ 'FallbackMethod' => fallback_method,
688
+ 'StatusCallback' => status_callback,
689
+ 'StatusCallbackMethod' => status_callback_method,
690
+ 'Twiml' => twiml,
691
+ 'TimeLimit' => time_limit,
692
+ })
693
+
694
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
695
+
696
+
697
+
698
+
699
+
700
+ response = @version.update_with_metadata('POST', @uri, data: data, headers: headers)
701
+ call_instance = CallInstance.new(
702
+ @version,
703
+ response.body,
704
+ account_sid: @solution[:account_sid],
705
+ sid: @solution[:sid],
706
+ )
707
+ CallInstanceMetadata.new(
708
+ @version,
709
+ call_instance,
710
+ response.headers,
711
+ response.status_code
712
+ )
713
+ end
714
+
715
+ ##
716
+ # Access the events
717
+ # @return [EventList]
718
+ # @return [EventContext]
719
+ def events
720
+ unless @events
721
+ @events = EventList.new(
722
+ @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
723
+ end
724
+ @events
725
+ end
726
+ ##
727
+ # Access the user_defined_messages
728
+ # @return [UserDefinedMessageList]
729
+ # @return [UserDefinedMessageContext]
730
+ def user_defined_messages
731
+ unless @user_defined_messages
732
+ @user_defined_messages = UserDefinedMessageList.new(
733
+ @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
734
+ end
735
+ @user_defined_messages
736
+ end
737
+ ##
738
+ # Access the transcriptions
739
+ # @return [TranscriptionList]
740
+ # @return [TranscriptionContext] if sid was passed.
741
+ def transcriptions(sid=:unset)
742
+
743
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
744
+
745
+ if sid != :unset
746
+ return TranscriptionContext.new(@version, @solution[:account_sid], @solution[:sid],sid )
747
+ end
748
+
749
+ unless @transcriptions
750
+ @transcriptions = TranscriptionList.new(
751
+ @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
752
+ end
753
+
754
+ @transcriptions
755
+ end
756
+ ##
757
+ # Access the siprec
758
+ # @return [SiprecList]
759
+ # @return [SiprecContext] if sid was passed.
760
+ def siprec(sid=:unset)
761
+
762
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
763
+
764
+ if sid != :unset
765
+ return SiprecContext.new(@version, @solution[:account_sid], @solution[:sid],sid )
766
+ end
767
+
768
+ unless @siprec
769
+ @siprec = SiprecList.new(
770
+ @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
771
+ end
772
+
773
+ @siprec
774
+ end
775
+ ##
776
+ # Access the user_defined_message_subscriptions
777
+ # @return [UserDefinedMessageSubscriptionList]
778
+ # @return [UserDefinedMessageSubscriptionContext] if sid was passed.
779
+ def user_defined_message_subscriptions(sid=:unset)
780
+
781
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
782
+
783
+ if sid != :unset
784
+ return UserDefinedMessageSubscriptionContext.new(@version, @solution[:account_sid], @solution[:sid],sid )
785
+ end
786
+
787
+ unless @user_defined_message_subscriptions
788
+ @user_defined_message_subscriptions = UserDefinedMessageSubscriptionList.new(
789
+ @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
790
+ end
791
+
792
+ @user_defined_message_subscriptions
793
+ end
794
+ ##
795
+ # Access the payments
796
+ # @return [PaymentList]
797
+ # @return [PaymentContext] if sid was passed.
798
+ def payments(sid=:unset)
799
+
800
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
801
+
802
+ if sid != :unset
803
+ return PaymentContext.new(@version, @solution[:account_sid], @solution[:sid],sid )
804
+ end
805
+
806
+ unless @payments
807
+ @payments = PaymentList.new(
808
+ @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
809
+ end
810
+
811
+ @payments
812
+ end
813
+ ##
814
+ # Access the recordings
815
+ # @return [RecordingList]
816
+ # @return [RecordingContext] if sid was passed.
817
+ def recordings(sid=:unset)
818
+
819
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
820
+
821
+ if sid != :unset
822
+ return RecordingContext.new(@version, @solution[:account_sid], @solution[:sid],sid )
823
+ end
824
+
825
+ unless @recordings
826
+ @recordings = RecordingList.new(
827
+ @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
828
+ end
829
+
830
+ @recordings
831
+ end
832
+ ##
833
+ # Access the notifications
834
+ # @return [NotificationList]
835
+ # @return [NotificationContext] if sid was passed.
836
+ def notifications(sid=:unset)
837
+
838
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
839
+
840
+ if sid != :unset
841
+ return NotificationContext.new(@version, @solution[:account_sid], @solution[:sid],sid )
842
+ end
843
+
844
+ unless @notifications
845
+ @notifications = NotificationList.new(
846
+ @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
847
+ end
848
+
849
+ @notifications
850
+ end
851
+ ##
852
+ # Access the streams
853
+ # @return [StreamList]
854
+ # @return [StreamContext] if sid was passed.
855
+ def streams(sid=:unset)
856
+
857
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
858
+
859
+ if sid != :unset
860
+ return StreamContext.new(@version, @solution[:account_sid], @solution[:sid],sid )
861
+ end
862
+
863
+ unless @streams
864
+ @streams = StreamList.new(
865
+ @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
866
+ end
867
+
868
+ @streams
869
+ end
870
+
871
+ ##
872
+ # Provide a user friendly representation
873
+ def to_s
874
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
875
+ "#<Twilio.Api.V2010.CallContext #{context}>"
876
+ end
877
+
878
+ ##
879
+ # Provide a detailed, user friendly representation
880
+ def inspect
881
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
882
+ "#<Twilio.Api.V2010.CallContext #{context}>"
883
+ end
884
+ end
885
+
886
+ class CallInstanceMetadata < InstanceResourceMetadata
887
+ ##
888
+ # Initializes a new CallInstanceMetadata.
889
+ # @param [Version] version Version that contains the resource
890
+ # @param [}CallInstance] call_instance The instance associated with the metadata.
891
+ # @param [Hash] headers Header object with response headers.
892
+ # @param [Integer] status_code The HTTP status code of the response.
893
+ # @return [CallInstanceMetadata] The initialized instance with metadata.
894
+ def initialize(version, call_instance, headers, status_code)
895
+ super(version, headers, status_code)
896
+ @call_instance = call_instance
897
+ end
898
+
899
+ def call
900
+ @call_instance
901
+ end
902
+
903
+ def headers
904
+ @headers
905
+ end
906
+
907
+ def status_code
908
+ @status_code
909
+ end
910
+
911
+ def to_s
912
+ "<Twilio.Api.V2010.CallInstanceMetadata status=#{@status_code}>"
913
+ end
914
+ end
915
+
916
+ class CallListResponse < InstanceListResource
917
+ # @param [Array<CallInstance>] instance
918
+ # @param [Hash{String => Object}] headers
919
+ # @param [Integer] status_code
920
+ def initialize(version, payload, key)
921
+ @call_instance = payload.body[key].map do |data|
922
+ CallInstance.new(version, data)
923
+ end
924
+ @headers = payload.headers
925
+ @status_code = payload.status_code
926
+ end
927
+
928
+ def call_instance
929
+ @instance
930
+ end
931
+ end
932
+
933
+ class CallPage < Page
934
+ ##
935
+ # Initialize the CallPage
936
+ # @param [Version] version Version that contains the resource
937
+ # @param [Response] response Response from the API
938
+ # @param [Hash] solution Path solution for the resource
939
+ # @return [CallPage] CallPage
940
+ def initialize(version, response, solution)
941
+ super(version, response)
942
+
943
+
944
+ # Path Solution
945
+ @solution = solution
946
+ end
947
+
948
+ ##
949
+ # Build an instance of CallInstance
950
+ # @param [Hash] payload Payload response from the API
951
+ # @return [CallInstance] CallInstance
952
+ def get_instance(payload)
953
+ CallInstance.new(@version, payload, account_sid: @solution[:account_sid])
954
+ end
955
+
956
+ ##
957
+ # Provide a user friendly representation
958
+ def to_s
959
+ '<Twilio.Api.V2010.CallPage>'
960
+ end
961
+ end
962
+
963
+ class CallPageMetadata < PageMetadata
964
+ attr_reader :call_page
965
+
966
+ def initialize(version, response, solution, limit)
967
+ super(version, response)
968
+ @call_page = []
969
+ @limit = limit
970
+ key = get_key(response.body)
971
+ records = 0
972
+ while( limit != :unset && records < limit )
973
+ @call_page << CallListResponse.new(version, @payload, key, limit - records)
974
+ @payload = self.next_page
975
+ break unless @payload
976
+ records += @payload.body[key].size
977
+ end
978
+ # Path Solution
979
+ @solution = solution
980
+ end
981
+
982
+ def each
983
+ @call_page.each do |record|
984
+ yield record
985
+ end
986
+ end
987
+
988
+ def to_s
989
+ '<Twilio::REST::Api::V2010PageMetadata>';
990
+ end
991
+ end
992
+ class CallListResponse < InstanceListResource
993
+
994
+ # @param [Array<CallInstance>] instance
995
+ # @param [Hash{String => Object}] headers
996
+ # @param [Integer] status_code
997
+ def initialize(version, payload, key, limit = :unset)
998
+ data_list = payload.body[key]
999
+ if limit != :unset
1000
+ data_list = data_list[0, limit]
1001
+ end
1002
+ @call = data_list.map do |data|
1003
+ CallInstance.new(version, data)
1004
+ end
1005
+ @headers = payload.headers
1006
+ @status_code = payload.status_code
1007
+ end
1008
+
1009
+ def call
1010
+ @call
1011
+ end
1012
+
1013
+ def headers
1014
+ @headers
1015
+ end
1016
+
1017
+ def status_code
1018
+ @status_code
1019
+ end
1020
+ end
1021
+
1022
+ class CallInstance < InstanceResource
1023
+ ##
1024
+ # Initialize the CallInstance
1025
+ # @param [Version] version Version that contains the resource
1026
+ # @param [Hash] payload payload that contains response from Twilio
1027
+ # @param [String] account_sid The SID of the
1028
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Call
1029
+ # resource.
1030
+ # @param [String] sid The SID of the Call resource to fetch.
1031
+ # @return [CallInstance] CallInstance
1032
+ def initialize(version, payload , account_sid: nil, sid: nil)
1033
+ super(version)
1034
+
1035
+
1036
+ # Marshaled Properties
1037
+ @properties = {
1038
+ 'sid' => payload['sid'],
1039
+ 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
1040
+ 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
1041
+ 'parent_call_sid' => payload['parent_call_sid'],
1042
+ 'account_sid' => payload['account_sid'],
1043
+ 'to' => payload['to'],
1044
+ 'to_formatted' => payload['to_formatted'],
1045
+ 'from' => payload['from'],
1046
+ 'from_formatted' => payload['from_formatted'],
1047
+ 'phone_number_sid' => payload['phone_number_sid'],
1048
+ 'status' => payload['status'],
1049
+ 'start_time' => Twilio.deserialize_rfc2822(payload['start_time']),
1050
+ 'end_time' => Twilio.deserialize_rfc2822(payload['end_time']),
1051
+ 'duration' => payload['duration'],
1052
+ 'price' => payload['price'],
1053
+ 'price_unit' => payload['price_unit'],
1054
+ 'direction' => payload['direction'],
1055
+ 'answered_by' => payload['answered_by'],
1056
+ 'api_version' => payload['api_version'],
1057
+ 'forwarded_from' => payload['forwarded_from'],
1058
+ 'group_sid' => payload['group_sid'],
1059
+ 'caller_name' => payload['caller_name'],
1060
+ 'queue_time' => payload['queue_time'],
1061
+ 'trunk_sid' => payload['trunk_sid'],
1062
+ 'uri' => payload['uri'],
1063
+ 'subresource_uris' => payload['subresource_uris'],
1064
+ }
1065
+
1066
+ # Context
1067
+ @instance_context = nil
1068
+ @params = { 'account_sid' => account_sid ,'sid' => sid || @properties['sid'] , }
1069
+ end
1070
+
1071
+ ##
1072
+ # Generate an instance context for the instance, the context is capable of
1073
+ # performing various actions. All instance actions are proxied to the context
1074
+ # @return [CallContext] CallContext for this CallInstance
1075
+ def context
1076
+ unless @instance_context
1077
+ @instance_context = CallContext.new(@version , @params['account_sid'], @params['sid'])
1078
+ end
1079
+ @instance_context
1080
+ end
1081
+
1082
+ ##
1083
+ # @return [String] The unique string that we created to identify this Call resource.
1084
+ def sid
1085
+ @properties['sid']
1086
+ end
1087
+
1088
+ ##
1089
+ # @return [Time] The date and time in UTC that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
1090
+ def date_created
1091
+ @properties['date_created']
1092
+ end
1093
+
1094
+ ##
1095
+ # @return [Time] The date and time in UTC that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
1096
+ def date_updated
1097
+ @properties['date_updated']
1098
+ end
1099
+
1100
+ ##
1101
+ # @return [String] The SID that identifies the call that created this leg.
1102
+ def parent_call_sid
1103
+ @properties['parent_call_sid']
1104
+ end
1105
+
1106
+ ##
1107
+ # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Call resource.
1108
+ def account_sid
1109
+ @properties['account_sid']
1110
+ end
1111
+
1112
+ ##
1113
+ # @return [String] The phone number, SIP address, Client identifier or SIM SID that received this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`. SIM SIDs are formatted as `sim:sid`.
1114
+ def to
1115
+ @properties['to']
1116
+ end
1117
+
1118
+ ##
1119
+ # @return [String] The phone number, SIP address or Client identifier that received this call. Formatted for display. Non-North American phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +442071838750).
1120
+ def to_formatted
1121
+ @properties['to_formatted']
1122
+ end
1123
+
1124
+ ##
1125
+ # @return [String] The phone number, SIP address, Client identifier or SIM SID that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`. SIM SIDs are formatted as `sim:sid`.
1126
+ def from
1127
+ @properties['from']
1128
+ end
1129
+
1130
+ ##
1131
+ # @return [String] The calling phone number, SIP address, or Client identifier formatted for display. Non-North American phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +442071838750).
1132
+ def from_formatted
1133
+ @properties['from_formatted']
1134
+ end
1135
+
1136
+ ##
1137
+ # @return [String] If the call was inbound, this is the SID of the IncomingPhoneNumber resource that received the call. If the call was outbound, it is the SID of the OutgoingCallerId resource from which the call was placed.
1138
+ def phone_number_sid
1139
+ @properties['phone_number_sid']
1140
+ end
1141
+
1142
+ ##
1143
+ # @return [Status]
1144
+ def status
1145
+ @properties['status']
1146
+ end
1147
+
1148
+ ##
1149
+ # @return [Time] The start time of the call, given as UTC in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call has not yet been dialed.
1150
+ def start_time
1151
+ @properties['start_time']
1152
+ end
1153
+
1154
+ ##
1155
+ # @return [Time] The time the call ended, given as UTC in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call did not complete successfully.
1156
+ def end_time
1157
+ @properties['end_time']
1158
+ end
1159
+
1160
+ ##
1161
+ # @return [String] The length of the call in seconds. This value is empty for busy, failed, unanswered, or ongoing calls.
1162
+ def duration
1163
+ @properties['duration']
1164
+ end
1165
+
1166
+ ##
1167
+ # @return [String] The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available. The price associated with a call only reflects the charge for connectivity. Charges for other call-related features such as Answering Machine Detection, Text-To-Speech, and SIP REFER are not included in this value.
1168
+ def price
1169
+ @properties['price']
1170
+ end
1171
+
1172
+ ##
1173
+ # @return [String] The currency in which `Price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g., `USD`, `EUR`, `JPY`). Always capitalized for calls.
1174
+ def price_unit
1175
+ @properties['price_unit']
1176
+ end
1177
+
1178
+ ##
1179
+ # @return [String] A string describing the direction of the call. Can be: `inbound` for inbound calls, `outbound-api` for calls initiated via the REST API or `outbound-dial` for calls initiated by a `<Dial>` verb. Using [Elastic SIP Trunking](https://www.twilio.com/docs/sip-trunking), the values can be [`trunking-terminating`](https://www.twilio.com/docs/sip-trunking#termination) for outgoing calls from your communications infrastructure to the PSTN or [`trunking-originating`](https://www.twilio.com/docs/sip-trunking#origination) for incoming calls to your communications infrastructure from the PSTN.
1180
+ def direction
1181
+ @properties['direction']
1182
+ end
1183
+
1184
+ ##
1185
+ # @return [String] Either `human` or `machine` if this call was initiated with answering machine detection. Empty otherwise.
1186
+ def answered_by
1187
+ @properties['answered_by']
1188
+ end
1189
+
1190
+ ##
1191
+ # @return [String] The API version used to create the call.
1192
+ def api_version
1193
+ @properties['api_version']
1194
+ end
1195
+
1196
+ ##
1197
+ # @return [String] The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding). Otherwise, empty.
1198
+ def forwarded_from
1199
+ @properties['forwarded_from']
1200
+ end
1201
+
1202
+ ##
1203
+ # @return [String] The Group SID associated with this call. If no Group is associated with the call, the field is empty.
1204
+ def group_sid
1205
+ @properties['group_sid']
1206
+ end
1207
+
1208
+ ##
1209
+ # @return [String] The caller's name if this call was an incoming call to a phone number with caller ID Lookup enabled. Otherwise, empty.
1210
+ def caller_name
1211
+ @properties['caller_name']
1212
+ end
1213
+
1214
+ ##
1215
+ # @return [String] The wait time in milliseconds before the call is placed.
1216
+ def queue_time
1217
+ @properties['queue_time']
1218
+ end
1219
+
1220
+ ##
1221
+ # @return [String] The unique identifier of the trunk resource that was used for this call. The field is empty if the call was not made using a SIP trunk or if the call is not terminated.
1222
+ def trunk_sid
1223
+ @properties['trunk_sid']
1224
+ end
1225
+
1226
+ ##
1227
+ # @return [String] The URI of this resource, relative to `https://api.twilio.com`.
1228
+ def uri
1229
+ @properties['uri']
1230
+ end
1231
+
1232
+ ##
1233
+ # @return [Hash] A list of subresources available to this call, identified by their URIs relative to `https://api.twilio.com`.
1234
+ def subresource_uris
1235
+ @properties['subresource_uris']
1236
+ end
1237
+
1238
+ ##
1239
+ # Delete the CallInstance
1240
+ # @return [Boolean] True if delete succeeds, false otherwise
1241
+ def delete
1242
+
1243
+ context.delete
1244
+ end
1245
+
1246
+ ##
1247
+ # Fetch the CallInstance
1248
+ # @return [CallInstance] Fetched CallInstance
1249
+ def fetch
1250
+
1251
+ context.fetch
1252
+ end
1253
+
1254
+ ##
1255
+ # Update the CallInstance
1256
+ # @param [String] url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls).
1257
+ # @param [String] method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
1258
+ # @param [UpdateStatus] status
1259
+ # @param [String] fallback_url The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored.
1260
+ # @param [String] fallback_method The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
1261
+ # @param [String] status_callback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted).
1262
+ # @param [String] status_callback_method The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored.
1263
+ # @param [String] twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive
1264
+ # @param [String] time_limit The maximum duration of the call in seconds. Constraints depend on account and configuration.
1265
+ # @return [CallInstance] Updated CallInstance
1266
+ def update(
1267
+ url: :unset,
1268
+ method: :unset,
1269
+ status: :unset,
1270
+ fallback_url: :unset,
1271
+ fallback_method: :unset,
1272
+ status_callback: :unset,
1273
+ status_callback_method: :unset,
1274
+ twiml: :unset,
1275
+ time_limit: :unset
1276
+ )
1277
+
1278
+ context.update(
1279
+ url: url,
1280
+ method: method,
1281
+ status: status,
1282
+ fallback_url: fallback_url,
1283
+ fallback_method: fallback_method,
1284
+ status_callback: status_callback,
1285
+ status_callback_method: status_callback_method,
1286
+ twiml: twiml,
1287
+ time_limit: time_limit,
1288
+ )
1289
+ end
1290
+
1291
+ ##
1292
+ # Access the events
1293
+ # @return [events] events
1294
+ def events
1295
+ context.events
1296
+ end
1297
+
1298
+ ##
1299
+ # Access the user_defined_messages
1300
+ # @return [user_defined_messages] user_defined_messages
1301
+ def user_defined_messages
1302
+ context.user_defined_messages
1303
+ end
1304
+
1305
+ ##
1306
+ # Access the transcriptions
1307
+ # @return [transcriptions] transcriptions
1308
+ def transcriptions
1309
+ context.transcriptions
1310
+ end
1311
+
1312
+ ##
1313
+ # Access the siprec
1314
+ # @return [siprec] siprec
1315
+ def siprec
1316
+ context.siprec
1317
+ end
1318
+
1319
+ ##
1320
+ # Access the user_defined_message_subscriptions
1321
+ # @return [user_defined_message_subscriptions] user_defined_message_subscriptions
1322
+ def user_defined_message_subscriptions
1323
+ context.user_defined_message_subscriptions
1324
+ end
1325
+
1326
+ ##
1327
+ # Access the payments
1328
+ # @return [payments] payments
1329
+ def payments
1330
+ context.payments
1331
+ end
1332
+
1333
+ ##
1334
+ # Access the recordings
1335
+ # @return [recordings] recordings
1336
+ def recordings
1337
+ context.recordings
1338
+ end
1339
+
1340
+ ##
1341
+ # Access the notifications
1342
+ # @return [notifications] notifications
1343
+ def notifications
1344
+ context.notifications
1345
+ end
1346
+
1347
+ ##
1348
+ # Access the streams
1349
+ # @return [streams] streams
1350
+ def streams
1351
+ context.streams
1352
+ end
1353
+
1354
+ ##
1355
+ # Provide a user friendly representation
1356
+ def to_s
1357
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
1358
+ "<Twilio.Api.V2010.CallInstance #{values}>"
1359
+ end
1360
+
1361
+ ##
1362
+ # Provide a detailed, user friendly representation
1363
+ def inspect
1364
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
1365
+ "<Twilio.Api.V2010.CallInstance #{values}>"
1366
+ end
1367
+ end
1368
+
1369
+ end
1051
1370
  end
1052
- end
1053
1371
  end
1054
- end
1055
1372
  end
1056
- end
1057
- end
1373
+ end
1374
+
1375
+