twilio-ruby 5.72.0 → 5.77.0

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 (199) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/pr-lint.yml +8 -2
  3. data/.github/workflows/test-and-deploy.yml +3 -3
  4. data/CHANGES.md +234 -0
  5. data/CONTRIBUTING.md +1 -7
  6. data/LICENSE +1 -1
  7. data/README.md +132 -45
  8. data/advanced-examples/custom-http-client.md +170 -0
  9. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +19 -3
  10. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +22 -3
  11. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +2 -2
  12. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +2 -2
  13. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +2 -2
  14. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +2 -2
  15. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +2 -2
  16. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +2 -2
  17. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +2 -2
  18. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +1 -1
  19. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
  20. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +2 -2
  21. data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb +160 -0
  22. data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message_subscription.rb +251 -0
  23. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +59 -0
  24. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +56 -17
  25. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
  26. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +5 -5
  27. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +17 -1
  28. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +2 -2
  29. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +6 -6
  30. data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +1 -1
  31. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +1 -1
  32. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +1 -1
  33. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +1 -1
  34. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +1 -1
  35. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +1 -1
  36. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +1 -1
  37. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +1 -1
  38. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +1 -1
  39. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +1 -1
  40. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +1 -1
  41. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +1 -1
  42. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +1 -1
  43. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +2 -2
  44. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +1 -1
  45. data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +1 -1
  46. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +2 -2
  47. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +1 -1
  48. data/lib/twilio-ruby/rest/chat/v1/service.rb +2 -2
  49. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +1 -1
  50. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +2 -2
  51. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +1 -1
  52. data/lib/twilio-ruby/rest/chat/v2/service.rb +4 -4
  53. data/lib/twilio-ruby/rest/chat/v3/channel.rb +2 -2
  54. data/lib/twilio-ruby/rest/client.rb +14 -0
  55. data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +195 -0
  56. data/lib/twilio-ruby/rest/content/v1/content.rb +346 -0
  57. data/lib/twilio-ruby/rest/content/v1/content_and_approvals.rb +240 -0
  58. data/lib/twilio-ruby/rest/content/v1/legacy_content.rb +254 -0
  59. data/lib/twilio-ruby/rest/content/v1.rb +59 -0
  60. data/lib/twilio-ruby/rest/content.rb +59 -0
  61. data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +1 -1
  62. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +17 -2
  63. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +43 -5
  64. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +1 -1
  65. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +17 -2
  66. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +43 -5
  67. data/lib/twilio-ruby/rest/events/v1/schema/version.rb +1 -1
  68. data/lib/twilio-ruby/rest/events/v1/schema.rb +1 -1
  69. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +1 -1
  70. data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +397 -0
  71. data/lib/twilio-ruby/rest/flex_api/v1/insights_assessments_comment.rb +314 -0
  72. data/lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb +216 -0
  73. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb +394 -0
  74. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb +313 -0
  75. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +390 -0
  76. data/lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb +413 -0
  77. data/lib/twilio-ruby/rest/{preview/trusted_comms/brands_information.rb → flex_api/v1/insights_session.rb} +58 -55
  78. data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_answersets.rb +144 -0
  79. data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_comment.rb +130 -0
  80. data/lib/twilio-ruby/rest/{preview/trusted_comms/cps.rb → flex_api/v1/insights_user_roles.rb} +42 -54
  81. data/lib/twilio-ruby/rest/flex_api/v1.rb +122 -0
  82. data/lib/twilio-ruby/rest/flex_api/v2/web_channels.rb +133 -0
  83. data/lib/twilio-ruby/rest/flex_api/v2.rb +35 -0
  84. data/lib/twilio-ruby/rest/flex_api.rb +89 -0
  85. data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +7 -0
  86. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +16 -3
  87. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +1 -1
  88. data/lib/twilio-ruby/rest/insights/v1/room.rb +3 -3
  89. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +1 -1
  90. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +2 -2
  91. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +1 -1
  92. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +2 -2
  93. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +1 -1
  94. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +2 -2
  95. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +1 -1
  96. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +4 -4
  97. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +88 -6
  98. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +1 -1
  99. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +2 -2
  100. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +1 -1
  101. data/lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_registration_otp.rb +134 -0
  102. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +26 -3
  103. data/lib/twilio-ruby/rest/messaging/v1/domain_cert.rb +257 -0
  104. data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +242 -0
  105. data/lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb +226 -0
  106. data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb +218 -0
  107. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +98 -3
  108. data/lib/twilio-ruby/rest/messaging/v1/service.rb +1 -1
  109. data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +165 -1
  110. data/lib/twilio-ruby/rest/messaging/v1.rb +75 -0
  111. data/lib/twilio-ruby/rest/messaging.rb +36 -0
  112. data/lib/twilio-ruby/rest/microvisor/v1/account_config.rb +317 -0
  113. data/lib/twilio-ruby/rest/microvisor/v1/account_secret.rb +310 -0
  114. data/lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb +192 -0
  115. data/lib/twilio-ruby/rest/microvisor/v1/app.rb +25 -0
  116. data/lib/twilio-ruby/rest/microvisor/v1/device/device_config.rb +342 -0
  117. data/lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb +335 -0
  118. data/lib/twilio-ruby/rest/microvisor/v1/device.rb +61 -0
  119. data/lib/twilio-ruby/rest/microvisor/v1.rb +32 -0
  120. data/lib/twilio-ruby/rest/microvisor.rb +16 -0
  121. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +1 -1
  122. data/lib/twilio-ruby/rest/numbers/v1/eligibility.rb +111 -0
  123. data/lib/twilio-ruby/rest/numbers/v1.rb +35 -0
  124. data/lib/twilio-ruby/rest/numbers.rb +13 -0
  125. data/lib/twilio-ruby/rest/oauth/v1/device_code.rb +153 -0
  126. data/lib/twilio-ruby/rest/oauth/v1/oauth.rb +162 -0
  127. data/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb +242 -0
  128. data/lib/twilio-ruby/rest/oauth/v1/token.rb +157 -0
  129. data/lib/twilio-ruby/rest/oauth/v1/user_info.rb +193 -0
  130. data/lib/twilio-ruby/rest/oauth/v1.rb +63 -0
  131. data/lib/twilio-ruby/rest/oauth.rb +68 -0
  132. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +2 -2
  133. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +2 -2
  134. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +1 -1
  135. data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +2 -2
  136. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +1 -1
  137. data/lib/twilio-ruby/rest/preview.rb +0 -33
  138. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +1 -1
  139. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +1 -14
  140. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +5 -46
  141. data/lib/twilio-ruby/rest/proxy/v1/service.rb +1 -1
  142. data/lib/twilio-ruby/rest/studio/v1/flow.rb +1 -1
  143. data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +1 -1
  144. data/lib/twilio-ruby/rest/studio/v2/flow.rb +1 -1
  145. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +21 -1
  146. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +1 -1
  147. data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +5 -2
  148. data/lib/twilio-ruby/rest/supersim/v1/settings_update.rb +247 -0
  149. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +3 -3
  150. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +4 -4
  151. data/lib/twilio-ruby/rest/supersim/v1.rb +7 -0
  152. data/lib/twilio-ruby/rest/supersim.rb +6 -0
  153. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +1 -1
  154. data/lib/twilio-ruby/rest/sync/v1/service.rb +1 -1
  155. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +1 -1
  156. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +18 -5
  157. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +3 -3
  158. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +12 -12
  159. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +5 -5
  160. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +10 -4
  161. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +3 -3
  162. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +6 -6
  163. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +1 -1
  164. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +9 -3
  165. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +13 -13
  166. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +2 -2
  167. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +1 -1
  168. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +13 -13
  169. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +3 -3
  170. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +2 -2
  171. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +1 -9
  172. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +1 -7
  173. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +0 -8
  174. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +0 -8
  175. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +0 -6
  176. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +0 -8
  177. data/lib/twilio-ruby/rest/verify/v2/service/rate_limit/bucket.rb +2 -2
  178. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +12 -6
  179. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +0 -8
  180. data/lib/twilio-ruby/rest/verify/v2/service.rb +4 -4
  181. data/lib/twilio-ruby/rest/verify/v2/template.rb +10 -3
  182. data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +4 -4
  183. data/lib/twilio-ruby/rest/video/v1/composition.rb +3 -3
  184. data/lib/twilio-ruby/rest/video/v1/recording.rb +2 -2
  185. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +2 -2
  186. data/lib/twilio-ruby/rest/video/v1/room.rb +4 -4
  187. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +2 -2
  188. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/bulk_country_update.rb +1 -1
  189. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +1 -1
  190. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
  191. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +2 -2
  192. data/lib/twilio-ruby/twiml/voice_response.rb +132 -33
  193. data/lib/twilio-ruby/version.rb +1 -1
  194. data/twilio-ruby.gemspec +1 -1
  195. metadata +48 -12
  196. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb +0 -165
  197. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb +0 -225
  198. data/lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb +0 -277
  199. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +0 -65
