twilio-ruby 5.42.0 → 5.46.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CHANGES.md +95 -0
  4. data/LICENSE +1 -1
  5. data/README.md +18 -2
  6. data/lib/twilio-ruby.rb +1 -1
  7. data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +1 -1
  8. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +34 -9
  9. data/lib/twilio-ruby/rest/api/v2010/account/call/event.rb +201 -0
  10. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +13 -13
  11. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +1 -1
  12. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +17 -5
  13. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +17 -12
  14. data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +3 -3
  15. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +5 -5
  16. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +6 -3
  17. data/lib/twilio-ruby/rest/api/v2010/account/token.rb +1 -1
  18. data/lib/twilio-ruby/rest/bulkexports.rb +4 -2
  19. data/lib/twilio-ruby/rest/bulkexports/v1.rb +4 -2
  20. data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +7 -4
  21. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +7 -4
  22. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +5 -3
  23. data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +5 -3
  24. data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +5 -3
  25. data/lib/twilio-ruby/rest/chat/v1/service.rb +5 -5
  26. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +6 -6
  27. data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +3 -3
  28. data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +3 -3
  29. data/lib/twilio-ruby/rest/chat/v1/service/role.rb +9 -9
  30. data/lib/twilio-ruby/rest/chat/v2/service.rb +5 -5
  31. data/lib/twilio-ruby/rest/chat/v2/service/binding.rb +7 -7
  32. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +6 -6
  33. data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +3 -3
  34. data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +3 -3
  35. data/lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb +27 -24
  36. data/lib/twilio-ruby/rest/chat/v2/service/role.rb +9 -9
  37. data/lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb +10 -10
  38. data/lib/twilio-ruby/rest/client.rb +29 -3
  39. data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +9 -9
  40. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +1 -1
  41. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +32 -2
  42. data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +9 -9
  43. data/lib/twilio-ruby/rest/conversations/v1/role.rb +9 -9
  44. data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +7 -7
  45. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +17 -2
  46. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +1 -1
  47. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +32 -2
  48. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +9 -9
  49. data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +9 -9
  50. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +8 -1
  51. data/lib/twilio-ruby/rest/conversations/v1/user.rb +8 -1
  52. data/lib/twilio-ruby/rest/events/v1/sink.rb +2 -1
  53. data/lib/twilio-ruby/rest/events/v1/subscription.rb +14 -7
  54. data/lib/twilio-ruby/rest/flex_api.rb +1 -1
  55. data/lib/twilio-ruby/rest/flex_api/v1.rb +1 -1
  56. data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +5 -5
  57. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +4 -4
  58. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +88 -76
  59. data/lib/twilio-ruby/rest/flex_api/v1/web_channel.rb +2 -2
  60. data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +8 -9
  61. data/lib/twilio-ruby/rest/insights/v1/room.rb +7 -7
  62. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +2 -9
  63. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +3 -3
  64. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +3 -3
  65. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +3 -3
  66. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +3 -3
  67. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +4 -4
  68. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +3 -3
  69. data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +7 -7
  70. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +3 -3
  71. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +3 -3
  72. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +3 -3
  73. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +6 -6
  74. data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +4 -4
  75. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +4 -4
  76. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +16 -16
  77. data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +1 -1
  78. data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +1 -1
  79. data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +1 -1
  80. data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +16 -15
  81. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +18 -18
  82. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +1 -1
  83. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb +1 -1
  84. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb +1 -1
  85. data/lib/twilio-ruby/rest/preview.rb +4 -23
  86. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +4 -2
  87. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +7 -4
  88. data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +7 -4
  89. data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +5 -3
  90. data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +5 -3
  91. data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +5 -3
  92. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +13 -13
  93. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +2 -2
  94. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +8 -8
  95. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +0 -30
  96. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +2 -2
  97. data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +2 -2
  98. data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +1 -1
  99. data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +2 -2
  100. data/lib/twilio-ruby/rest/pricing/v2/voice/country.rb +2 -2
  101. data/lib/twilio-ruby/rest/pricing/v2/voice/number.rb +1 -1
  102. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +1 -1
  103. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +1 -1
  104. data/lib/twilio-ruby/rest/serverless/v1/service.rb +5 -5
  105. data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +4 -4
  106. data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +4 -4
  107. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +10 -10
  108. data/lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb +4 -4
  109. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +4 -4
  110. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +4 -4
  111. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +4 -4
  112. data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +4 -4
  113. data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
  114. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +4 -4
  115. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +4 -4
  116. data/lib/twilio-ruby/rest/studio/v2/flow.rb +2 -2
  117. data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +1 -1
  118. data/lib/twilio-ruby/rest/studio/v2/flow/test_user.rb +3 -3
  119. data/lib/twilio-ruby/rest/supersim/v1/network.rb +1 -1
  120. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +2 -2
  121. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +1 -1
  122. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +7 -5
  123. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +4 -2
  124. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +3 -3
  125. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +4 -2
  126. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +4 -4
  127. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +1 -1
  128. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb +1 -1
  129. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +12 -9
  130. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +10 -10
  131. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +16 -16
  132. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +1 -1
  133. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +10 -10
  134. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +1 -1
  135. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +1 -1
  136. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +1 -1
  137. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +1 -1
  138. data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +21 -24
  139. data/lib/twilio-ruby/rest/verify/v2/service.rb +3 -3
  140. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +3 -1
  141. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +8 -6
  142. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
  143. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +10 -10
  144. data/lib/twilio-ruby/rest/video/v1/composition.rb +16 -15
  145. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +26 -26
  146. data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +6 -6
  147. data/lib/twilio-ruby/rest/video/v1/recording.rb +6 -6
  148. data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +6 -6
  149. data/lib/twilio-ruby/rest/video/v1/room.rb +10 -3
  150. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +1 -1
  151. data/lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb +1 -1
  152. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +1 -1
  153. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +4 -4
  154. data/lib/twilio-ruby/twiml/voice_response.rb +8 -4
  155. data/lib/twilio-ruby/util/configuration.rb +5 -1
  156. data/lib/twilio-ruby/version.rb +1 -1
  157. data/spec/integration/api/v2010/account/call/event_spec.rb +102 -0
  158. data/spec/integration/api/v2010/account/call/recording_spec.rb +4 -0
  159. data/spec/integration/api/v2010/account/call_spec.rb +20 -10
  160. data/spec/integration/api/v2010/account/conference/participant_spec.rb +30 -0
  161. data/spec/integration/conversations/v1/conversation/participant_spec.rb +30 -10
  162. data/spec/integration/conversations/v1/service/configuration_spec.rb +2 -0
  163. data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +30 -10
  164. data/spec/integration/conversations/v1/service/user_spec.rb +9 -4
  165. data/spec/integration/conversations/v1/user_spec.rb +9 -4
  166. data/spec/integration/events/v1/sink_spec.rb +14 -0
  167. data/spec/integration/events/v1/subscription_spec.rb +49 -0
  168. data/spec/integration/insights/v1/call/summary_spec.rb +1 -0
  169. data/spec/integration/insights/v1/room/participant_spec.rb +0 -2
  170. data/spec/integration/lookups/v1/phone_number_spec.rb +7 -7
  171. data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +1 -1
  172. data/spec/integration/trunking/v1/trunk/recording_spec.rb +2 -6
  173. data/spec/integration/video/v1/room_spec.rb +5 -0
  174. data/spec/rest/client_spec.rb +24 -2
  175. data/spec/twiml/voice_response_spec.rb +1 -1
  176. data/twilio-ruby.gemspec +1 -0
  177. metadata +19 -17
  178. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_call.rb +0 -243
  179. data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +0 -213
  180. data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb +0 -108
  181. data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb +0 -260
  182. data/lib/twilio-ruby/rest/preview/trusted_comms/phone_call.rb +0 -342
  183. data/spec/integration/preview/trusted_comms/branded_call_spec.rb +0 -59
  184. data/spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb +0 -56
  185. data/spec/integration/preview/trusted_comms/business/insights_spec.rb +0 -12
  186. data/spec/integration/preview/trusted_comms/business_spec.rb +0 -45
  187. data/spec/integration/preview/trusted_comms/phone_call_spec.rb +0 -59
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9778eed7f661d600a460a4f11f0cc9c4ecb1f9327ae1fa0bc7f17701b45f783
4
- data.tar.gz: 1efe2eaf64fed893801694ec1f9dd68a40ac98be3e444ef2989b7acf520331bc
3
+ metadata.gz: ec2f94329e022fb33cd55a694e8ef8638b465b3b1b9f336b392308a30ff4b6c0
4
+ data.tar.gz: 5cae812b5d92082cc9f1f5d9c00c4cb87e2cf07daf1f9cf53539d5be8b4dde77
5
5
  SHA512:
