twilio-ruby 6.12.1 → 7.0.0.pre.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test-and-deploy.yml +9 -9
  3. data/CHANGES.md +10 -57
  4. data/README.md +2 -2
  5. data/UPGRADE.md +10 -0
  6. data/lib/twilio-ruby/framework/request.rb +8 -1
  7. data/lib/twilio-ruby/http/http_client.rb +10 -3
  8. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +267 -0
  9. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +332 -0
  10. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +0 -2
  11. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +37 -28
  12. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +3 -27
  13. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +0 -2
  14. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +0 -2
  15. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +5 -17
  16. data/lib/twilio-ruby/rest/client.rb +5 -0
  17. data/lib/twilio-ruby/rest/content/v1/content/approval_create.rb +184 -0
  18. data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +0 -2
  19. data/lib/twilio-ruby/rest/content/v1/content.rb +363 -3
  20. data/lib/twilio-ruby/rest/content/v1/content_and_approvals.rb +1 -1
  21. data/lib/twilio-ruby/rest/content/v1/legacy_content.rb +1 -1
  22. data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +0 -2
  23. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +21 -0
  24. data/lib/twilio-ruby/rest/flex_api/v1/insights_conversational_ai.rb +274 -0
  25. data/lib/twilio-ruby/rest/flex_api/v1/insights_conversational_ai_report_insights.rb +253 -0
  26. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb +0 -2
  27. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb +0 -2
  28. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +0 -2
  29. data/lib/twilio-ruby/rest/flex_api/v1/insights_session.rb +0 -2
  30. data/lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb +0 -2
  31. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +1 -11
  32. data/lib/twilio-ruby/rest/flex_api/v1/provisioning_status.rb +0 -2
  33. data/lib/twilio-ruby/rest/flex_api/v1.rb +30 -112
  34. data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +0 -2
  35. data/lib/twilio-ruby/rest/insights/v1/call/annotation.rb +0 -2
  36. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +0 -2
  37. data/lib/twilio-ruby/rest/insights/v1/room.rb +0 -2
  38. data/lib/twilio-ruby/rest/intelligence/v2/service.rb +0 -2
  39. data/lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb +0 -2
  40. data/lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb +0 -2
  41. data/lib/twilio-ruby/rest/intelligence/v2/transcript.rb +0 -2
  42. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +1 -1
  43. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +6 -8
  44. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +0 -2
  45. data/lib/twilio-ruby/rest/media.rb +32 -3
  46. data/lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_vetting.rb +0 -2
  47. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +2 -11
  48. data/lib/twilio-ruby/rest/messaging/v1/domain_certs.rb +0 -2
  49. data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +0 -2
  50. data/lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb +0 -2
  51. data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb +0 -2
  52. data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service_domain_association.rb +0 -2
  53. data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +0 -2
  54. data/lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb +0 -2
  55. data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +0 -2
  56. data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +0 -2
  57. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +0 -2
  58. data/lib/twilio-ruby/rest/messaging/v1/service.rb +0 -2
  59. data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +4 -13
  60. data/lib/twilio-ruby/rest/microvisor/v1/account_config.rb +0 -2
  61. data/lib/twilio-ruby/rest/microvisor/v1/account_secret.rb +0 -2
  62. data/lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb +0 -2
  63. data/lib/twilio-ruby/rest/microvisor/v1/app.rb +0 -2
  64. data/lib/twilio-ruby/rest/microvisor/v1/device/device_config.rb +0 -2
  65. data/lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb +0 -2
  66. data/lib/twilio-ruby/rest/microvisor/v1/device.rb +0 -2
  67. data/lib/twilio-ruby/rest/notify/v1/credential.rb +0 -2
  68. data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +0 -2
  69. data/lib/twilio-ruby/rest/notify/v1/service.rb +0 -2
  70. data/lib/twilio-ruby/rest/numbers/v1/bulk_eligibility.rb +13 -2
  71. data/lib/twilio-ruby/rest/numbers/v1/eligibility.rb +125 -0
  72. data/lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb +0 -2
  73. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +132 -0
  74. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb +0 -2
  75. data/lib/twilio-ruby/rest/numbers/v1/porting_portability.rb +0 -2
  76. data/lib/twilio-ruby/rest/numbers/v1.rb +15 -3
  77. data/lib/twilio-ruby/rest/numbers/v2/authorization_document.rb +0 -2
  78. data/lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb +13 -2
  79. data/lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb +0 -2
  80. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +3 -15
  81. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb +0 -2
  82. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb +0 -2
  83. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb +0 -2
  84. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb +0 -2
  85. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +0 -2
  86. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +0 -2
  87. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +0 -2
  88. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +0 -2
  89. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +0 -2
  90. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +0 -2
  91. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +0 -2
  92. data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +0 -2
  93. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +0 -2
  94. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +0 -2
  95. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +0 -2
  96. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +0 -2
  97. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +0 -2
  98. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +0 -2
  99. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +0 -2
  100. data/lib/twilio-ruby/rest/preview/sync/service.rb +0 -2
  101. data/lib/twilio-ruby/rest/preview/wireless/command.rb +0 -2
  102. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +0 -2
  103. data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +0 -2
  104. data/lib/twilio-ruby/rest/preview/wireless/sim.rb +0 -2
  105. data/lib/twilio-ruby/rest/preview_messaging/v1/broadcast.rb +164 -0
  106. data/lib/twilio-ruby/rest/preview_messaging/v1/message.rb +235 -0
  107. data/lib/twilio-ruby/rest/preview_messaging/v1.rb +46 -0
  108. data/lib/twilio-ruby/rest/preview_messaging.rb +12 -0
  109. data/lib/twilio-ruby/rest/preview_messaging_base.rb +38 -0
  110. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +0 -2
  111. data/lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb +0 -2
  112. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +0 -2
  113. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +0 -2
  114. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +0 -2
  115. data/lib/twilio-ruby/rest/proxy/v1/service/short_code.rb +0 -2
  116. data/lib/twilio-ruby/rest/proxy/v1/service.rb +0 -2
  117. data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +0 -2
  118. data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +0 -2
  119. data/lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb +0 -2
  120. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +0 -2
  121. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +0 -2
  122. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +0 -2
  123. data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +0 -2
  124. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +0 -2
  125. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +0 -2
  126. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +0 -2
  127. data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +0 -2
  128. data/lib/twilio-ruby/rest/serverless/v1/service.rb +0 -2
  129. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +0 -2
  130. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +0 -2
  131. data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +0 -2
  132. data/lib/twilio-ruby/rest/supersim/v1/network.rb +0 -2
  133. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +0 -2
  134. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +0 -2
  135. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +0 -2
  136. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +0 -2
  137. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.rb +161 -0
  138. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +8 -8
  139. data/lib/twilio-ruby/rest/trusthub/v1/compliance_registration_inquiries.rb +2 -26
  140. data/lib/twilio-ruby/rest/verify/v2/form.rb +0 -2
  141. data/lib/twilio-ruby/rest/verify/v2/safelist.rb +0 -2
  142. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +0 -2
  143. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +0 -2
  144. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb +0 -2
  145. data/lib/twilio-ruby/twiml/messaging_response.rb +1 -1
  146. data/lib/twilio-ruby/version.rb +1 -1
  147. metadata +17 -12
  148. data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +0 -384
  149. data/lib/twilio-ruby/rest/flex_api/v1/plugin.rb +0 -446
  150. data/lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb +0 -247
  151. data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration/configured_plugin.rb +0 -393
  152. data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration.rb +0 -386
  153. data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration_archive.rb +0 -233
  154. data/lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb +0 -332
  155. data/lib/twilio-ruby/rest/flex_api/v1/plugin_version_archive.rb +0 -256
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ee4da7ce236e476901cca417a590ffbcc5dd90d
4
- data.tar.gz: 7e0d20132c3cb96f03f2c6e3d42a9074ebf357fc
3
+ metadata.gz: 4fc04f5b7e8b5662f2660255ab69debcd88c9f1e
4
+ data.tar.gz: 69d9201155d5a0d86e22533cb3bf60e27ea6c752
5
5
  SHA512:
6
- metadata.gz: 4a7a0c2959b45c56f2ee701ecca64a21a6ec596e2a8b36c1761b32ce58e0669fecd3f2c61d0f749b5bcd8bea34c52e3e898231e3dad8eec421cd8b1637807575
7
- data.tar.gz: 529e0dd106814e77a1b0b8588da5b7077dbe12a18ccfd69383e7caa7df23e75e41ba3bb7172c24c67bbd167a6aac101b19fc3f70785be0d31c09c231c3304627
6
+ metadata.gz: a8d2466da6a059765419f9856bec82da8827c94cf0528f49673ec67f99eedea66faf555f22e9ef9f2272bc95c7ab39027d68b23eea661916cf2a1a8badf91189
7
+ data.tar.gz: fd3ad8841cefd637f7b63e9a46043a02766c48a5d2e6ea91617449d5c497ff4bfdeab2c748c63d7d713c20d6f954228fe6a54bf093174f2bae61ac7450517934
@@ -45,15 +45,15 @@ jobs:
45
45
  - name: Run Unit Tests
46
46
  run: make test
47
47
 
48
- - name: Run Cluster Test
49
- if: (!github.event.pull_request.head.repo.fork)
50
- env:
51
- TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
52
- TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}}
53
- TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }}
54
- TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }}
55
- TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }}
56
- run: make cluster-test
48
+ # - name: Run Cluster Test
49
+ # if: (!github.event.pull_request.head.repo.fork)
50
+ # env:
51
+ # TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
52
+ # TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}}
53
+ # TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }}
54
+ # TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }}
55
+ # TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }}
56
+ # run: make cluster-test
57
57
 