@@ -0,0 +1,314 @@
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 FlexApi < Domain
12
+ class V1 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
15
+ class InsightsAssessmentsCommentList < ListResource
16
+ ##
17
+ # Initialize the InsightsAssessmentsCommentList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [InsightsAssessmentsCommentList] InsightsAssessmentsCommentList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ @uri = "/Insights/QM/Assessments/Comments"
26
+ end
27
+
28
+ ##
29
+ # Create the InsightsAssessmentsCommentInstance
30
+ # @param [String] category_id The ID of the category
31
+ # @param [String] category_name The name of the category
32
+ # @param [String] comment The Assessment comment.
33
+ # @param [String] segment_id The id of the segment.
34
+ # @param [String] user_name The name of the user.
35
+ # @param [String] user_email The email id of the user.
36
+ # @param [String] agent_id The id of the agent.
37
+ # @param [String] offset The offset
38
+ # @param [String] token The Token HTTP request header
39
+ # @return [InsightsAssessmentsCommentInstance] Created InsightsAssessmentsCommentInstance
40
+ def create(category_id: nil, category_name: nil, comment: nil, segment_id: nil, user_name: nil, user_email: nil, agent_id: nil, offset: nil, token: :unset)
41
+ data = Twilio::Values.of({
42
+ 'CategoryId' => category_id,
43
+ 'CategoryName' => category_name,
44
+ 'Comment' => comment,
45
+ 'SegmentId' => segment_id,
46
+ 'UserName' => user_name,
47
+ 'UserEmail' => user_email,
48
+ 'AgentId' => agent_id,
49
+ 'Offset' => offset,
50
+ })
51
+ headers = Twilio::Values.of({'Token' => token, })
52
+
53
+ payload = @version.create('POST', @uri, data: data, headers: headers)
54
+
55
+ InsightsAssessmentsCommentInstance.new(@version, payload, )
56
+ end
57
+
58
+ ##
59
+ # Lists InsightsAssessmentsCommentInstance records from the API as a list.
60
+ # Unlike stream(), this operation is eager and will load `limit` records into
61
+ # memory before returning.
62
+ # @param [String] segment_id The id of the segment.
63
+ # @param [String] agent_id The id of the agent.
64
+ # @param [String] token The Token HTTP request header
65
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
66
+ # guarantees to never return more than limit. Default is no limit
67
+ # @param [Integer] page_size Number of records to fetch per request, when
68
+ # not set will use the default value of 50 records. If no page_size is defined
69
+ # but a limit is defined, stream() will attempt to read the limit with the most
70
+ # efficient page size, i.e. min(limit, 1000)
71
+ # @return [Array] Array of up to limit results
72
+ def list(segment_id: :unset, agent_id: :unset, token: :unset, limit: nil, page_size: nil)
73
+ self.stream(
74
+ segment_id: segment_id,
75
+ agent_id: agent_id,
76
+ token: token,
77
+ limit: limit,
78
+ page_size: page_size
79
+ ).entries
80
+ end
81
+
82
+ ##
83
+ # Streams InsightsAssessmentsCommentInstance records from the API as an Enumerable.
84
+ # This operation lazily loads records as efficiently as possible until the limit
85
+ # is reached.
86
+ # @param [String] segment_id The id of the segment.
87
+ # @param [String] agent_id The id of the agent.
88
+ # @param [String] token The Token HTTP request header
89
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
90
+ # guarantees to never return more than limit. Default is no limit.
91
+ # @param [Integer] page_size Number of records to fetch per request, when
92
+ # not set will use the default value of 50 records. If no page_size is defined
93
+ # but a limit is defined, stream() will attempt to read the limit with the most
94
+ # efficient page size, i.e. min(limit, 1000)
95
+ # @return [Enumerable] Enumerable that will yield up to limit results
96
+ def stream(segment_id: :unset, agent_id: :unset, token: :unset, limit: nil, page_size: nil)
97
+ limits = @version.read_limits(limit, page_size)
98
+
99
+ page = self.page(
100
+ segment_id: segment_id,
101
+ agent_id: agent_id,
102
+ token: token,
103
+ page_size: limits[:page_size],
104
+ )
105
+
106
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
107
+ end
108
+
109
+ ##
110
+ # When passed a block, yields InsightsAssessmentsCommentInstance records from the API.
111
+ # This operation lazily loads records as efficiently as possible until the limit
112
+ # is reached.
113
+ def each
114
+ limits = @version.read_limits
115
+
116
+ page = self.page(page_size: limits[:page_size], )
117
+
118
+ @version.stream(page,
119
+ limit: limits[:limit],
120
+ page_limit: limits[:page_limit]).each {|x| yield x}
121
+ end
122
+
123
+ ##
124
+ # Retrieve a single page of InsightsAssessmentsCommentInstance records from the API.
125
+ # Request is executed immediately.
126
+ # @param [String] segment_id The id of the segment.
127
+ # @param [String] agent_id The id of the agent.
128
+ # @param [String] token The Token HTTP request header
129
+ # @param [String] page_token PageToken provided by the API
130
+ # @param [Integer] page_number Page Number, this value is simply for client state
131
+ # @param [Integer] page_size Number of records to return, defaults to 50
132
+ # @return [Page] Page of InsightsAssessmentsCommentInstance
133
+ def page(segment_id: :unset, agent_id: :unset, token: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
134
+ params = Twilio::Values.of({
135
+ 'SegmentId' => segment_id,
136
+ 'AgentId' => agent_id,
137
+ 'PageToken' => page_token,
138
+ 'Page' => page_number,
139
+ 'PageSize' => page_size,
140
+ })
141
+ headers = Twilio::Values.of({'Token' => token, })
142
+
143
+ response = @version.page('GET', @uri, params: params, headers: headers)
144
+
145
+ InsightsAssessmentsCommentPage.new(@version, response, @solution)
146
+ end
147
+
148
+ ##
149
+ # Retrieve a single page of InsightsAssessmentsCommentInstance records from the API.
150
+ # Request is executed immediately.
151
+ # @param [String] target_url API-generated URL for the requested results page
152
+ # @return [Page] Page of InsightsAssessmentsCommentInstance
153
+ def get_page(target_url)
154
+ response = @version.domain.request(
155
+ 'GET',
156
+ target_url
157
+ )
158
+ InsightsAssessmentsCommentPage.new(@version, response, @solution)
159
+ end
160
+
161
+ ##
162
+ # Provide a user friendly representation
163
+ def to_s
164
+ '#<Twilio.FlexApi.V1.InsightsAssessmentsCommentList>'
165
+ end
166
+ end
167
+
168
+ ##
169
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
170
+ class InsightsAssessmentsCommentPage < Page
171
+ ##
172
+ # Initialize the InsightsAssessmentsCommentPage
173
+ # @param [Version] version Version that contains the resource
174
+ # @param [Response] response Response from the API
175
+ # @param [Hash] solution Path solution for the resource
176
+ # @return [InsightsAssessmentsCommentPage] InsightsAssessmentsCommentPage
177
+ def initialize(version, response, solution)
178
+ super(version, response)
179
+
180
+ # Path Solution
181
+ @solution = solution
182
+ end
183
+
184
+ ##
185
+ # Build an instance of InsightsAssessmentsCommentInstance
186
+ # @param [Hash] payload Payload response from the API
187
+ # @return [InsightsAssessmentsCommentInstance] InsightsAssessmentsCommentInstance
188
+ def get_instance(payload)
189
+ InsightsAssessmentsCommentInstance.new(@version, payload, )
190
+ end
191
+
192
+ ##
193
+ # Provide a user friendly representation
194
+ def to_s
195
+ '<Twilio.FlexApi.V1.InsightsAssessmentsCommentPage>'
196
+ end
197
+ end
198
+
199
+ ##
200
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
201
+ class InsightsAssessmentsCommentInstance < InstanceResource
202
+ ##
203
+ # Initialize the InsightsAssessmentsCommentInstance
204
+ # @param [Version] version Version that contains the resource
205
+ # @param [Hash] payload payload that contains response from Twilio
206
+ # @return [InsightsAssessmentsCommentInstance] InsightsAssessmentsCommentInstance
207
+ def initialize(version, payload)
208
+ super(version)
209
+
210
+ # Marshaled Properties
211
+ @properties = {
212
+ 'account_sid' => payload['account_sid'],
213
+ 'assessment_id' => payload['assessment_id'],
214
+ 'comment' => payload['comment'],
215
+ 'offset' => payload['offset'] == nil ? payload['offset'] : payload['offset'].to_f,
216
+ 'report' => payload['report'],
217
+ 'weight' => payload['weight'] == nil ? payload['weight'] : payload['weight'].to_f,
218
+ 'agent_id' => payload['agent_id'],
219
+ 'segment_id' => payload['segment_id'],
220
+ 'user_name' => payload['user_name'],
221
+ 'user_email' => payload['user_email'],
222
+ 'timestamp' => payload['timestamp'] == nil ? payload['timestamp'] : payload['timestamp'].to_f,
223
+ 'url' => payload['url'],
224
+ }
225
+ end
226
+
227
+ ##
228
+ # @return [String] The SID of the Account that created the resource and owns this Flex Insights
229
+ def account_sid
230
+ @properties['account_sid']
231
+ end
232
+
233
+ ##
234
+ # @return [String] The Unique Assessment Id.
235
+ def assessment_id
236
+ @properties['assessment_id']
237
+ end
238
+
239
+ ##
240
+ # @return [Hash] The assessment comment
241
+ def comment
242
+ @properties['comment']
243
+ end
244
+
245
+ ##
246
+ # @return [String] Offset.
247
+ def offset
248
+ @properties['offset']
249
+ end
250
+
251
+ ##
252
+ # @return [Boolean] Part of assessment report
253
+ def report
254
+ @properties['report']
255
+ end
256
+
257
+ ##
258
+ # @return [String] The weightage
259
+ def weight
260
+ @properties['weight']
261
+ end
262
+
263
+ ##
264
+ # @return [String] Agent Id.
265
+ def agent_id
266
+ @properties['agent_id']
267
+ end
268
+
269
+ ##
270
+ # @return [String] Segment Id.
271
+ def segment_id
272
+ @properties['segment_id']
273
+ end
274
+
275
+ ##
276
+ # @return [String] The user name.
277
+ def user_name
278
+ @properties['user_name']
279
+ end
280
+
281
+ ##
282
+ # @return [String] The user email id.
283
+ def user_email
284
+ @properties['user_email']
285
+ end
286
+
287
+ ##
288
+ # @return [String] The timestamp.
289
+ def timestamp
290
+ @properties['timestamp']
291
+ end
292
+
293
+ ##
294
+ # @return [String] The url
295
+ def url
296
+ @properties['url']
297
+ end
298
+
299
+ ##
300
+ # Provide a user friendly representation
301
+ def to_s
302
+ "<Twilio.FlexApi.V1.InsightsAssessmentsCommentInstance>"
303
+ end
304
+
305
+ ##
306
+ # Provide a detailed, user friendly representation
307
+ def inspect
308
+ "<Twilio.FlexApi.V1.InsightsAssessmentsCommentInstance>"
309
+ end
310
+ end
311
+ end
312
+ end
313
+ end
314
+ end
@@ -0,0 +1,216 @@
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 FlexApi < Domain
12
+ class V1 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
15
+ class InsightsConversationsList < ListResource
16
+ ##
17
+ # Initialize the InsightsConversationsList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [InsightsConversationsList] InsightsConversationsList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ @uri = "/Insights/Conversations"
26
+ end
27
+
28
+ ##
29
+ # Lists InsightsConversationsInstance records from the API as a list.
30
+ # Unlike stream(), this operation is eager and will load `limit` records into
31
+ # memory before returning.
32
+ # @param [String] segment_id Unique Id of the segment for which conversation
33
+ # details needs to be fetched
34
+ # @param [String] token The Token HTTP request header
35
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
36
+ # guarantees to never return more than limit. Default is no limit
37
+ # @param [Integer] page_size Number of records to fetch per request, when
38
+ # not set will use the default value of 50 records. If no page_size is defined
39
+ # but a limit is defined, stream() will attempt to read the limit with the most
40
+ # efficient page size, i.e. min(limit, 1000)
41
+ # @return [Array] Array of up to limit results
42
+ def list(segment_id: :unset, token: :unset, limit: nil, page_size: nil)
43
+ self.stream(segment_id: segment_id, token: token, limit: limit, page_size: page_size).entries
44
+ end
45
+
46
+ ##
47
+ # Streams InsightsConversationsInstance records from the API as an Enumerable.
48
+ # This operation lazily loads records as efficiently as possible until the limit
49
+ # is reached.
50
+ # @param [String] segment_id Unique Id of the segment for which conversation
51
+ # details needs to be fetched
52
+ # @param [String] token The Token HTTP request header
53
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
54
+ # guarantees to never return more than limit. Default is no limit.
55
+ # @param [Integer] page_size Number of records to fetch per request, when
56
+ # not set will use the default value of 50 records. If no page_size is defined
57
+ # but a limit is defined, stream() will attempt to read the limit with the most
58
+ # efficient page size, i.e. min(limit, 1000)
59
+ # @return [Enumerable] Enumerable that will yield up to limit results
60
+ def stream(segment_id: :unset, token: :unset, limit: nil, page_size: nil)
61
+ limits = @version.read_limits(limit, page_size)
62
+
63
+ page = self.page(segment_id: segment_id, token: token, page_size: limits[:page_size], )
64
+
65
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
66
+ end
67
+
68
+ ##
69
+ # When passed a block, yields InsightsConversationsInstance records from the API.
70
+ # This operation lazily loads records as efficiently as possible until the limit
71
+ # is reached.
72
+ def each
73
+ limits = @version.read_limits
74
+
75
+ page = self.page(page_size: limits[:page_size], )
76
+
77
+ @version.stream(page,
78
+ limit: limits[:limit],
79
+ page_limit: limits[:page_limit]).each {|x| yield x}
80
+ end
81
+
82
+ ##
83
+ # Retrieve a single page of InsightsConversationsInstance records from the API.
84
+ # Request is executed immediately.
85
+ # @param [String] segment_id Unique Id of the segment for which conversation
86
+ # details needs to be fetched
87
+ # @param [String] token The Token HTTP request header
88
+ # @param [String] page_token PageToken provided by the API
89
+ # @param [Integer] page_number Page Number, this value is simply for client state
90
+ # @param [Integer] page_size Number of records to return, defaults to 50
91
+ # @return [Page] Page of InsightsConversationsInstance
92
+ def page(segment_id: :unset, token: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
93
+ params = Twilio::Values.of({
94
+ 'SegmentId' => segment_id,
95
+ 'PageToken' => page_token,
96
+ 'Page' => page_number,
97
+ 'PageSize' => page_size,
98
+ })
99
+ headers = Twilio::Values.of({'Token' => token, })
100
+
101
+ response = @version.page('GET', @uri, params: params, headers: headers)
102
+
103
+ InsightsConversationsPage.new(@version, response, @solution)
104
+ end
105
+
106
+ ##
107
+ # Retrieve a single page of InsightsConversationsInstance records from the API.
108
+ # Request is executed immediately.
109
+ # @param [String] target_url API-generated URL for the requested results page
110
+ # @return [Page] Page of InsightsConversationsInstance
111
+ def get_page(target_url)
112
+ response = @version.domain.request(
113
+ 'GET',
114
+ target_url
115
+ )
116
+ InsightsConversationsPage.new(@version, response, @solution)
117
+ end
118
+
119
+ ##
120
+ # Provide a user friendly representation
121
+ def to_s
122
+ '#<Twilio.FlexApi.V1.InsightsConversationsList>'
123
+ end
124
+ end
125
+
126
+ ##
127
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
128
+ class InsightsConversationsPage < Page
129
+ ##
130
+ # Initialize the InsightsConversationsPage
131
+ # @param [Version] version Version that contains the resource
132
+ # @param [Response] response Response from the API
133
+ # @param [Hash] solution Path solution for the resource
134
+ # @return [InsightsConversationsPage] InsightsConversationsPage
135
+ def initialize(version, response, solution)
136
+ super(version, response)
137
+
138
+ # Path Solution
139
+ @solution = solution
140
+ end
141
+
142
+ ##
143
+ # Build an instance of InsightsConversationsInstance
144
+ # @param [Hash] payload Payload response from the API
145
+ # @return [InsightsConversationsInstance] InsightsConversationsInstance
146
+ def get_instance(payload)
147
+ InsightsConversationsInstance.new(@version, payload, )
148
+ end
149
+
150
+ ##
151
+ # Provide a user friendly representation
152
+ def to_s
153
+ '<Twilio.FlexApi.V1.InsightsConversationsPage>'
154
+ end
155
+ end
156
+
157
+ ##
158
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
159
+ class InsightsConversationsInstance < InstanceResource
160
+ ##
161
+ # Initialize the InsightsConversationsInstance
162
+ # @param [Version] version Version that contains the resource
163
+ # @param [Hash] payload payload that contains response from Twilio
164
+ # @return [InsightsConversationsInstance] InsightsConversationsInstance
165
+ def initialize(version, payload)
166
+ super(version)
167
+
168
+ # Marshaled Properties
169
+ @properties = {
170
+ 'account_id' => payload['account_id'],
171
+ 'conversation_id' => payload['conversation_id'],
172
+ 'segment_count' => payload['segment_count'] == nil ? payload['segment_count'] : payload['segment_count'].to_i,
173
+ 'segments' => payload['segments'],
174
+ }
175
+ end
176
+
177
+ ##
178
+ # @return [String] The account id
179
+ def account_id
180
+ @properties['account_id']
181
+ end
182
+
183
+ ##
184
+ # @return [String] Unique conversation Id
185
+ def conversation_id
186
+ @properties['conversation_id']
187
+ end
188
+
189
+ ##
190
+ # @return [String] The segment count
191
+ def segment_count
192
+ @properties['segment_count']
193
+ end
194
+
195
+ ##
196
+ # @return [Array[Hash]] The conversation segments
197
+ def segments
198
+ @properties['segments']
199
+ end
200
+
201
+ ##
202
+ # Provide a user friendly representation
203
+ def to_s
204
+ "<Twilio.FlexApi.V1.InsightsConversationsInstance>"
205
+ end
206
+
207
+ ##
208
+ # Provide a detailed, user friendly representation
209
+ def inspect
210
+ "<Twilio.FlexApi.V1.InsightsConversationsInstance>"
211
+ end
212
+ end
213
+ end
214
+ end
215
+ end
216
+ end