6
- metadata.gz: 147bb2ba1d376c0d8f7e0335c0c744ba07696cf05ca1368a586750ec746692715a5415b1179c4b8485cec6e42670192704b288cf993cd25e8485888f348da2f4
7
- data.tar.gz: 61de95cc6c57cf05b0acf95e6f4ab218402651d3fea976cb88f21527e868b184fb6a0ac9b278e3e6597c31e233b0391801d1d7f660a57c4468189f605a51bd15
6
+ metadata.gz: 4a4d102e1238ceffe7b22101af1e23573a90e47ff8accead506f303794791e9d6adbd48b302583e5ae15ddcf2d5fc2336ccfeba3676cf8f2767e2c0a10388141
7
+ data.tar.gz: 86eb8eb1f84acc4f13c8574430a5e86ea63b150b537263c3af0fbb878a7d0dcf2c4d7de998e94356cb8c171a8f029bef66866ef3f2973981e2e519730b2cfe1f
@@ -4,6 +4,7 @@ bundler_args: --without development
4
4
 
5
5
  rvm:
6
6
  - ruby-head
7
+ - 3.0
7
8
  - 2.7
8
9
  - 2.6
9
10
  - 2.5
data/CHANGES.md CHANGED
@@ -1,6 +1,101 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2021-01-13] Version 5.46.0
5
+ ---------------------------
6
+ **Library - Docs**
7
+ - [PR #546](https://github.com/twilio/twilio-ruby/pull/546): Fixing docs for list parameter types. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
8
+
9
+ **Library - Fix**
10
+ - [PR #545](https://github.com/twilio/twilio-ruby/pull/545): Adds Ruby 3.0 to Travis. Fixes test. Thanks to [@philnash](https://github.com/philnash)!
11
+
12
+ **Api**
13
+ - Add 'Electric Imp v1 Usage' to usage categories
14
+
15
+ **Conversations**
16
+ - Changed `last_read_message_index` type in Participant's resource **(breaking change)**
17
+
18
+ **Insights**
19
+ - Added `created_time` to call summary.
20
+
21
+ **Sync**
22
+ - Remove HideExpired query parameter for filtering Sync Documents with expired **(breaking change)**
23
+
24
+ **Video**
25
+ - [Rooms] Expose maxConcurrentPublishedTracks property in Room resource
26
+
27
+
28
+ [2020-12-16] Version 5.45.1
29
+ ---------------------------
30
+ **Api**
31
+ - Updated `call_event` default_output_properties to request and response.
32
+
33
+ **Conversations**
34
+ - Added `last_read_message_index` and `last_read_timestamp` to Participant's resource update operation
35
+ - Added `is_notifiable` and `is_online` to User's resource
36
+ - Added `reachability_enabled` parameters to update method for Conversation Service Configuration resource
37
+
38
+ **Messaging**
39
+ - Added WA template quick reply, URL, and phone number buttons
40
+
41
+ **Twiml**
42
+ - Add `sequential` to `Dial`.
43
+
44
+
45
+ [2020-12-08] Version 5.45.0
46
+ ---------------------------
47
+ **Api**
48
+ - Added optional `RecordingTrack` parameter for create calls, create participants, and create call recordings
49
+ - Removed deprecated Programmable Chat usage record categories **(breaking change)**
50
+
51
+ **Twiml**
52
+ - Add `recordingTrack` to `Dial`.
53
+
54
+
55
+ [2020-12-02] Version 5.44.0
56
+ ---------------------------
57
+ **Api**
58
+ - Remove `RecordingTrack` parameter for create calls, create participants, and create call recordings **(breaking change)**
59
+ - Added `RecordingTrack` parameter for create calls and create call recordings
60
+ - Add optional property `recording_track` in the participant create request
61
+
62
+ **Lookups**
63
+ - Changed `caller_name` and `carrier` properties type to object **(breaking change)**
64
+
65
+ **Trunking**
66
+ - Added dual channel recording options for Trunks.
67
+
68
+ **Twiml**
69
+ - Add `jitterBufferSize` and `participantLabel` to `Conference`.
70
+
71
+
72
+ [2020-11-18] Version 5.43.0
73
+ ---------------------------
74
+ **Library - Feature**
75
+ - [PR #538](https://github.com/twilio/twilio-ruby/pull/538): adding http logging for ruby. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
76
+
77
+ **Api**
78
+ - Add new call events resource - GET /2010-04-01/Accounts/{account_sid}/Calls/{call_sid}/Events.json
79
+
80
+ **Conversations**
81
+ - Fixed default response property issue for Service Notifications Configuration
82
+
83
+ **Insights**
84
+ - Removing call_sid from participant summary. **(breaking change)**
85
+
86
+ **Serverless**
87
+ - Allow Service unique name to be used in path (in place of SID) in Service update request
88
+
89
+ **Sync**
90
+ - Added HideExpired query parameter for filtering Sync Documents with expired
91
+
92
+ **Verify**
93
+ - Challenge `Details` and `HiddenDetails` properties are now marked as `PII`
94
+ - Challenge `expiration_date` attribute updated to set a default value of five (5) minutes and to allow max dates of one (1) hour after creation.
95
+ - Entity `identity` attribute updated to allow values between 8 and 64 characters.
96
+ - Verify Service frinedly_name attribute updated from 64 max lenght to 30 characters.
97
+
98
+
4
99
  [2020-11-05] Version 5.42.0
5
100
  ---------------------------
6
101
  **Library - Feature**
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (C) 2020, Twilio, Inc. <help@twilio.com>
3
+ Copyright (C) 2021, Twilio, Inc. <help@twilio.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -34,13 +34,13 @@ This library supports the following Ruby implementations:
34
34
  To install using [Bundler][bundler] grab the latest stable version:
35
35
 
36
36
  ```ruby
37
- gem 'twilio-ruby', '~> 5.42.0'
37
+ gem 'twilio-ruby', '~> 5.46.0'
38
38
  ```
39
39
 
40
40
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
41
41
 
42
42
  ```bash
43
- gem install twilio-ruby -v 5.42.0
43
+ gem install twilio-ruby -v 5.46.0
44
44
  ```
45
45
 
46
46
  To build and install the development branch yourself from the latest source:
@@ -81,6 +81,22 @@ To take advantage of Twilio's [Global Infrastructure](https://www.twilio.com/doc
81
81
  @client.edge = 'sydney'
82
82
  ```
83
83
 
84
+ ### Enable Debug logging
85
+
86
+ In order to enable debug logging, pass in a 'logger' instance to the client with the level set to at least 'DEBUG'
87
+
88
+ ```ruby
89
+ @client = Twilio::REST::Client.new account_sid, auth_token
90
+ myLogger = Logger.new(STDOUT)
91
+ myLogger.level = Logger::DEBUG
92
+ @client.logger = myLogger
93
+
94
+ @client = Twilio::REST::Client.new account_sid, auth_token
95
+ myLogger = Logger.new('my_log.log')
96
+ myLogger.level = Logger::DEBUG
97
+ @client.logger = myLogger
98
+ ```
99
+
84
100
  This will result in the `hostname` transforming from `api.twilio.com` to `api.sydney.au1.twilio.com`.
85
101
 
86
102
  ### Make a Call
@@ -38,7 +38,7 @@ module Twilio
38
38
  autoload :JWT, File.join(File.dirname(__FILE__), 'twilio-ruby', 'jwt', 'jwt.rb')
39
39
  autoload :TwiML, File.join(File.dirname(__FILE__), 'twilio-ruby', 'twiml', 'twiml.rb')
40
40
 
41
- def_delegators :configuration, :account_sid, :auth_token, :http_client, :region, :edge
41
+ def_delegators :configuration, :account_sid, :auth_token, :http_client, :region, :edge, :logger
42
42
 
43
43
  ##
44
44
  # Pre-configure with account SID and auth token so that you don't need to
@@ -288,7 +288,7 @@ module Twilio
288
288
  end
289
289
 
290
290
  ##
291
- # @return [authorized_connect_app.Permission] Permissions authorized to the app
291
+ # @return [Array[authorized_connect_app.Permission]] Permissions authorized to the app
292
292
  def permissions
293
293
  @properties['permissions']
294
294
  end
@@ -52,10 +52,10 @@ module Twilio
52
52
  # `status_callback_event` is specified, we will send the `completed` status. If an
53
53
  # `application_sid` parameter is present, this parameter is ignored. URLs must
54
54
  # contain a valid hostname (underscores are not permitted).
55
- # @param [String] status_callback_event The call progress events that we will send
56
- # to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and
57
- # `completed`. If no event is specified, we send the `completed` status. If you
58
- # want to receive multiple events, specify each one in a separate
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
59
  # `status_callback_event` parameter. See the code sample for {monitoring call
60
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
61
  # If an `application_sid` is present, this parameter is ignored.
@@ -106,10 +106,10 @@ module Twilio
106
106
  # @param [String] machine_detection_timeout The number of seconds that we should
107
107
  # attempt to detect an answering machine before timing out and sending a voice
108
108
  # request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds.
109
- # @param [String] recording_status_callback_event The recording status events that
110
- # will trigger calls to the URL specified in `recording_status_callback`. Can be:
111
- # `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate
112
- # multiple values with a space.
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
113
  # @param [String] trim Whether to trim any leading and trailing silence from the
114
114
  # recording. Can be: `trim-silence` or `do-not-trim` and the default is
115
115
  # `trim-silence`.
@@ -142,6 +142,10 @@ module Twilio
142
142
  # @param [String] call_reason The Reason for the outgoing call. Use it to specify
143
143
  # the purpose of the call that is presented on the called party's phone. (Branded
144
144
  # Calls Beta)
145
+ # @param [String] recording_track The audio track to record for the call. Can be:
146
+ # `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the
147
+ # audio that is received by Twilio. `outbound` records the audio that is generated
148
+ # from Twilio. `both` records the audio that is received and generated by Twilio.
145
149
  # @param [String] url The absolute URL that returns the TwiML instructions for the
146
150
  # call. We will call this URL using the `method` when the call connects. For more
147
151
  # information, see the {Url
@@ -153,7 +157,7 @@ module Twilio
153
157
  # @param [String] application_sid The SID of the Application resource that will
154
158
  # handle the call, if the call will be handled by an application.
155
159
  # @return [CallInstance] Created CallInstance
156
- 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, url: :unset, twiml: :unset, application_sid: :unset)
160
+ 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, recording_track: :unset, url: :unset, twiml: :unset, application_sid: :unset)
157
161
  data = Twilio::Values.of({
158
162
  'To' => to,
159
163
  'From' => from,
@@ -187,6 +191,7 @@ module Twilio
187
191
  'AsyncAmdStatusCallbackMethod' => async_amd_status_callback_method,
188
192
  'Byoc' => byoc,
189
193
  'CallReason' => call_reason,
194
+ 'RecordingTrack' => recording_track,
190
195
  })
191
196
 
192
197
  payload = @version.create('POST', @uri, data: data)
@@ -426,6 +431,7 @@ module Twilio
426
431
  @recordings = nil
427
432
  @notifications = nil
428
433
  @feedback = nil
434
+ @events = nil
429
435
  @payments = nil
430
436
  end
431
437
 
@@ -546,6 +552,18 @@ module Twilio
546
552
  FeedbackContext.new(@version, @solution[:account_sid], @solution[:sid], )
547
553
  end
548
554
 
555
+ ##
556
+ # Access the events
557
+ # @return [EventList]
558
+ # @return [EventContext]
559
+ def events
560
+ unless @events
561
+ @events = EventList.new(@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
562
+ end
563
+
564
+ @events
565
+ end
566
+
549
567
  ##
550
568
  # Access the payments
551
569
  # @return [PaymentList]
@@ -885,6 +903,13 @@ module Twilio
885
903
  context.feedback
886
904
  end
887
905
 
906
+ ##
907
+ # Access the events
908
+ # @return [events] events
909
+ def events
910
+ context.events
911
+ end
912
+
888
913
  ##
889
914
  # Access the payments
890
915
  # @return [payments] payments
@@ -0,0 +1,201 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Api < Domain
12
+ class V2010 < Version
13
+ class AccountContext < InstanceContext
14
+ class CallContext < InstanceContext
15
+ class EventList < ListResource
16
+ ##
17
+ # Initialize the EventList
18
+ # @param [Version] version Version that contains the resource
19
+ # @param [String] account_sid The SID of the
20
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Call
21
+ # resource.
22
+ # @param [String] call_sid The unique string that that we created to identify this
23
+ # Call resource.
24
+ # @return [EventList] EventList
25
+ def initialize(version, account_sid: nil, call_sid: nil)
26
+ super(version)
27
+
28
+ # Path Solution
29
+ @solution = {account_sid: account_sid, call_sid: call_sid}
30
+ @uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:call_sid]}/Events.json"
31
+ end
32
+
33
+ ##
34
+ # Lists EventInstance records from the API as a list.
35
+ # Unlike stream(), this operation is eager and will load `limit` records into
36
+ # memory before returning.
37
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
38
+ # guarantees to never return more than limit. Default is no limit
39
+ # @param [Integer] page_size Number of records to fetch per request, when
40
+ # not set will use the default value of 50 records. If no page_size is defined
41
+ # but a limit is defined, stream() will attempt to read the limit with the most
42
+ # efficient page size, i.e. min(limit, 1000)
43
+ # @return [Array] Array of up to limit results
44
+ def list(limit: nil, page_size: nil)
45
+ self.stream(limit: limit, page_size: page_size).entries
46
+ end
47
+
48
+ ##
49
+ # Streams EventInstance records from the API as an Enumerable.
50
+ # This operation lazily loads records as efficiently as possible until the limit
51
+ # is reached.
52
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
53
+ # guarantees to never return more than limit. Default is no limit.
54
+ # @param [Integer] page_size Number of records to fetch per request, when
55
+ # not set will use the default value of 50 records. If no page_size is defined
56
+ # but a limit is defined, stream() will attempt to read the limit with the most
57
+ # efficient page size, i.e. min(limit, 1000)
58
+ # @return [Enumerable] Enumerable that will yield up to limit results
59
+ def stream(limit: nil, page_size: nil)
60
+ limits = @version.read_limits(limit, page_size)
61
+
62
+ page = self.page(page_size: limits[:page_size], )
63
+
64
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
65
+ end
66
+
67
+ ##
68
+ # When passed a block, yields EventInstance records from the API.
69
+ # This operation lazily loads records as efficiently as possible until the limit
70
+ # is reached.
71
+ def each
72
+ limits = @version.read_limits
73
+
74
+ page = self.page(page_size: limits[:page_size], )
75
+
76
+ @version.stream(page,
77
+ limit: limits[:limit],
78
+ page_limit: limits[:page_limit]).each {|x| yield x}
79
+ end
80
+
81
+ ##
82
+ # Retrieve a single page of EventInstance records from the API.
83
+ # Request is executed immediately.
84
+ # @param [String] page_token PageToken provided by the API
85
+ # @param [Integer] page_number Page Number, this value is simply for client state
86
+ # @param [Integer] page_size Number of records to return, defaults to 50
87
+ # @return [Page] Page of EventInstance
88
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
89
+ params = Twilio::Values.of({
90
+ 'PageToken' => page_token,
91
+ 'Page' => page_number,
92
+ 'PageSize' => page_size,
93
+ })
94
+
95
+ response = @version.page('GET', @uri, params: params)
96
+
97
+ EventPage.new(@version, response, @solution)
98
+ end
99
+
100
+ ##
101
+ # Retrieve a single page of EventInstance records from the API.
102
+ # Request is executed immediately.
103
+ # @param [String] target_url API-generated URL for the requested results page
104
+ # @return [Page] Page of EventInstance
105
+ def get_page(target_url)
106
+ response = @version.domain.request(
107
+ 'GET',
108
+ target_url
109
+ )
110
+ EventPage.new(@version, response, @solution)
111
+ end
112
+
113
+ ##
114
+ # Provide a user friendly representation
115
+ def to_s
116
+ '#<Twilio.Api.V2010.EventList>'
117
+ end
118
+ end
119
+
120
+ class EventPage < Page
121
+ ##
122
+ # Initialize the EventPage
123
+ # @param [Version] version Version that contains the resource
124
+ # @param [Response] response Response from the API
125
+ # @param [Hash] solution Path solution for the resource
126
+ # @return [EventPage] EventPage
127
+ def initialize(version, response, solution)
128
+ super(version, response)
129
+
130
+ # Path Solution
131
+ @solution = solution
132
+ end
133
+
134
+ ##
135
+ # Build an instance of EventInstance
136
+ # @param [Hash] payload Payload response from the API
137
+ # @return [EventInstance] EventInstance
138
+ def get_instance(payload)
139
+ EventInstance.new(
140
+ @version,
141
+ payload,
142
+ account_sid: @solution[:account_sid],
143
+ call_sid: @solution[:call_sid],
144
+ )
145
+ end
146
+
147
+ ##
148
+ # Provide a user friendly representation
149
+ def to_s
150
+ '<Twilio.Api.V2010.EventPage>'
151
+ end
152
+ end
153
+
154
+ class EventInstance < InstanceResource
155
+ ##
156
+ # Initialize the EventInstance
157
+ # @param [Version] version Version that contains the resource
158
+ # @param [Hash] payload payload that contains response from Twilio
159
+ # @param [String] account_sid The SID of the
160
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Call
161
+ # resource.
162
+ # @param [String] call_sid The unique string that that we created to identify this
163
+ # Call resource.
164
+ # @return [EventInstance] EventInstance
165
+ def initialize(version, payload, account_sid: nil, call_sid: nil)
166
+ super(version)
167
+
168
+ # Marshaled Properties
169
+ @properties = {'request' => payload['request'], 'response' => payload['response'], }
170
+ end
171
+
172
+ ##
173
+ # @return [Hash] Call Request.
174
+ def request
175
+ @properties['request']
176
+ end
177
+
178
+ ##
179
+ # @return [Hash] Call Response with Events.
180
+ def response
181
+ @properties['response']
182
+ end
183
+
184
+ ##
185
+ # Provide a user friendly representation
186
+ def to_s
187
+ "<Twilio.Api.V2010.EventInstance>"
188
+ end
189
+
190
+ ##
191
+ # Provide a detailed, user friendly representation
192
+ def inspect
193
+ "<Twilio.Api.V2010.EventInstance>"
194
+ end
195
+ end
196
+ end
197
+ end
198
+ end
199
+ end
200
+ end
201
+ end