58
58
  - name: Fix code coverage paths
59
59
  if: ${{ (github.event_name == 'pull_request' || github.ref_type == 'branch') && matrix.ruby == '3.0' && !github.event.pull_request.head.repo.fork }}
data/CHANGES.md CHANGED
@@ -1,64 +1,12 @@
1
1
  twilio-ruby changelog
2
- =====================
2
+ =====================
3
3
 
4
- [2024-03-12] Version 6.12.1
5
- ---------------------------
6
- **Api**
7
- - Correct precedence documentation for application_sid vs status_callback in message creation
8
- - Mark MaxPrice as deprecated
9
-
10
- **Flex**
11
- - Making `plugins` visibility to public
12
-
13
- **Messaging**
14
- - Add new `errors` attribute to the Brand Registration resource.
15
- - Mark `brand_feedback` attribute as deprecated.
16
- - Mark `failure_reason` attribute as deprecated.
17
- - The new `errors` attribute is expected to provide additional information about Brand registration failures and feedback (if any has been provided by The Campaign Registry). Consumers should use this attribute instead of `brand_feedback` and `failure_reason`.
18
-
19
- **Numbers**
20
- - Correcting mount_name for porting port in fetch API
21
-
22
- **Trusthub**
23
- - Add new field in statusCallbackUrl in compliance_registration.
24
- - Add new field in isvRegisteringForSelfOrTenant in compliance_registration.
25
-
26
- **Twiml**
27
- - Expanded description of Action parameter for Message verb
28
-
29
-
30
- [2024-02-27] Version 6.12.0
31
- ---------------------------
32
- **Library - Chore**
33
- - [PR #712](https://github.com/twilio/twilio-ruby/pull/712): cluster tests enabled. Thanks to [@sbansla](https://github.com/sbansla)!
34
-
35
- **Api**
36
- - remove feedback and feedback summary from call resource
37
-
38
- **Flex**
39
- - Adding `routing_properties` to Interactions Channels Participant
40
-
41
- **Lookups**
42
- - Add new `line_status` package to the lookup response
43
- - Remove `live_activity` package from the lookup response **(breaking change)**
44
-
45
- **Messaging**
46
- - Add tollfree multiple rejection reasons response array
47
-
48
- **Trusthub**
49
- - Add ENUM for businessRegistrationAuthority in compliance_registration. **(breaking change)**
50
- - Add new field in isIsvEmbed in compliance_registration.
51
- - Add additional optional fields in compliance_registration for Individual business type.
52
4
 
53
- **Twiml**
54
- - Add support for new Amazon Polly and Google voices (Q1 2024) for `Say` verb
55
-
56
-
57
- [2024-02-09] Version 6.11.0
58
- ---------------------------
5
+ [2024-02-09] Version 7.0.0-rc.1
6
+ -------------------------------
59
7
  **Library - Chore**
60
- - [PR #710](https://github.com/twilio/twilio-ruby/pull/710): remove live media endpoint. Thanks to [@califlower](https://github.com/califlower)!
61
- - [PR #708](https://github.com/twilio/twilio-ruby/pull/708): removing oauth and autopilot references. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
8
+ - [PR #711](https://github.com/twilio/twilio-ruby/pull/711): disable-cluster-test. Thanks to [@sbansla](https://github.com/sbansla)!
9
+ - [PR #709](https://github.com/twilio/twilio-ruby/pull/709): removed ssl ca file from http client. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
62
10
 
63
11
  **Api**
64
12
  - Updated service base url for connect apps and authorized connect apps APIs **(breaking change)**
@@ -118,6 +66,11 @@ twilio-ruby changelog
118
66
  - Update Verify TOTP maturity to GA.
119
67
 
120
68
 
69
+ [2024-01-26] Version 7.0.0-rc.0
70
+ --------------------------
71
+ - Release Candidate preparation
72
+
73
+
121
74
  [2024-01-25] Version 6.10.0
122
75
  ---------------------------
123
76
  **Oauth**
data/README.md CHANGED
@@ -39,13 +39,13 @@ This library supports the following Ruby implementations:
39
39
  To install using [Bundler][bundler] grab the latest stable version:
40
40
 
41
41
  ```ruby
42
- gem 'twilio-ruby', '~> 6.12.1'
42
+ gem 'twilio-ruby', '~> 7.0.0-rc.1'
43
43
  ```
44
44
 
45
45
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
46
46
 
47
47
  ```bash
48
- gem install twilio-ruby -v 6.12.1
48
+ gem install twilio-ruby -v 7.0.0-rc.1
49
49
  ```
50
50
 
51
51
  To build and install the development branch yourself from the latest source:
data/UPGRADE.md CHANGED
@@ -3,6 +3,16 @@
3
3
  _After `5.0.0` all `MINOR` and `MAJOR` version bumps will have upgrade notes
4
4
  posted here._
5
5
 
6
+ [2024-01-19] 6.x.x to 7.x.x
7
+ -----------------------------
8
+ ### Overview
9
+
10
+ ##### Twilio Ruby Helper Library’s major version 7.0.0-rc.x is now available. We ensured that you can upgrade to Ruby helper Library 7.0.0-rc.x version without any breaking changes
11
+
12
+ Twilio Helper libraries now support nested json body while sending requests.
13
+
14
+ To learn more about the Ruby Helper Library, check out [our docs](https://www.twilio.com/docs/libraries/ruby).
15
+
6
16
  [2023-05-03] 5.x.x to 6.x.x
7
17
  -----------------------------
8
18
  ### Overview
@@ -32,7 +32,14 @@ module Twilio
32
32
  data = ''
33
33
  unless @data.nil? || @data.empty?
34
34
  data = @method.equal?('GET') ? "\n -G" : "\n"
35
- data += @data.each.map { |key, value| "-d \"#{key}\"=\"#{value}\"" }.join("\n")
35
+ data += case @headers['Content-Type']
36
+ when 'application/x-www-form-urlencoded'
37
+ @data.each.map { |key, value| "-d \"#{key}\"=\"#{value}\"" }.join("\n")
38
+ when 'application/json'
39
+ "-d '#{JSON.generate(@data)}'"
40
+ else
41
+ @data.each.map { |key, value| "-d \"#{key}\"=\"#{value}\"" }.join("\n")
42
+ end
36
43
  end
37
44
 
38
45
  "#{auth} #{@method} #{@url}#{params}#{data}#{headers}"
@@ -9,11 +9,10 @@ module Twilio
9
9
  attr_reader :timeout, :last_response, :last_request, :connection
10
10
 
11
11
  def initialize(proxy_prot = nil, proxy_addr = nil, proxy_port = nil, proxy_user = nil, proxy_pass = nil,
12
- ssl_ca_file = nil, timeout: nil)
12
+ timeout: nil)
13
13
  @proxy_prot = proxy_prot
14
14
  @proxy_path = "#{proxy_addr}:#{proxy_port}" if proxy_addr && proxy_port
15
15
  @proxy_auth = "#{proxy_user}:#{proxy_pass}@" if proxy_pass && proxy_user
16
- @ssl_ca_file = ssl_ca_file
17
16
  @timeout = timeout
18
17
  @adapter = Faraday.default_adapter
19
18
  @configure_connection_blocks = []
@@ -27,9 +26,17 @@ module Twilio
27
26
  end
28
27
 
29
28
  def _request(request) # rubocop:disable Metrics/MethodLength
29
+ middle_ware = case request.headers['Content-Type']
30
+ when 'application/json'
31
+ :json
32
+ when 'application/x-www-form-urlencoded'
33
+ :url_encoded
34
+ else
35
+ :url_encoded
36
+ end
30
37
  @connection = Faraday.new(url: request.host + ':' + request.port.to_s, ssl: { verify: true }) do |f|
31
38
  f.options.params_encoder = Faraday::FlatParamsEncoder
32
- f.request :url_encoded
39
+ f.request(middle_ware)
33
40
  f.headers = request.headers
34
41
  if Faraday::VERSION.start_with?('2.')
35
42
  f.request(:authorization, :basic, request.auth[0], request.auth[1])
@@ -0,0 +1,267 @@
1
+ ##
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.
13
+ #
14
+
15
+
16
+ module Twilio
17
+ module REST
18
+ class Api < ApiBase
19
+ class V2010 < Version
20
+ class AccountContext < InstanceContext
21
+ class CallContext < InstanceContext
22
+
23
+ class FeedbackList < ListResource
24
+
25
+ ##
26
+ # Initialize the FeedbackList
27
+ # @param [Version] version Version that contains the resource
28
+ # @return [FeedbackList] FeedbackList
29
+ def initialize(version, account_sid: nil, call_sid: nil)
30
+ super(version)
31
+ # Path Solution
32
+ @solution = { account_sid: account_sid, call_sid: call_sid }
33
+
34
+
35
+ end
36
+
37
+
38
+
39
+ # Provide a user friendly representation
40
+ def to_s
41
+ '#<Twilio.Api.V2010.FeedbackList>'
42
+ end
43
+ end
44
+
45
+
46
+ class FeedbackContext < InstanceContext
47
+ ##
48
+ # Initialize the FeedbackContext
49
+ # @param [Version] version Version that contains the resource
50
+ # @param [String] account_sid The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource.
51
+ # @param [String] call_sid The call sid that uniquely identifies the call
52
+ # @return [FeedbackContext] FeedbackContext
53
+ def initialize(version, account_sid, call_sid)
54
+ super(version)
55
+
56
+ # Path Solution
57
+ @solution = { account_sid: account_sid, call_sid: call_sid, }
58
+ @uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:call_sid]}/Feedback.json"
59
+
60
+
61
+ end
62
+ ##
63
+ # Fetch the FeedbackInstance
64
+ # @return [FeedbackInstance] Fetched FeedbackInstance
65
+ def fetch
66
+
67
+
68
+ payload = @version.fetch('GET', @uri)
69
+ FeedbackInstance.new(
70
+ @version,
71
+ payload,
72
+ account_sid: @solution[:account_sid],
73
+ call_sid: @solution[:call_sid],
74
+ )
75
+ end
76
+
77
+ ##
78
+ # Update the FeedbackInstance
79
+ # @param [String] quality_score The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call.
80
+ # @param [Array[Issues]] issue One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`.
81
+ # @return [FeedbackInstance] Updated FeedbackInstance
82
+ def update(
83
+ quality_score: :unset,
84
+ issue: :unset
85
+ )
86
+
87
+ data = Twilio::Values.of({
88
+ 'QualityScore' => quality_score,
89
+ 'Issue' => Twilio.serialize_list(issue) { |e| e },
90
+ })
91
+
92
+
93
+ payload = @version.update('POST', @uri, data: data)
94
+ FeedbackInstance.new(
95
+ @version,
96
+ payload,
97
+ account_sid: @solution[:account_sid],
98
+ call_sid: @solution[:call_sid],
99
+ )
100
+ end
101
+
102
+
103
+ ##
104
+ # Provide a user friendly representation
105
+ def to_s
106
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
107
+ "#<Twilio.Api.V2010.FeedbackContext #{context}>"
108
+ end
109
+
110
+ ##
111
+ # Provide a detailed, user friendly representation
112
+ def inspect
113
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
114
+ "#<Twilio.Api.V2010.FeedbackContext #{context}>"
115
+ end
116
+ end
117
+
118
+ class FeedbackPage < Page
119
+ ##
120
+ # Initialize the FeedbackPage
121
+ # @param [Version] version Version that contains the resource
122
+ # @param [Response] response Response from the API
123
+ # @param [Hash] solution Path solution for the resource
124
+ # @return [FeedbackPage] FeedbackPage
125
+ def initialize(version, response, solution)
126
+ super(version, response)
127
+
128
+ # Path Solution
129
+ @solution = solution
130
+ end
131
+
132
+ ##
133
+ # Build an instance of FeedbackInstance
134
+ # @param [Hash] payload Payload response from the API
135
+ # @return [FeedbackInstance] FeedbackInstance
136
+ def get_instance(payload)
137
+ FeedbackInstance.new(@version, payload, account_sid: @solution[:account_sid], call_sid: @solution[:call_sid])
138
+ end
139
+
140
+ ##
141
+ # Provide a user friendly representation
142
+ def to_s
143
+ '<Twilio.Api.V2010.FeedbackPage>'
144
+ end
145
+ end
146
+ class FeedbackInstance < InstanceResource
147
+ ##
148
+ # Initialize the FeedbackInstance
149
+ # @param [Version] version Version that contains the resource
150
+ # @param [Hash] payload payload that contains response from Twilio
151
+ # @param [String] account_sid The SID of the
152
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Feedback
153
+ # resource.
154
+ # @param [String] sid The SID of the Call resource to fetch.
155
+ # @return [FeedbackInstance] FeedbackInstance
156
+ def initialize(version, payload , account_sid: nil, call_sid: nil)
157
+ super(version)
158
+
159
+ # Marshaled Properties
160
+ @properties = {
161
+ 'account_sid' => payload['account_sid'],
162
+ 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
163
+ 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
164
+ 'issues' => payload['issues'],
165
+ 'quality_score' => payload['quality_score'] == nil ? payload['quality_score'] : payload['quality_score'].to_i,
166
+ 'sid' => payload['sid'],
167
+ }
168
+
169
+ # Context
170
+ @instance_context = nil
171
+ @params = { 'account_sid' => account_sid ,'call_sid' => call_sid || @properties['call_sid'] , }
172
+ end
173
+
174
+ ##
175
+ # Generate an instance context for the instance, the context is capable of
176
+ # performing various actions. All instance actions are proxied to the context
177
+ # @return [FeedbackContext] CallContext for this CallInstance
178
+ def context
179
+ unless @instance_context
180
+ @instance_context = FeedbackContext.new(@version , @params['account_sid'], @params['call_sid'])
181
+ end
182
+ @instance_context
183
+ end
184
+
185
+ ##
186
+ # @return [String] The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource.
187
+ def account_sid
188
+ @properties['account_sid']
189
+ end
190
+
191
+ ##
192
+ # @return [Time] The date that this resource was created, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.
193
+ def date_created
194
+ @properties['date_created']
195
+ end
196
+
197
+ ##
198
+ # @return [Time] The date that this resource was last updated, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.
199
+ def date_updated
200
+ @properties['date_updated']
201
+ end
202
+
203
+ ##
204
+ # @return [Array<Issues>] A list of issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`.
205
+ def issues
206
+ @properties['issues']
207
+ end
208
+
209
+ ##
210
+ # @return [String] `1` to `5` quality score where `1` represents imperfect experience and `5` represents a perfect call.
211
+ def quality_score
212
+ @properties['quality_score']
213
+ end
214
+
215
+ ##
216
+ # @return [String] A 34 character string that uniquely identifies this resource.
217
+ def sid
218
+ @properties['sid']
219
+ end
220
+
221
+ ##
222
+ # Fetch the FeedbackInstance
223
+ # @return [FeedbackInstance] Fetched FeedbackInstance
224
+ def fetch
225
+
226
+ context.fetch
227
+ end
228
+
229
+ ##
230
+ # Update the FeedbackInstance
231
+ # @param [String] quality_score The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call.
232
+ # @param [Array[Issues]] issue One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`.
233
+ # @return [FeedbackInstance] Updated FeedbackInstance
234
+ def update(
235
+ quality_score: :unset,
236
+ issue: :unset
237
+ )
238
+
239
+ context.update(
240
+ quality_score: quality_score,
241
+ issue: issue,
242
+ )
243
+ end
244
+
245
+ ##
246
+ # Provide a user friendly representation
247
+ def to_s
248
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
249
+ "<Twilio.Api.V2010.FeedbackInstance #{values}>"
250
+ end
251
+
252
+ ##
253
+ # Provide a detailed, user friendly representation
254
+ def inspect
255
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
256
+ "<Twilio.Api.V2010.FeedbackInstance #{values}>"
257
+ end
258
+ end
259
+
260
+ end
261
+ end
262
+ end
263
+ end
264
+ end
265
+ end
266
+
267
+