twilio-ruby 7.10.7 → 7.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test-and-deploy.yml +43 -67
  3. data/.gitignore +0 -1
  4. data/CHANGES.md +46 -0
  5. data/Gemfile +2 -0
  6. data/Gemfile.lock +154 -0
  7. data/README.md +3 -3
  8. data/Rakefile +1 -1
  9. data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +25 -6
  10. data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +48 -12
  11. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +6 -0
  12. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +56 -2
  13. data/lib/twilio-ruby/rest/client.rb +0 -5
  14. data/lib/twilio-ruby/rest/content/v1/content/approval_create.rb +11 -1
  15. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +10 -10
  16. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +10 -10
  17. data/lib/twilio-ruby/rest/conversations/v2/action.rb +2 -2
  18. data/lib/twilio-ruby/rest/conversations/v2/communication.rb +43 -21
  19. data/lib/twilio-ruby/rest/conversations/v2/configuration.rb +59 -21
  20. data/lib/twilio-ruby/rest/conversations/v2/conversation.rb +28 -28
  21. data/lib/twilio-ruby/rest/conversations/v2/operation.rb +10 -10
  22. data/lib/twilio-ruby/rest/conversations/v2/participant.rb +58 -58
  23. data/lib/twilio-ruby/rest/conversations/v2.rb +45 -45
  24. data/lib/twilio-ruby/rest/iam/v1/new_api_key.rb +2 -2
  25. data/lib/twilio-ruby/rest/iam/v1/o_auth_app.rb +15 -2
  26. data/lib/twilio-ruby/rest/iam_base.rb +6 -1
  27. data/lib/twilio-ruby/rest/insights/v1/call/call_summary.rb +7 -0
  28. data/lib/twilio-ruby/rest/insights/v1/call/event.rb +7 -0
  29. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +7 -0
  30. data/lib/twilio-ruby/rest/insights/v3/metadata.rb +1 -1
  31. data/lib/twilio-ruby/rest/insights/v3/query.rb +1 -1
  32. data/lib/twilio-ruby/rest/insights/v3.rb +1 -1
  33. data/lib/twilio-ruby/rest/intelligence/v3/conversation.rb +8 -8
  34. data/lib/twilio-ruby/rest/intelligence/v3/rule_execution.rb +502 -0
  35. data/lib/twilio-ruby/rest/intelligence/v3.rb +6 -0
  36. data/lib/twilio-ruby/rest/knowledge/v2/chunk.rb +28 -0
  37. data/lib/twilio-ruby/rest/knowledge/v2/knowledge.rb +38 -0
  38. data/lib/twilio-ruby/rest/knowledge/v2/search.rb +8 -117
  39. data/lib/twilio-ruby/rest/knowledge/v2.rb +1 -2
  40. data/lib/twilio-ruby/rest/memory/v1/bulk.rb +9 -118
  41. data/lib/twilio-ruby/rest/memory/v1/conversation_summary.rb +13 -5
  42. data/lib/twilio-ruby/rest/memory/v1/data_mapping.rb +6 -12
  43. data/lib/twilio-ruby/rest/memory/v1/identifier.rb +1 -1
  44. data/lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb +11 -132
  45. data/lib/twilio-ruby/rest/memory/v1/import.rb +28 -5
  46. data/lib/twilio-ruby/rest/memory/v1/lookup.rb +1 -1
  47. data/lib/twilio-ruby/rest/memory/v1/observation.rb +70 -18
  48. data/lib/twilio-ruby/rest/memory/v1/operation.rb +1 -1
  49. data/lib/twilio-ruby/rest/memory/v1/profile.rb +2 -2
  50. data/lib/twilio-ruby/rest/memory/v1/recall.rb +1 -1
  51. data/lib/twilio-ruby/rest/memory/v1/revision.rb +1 -1
  52. data/lib/twilio-ruby/rest/memory/v1/store.rb +1 -1
  53. data/lib/twilio-ruby/rest/memory/v1/trait.rb +1 -1
  54. data/lib/twilio-ruby/rest/memory/v1/trait_group.rb +56 -6
  55. data/lib/twilio-ruby/rest/memory/v1.rb +3 -46
  56. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +0 -18
  57. data/lib/twilio-ruby/rest/messaging/v2/channels_sender.rb +23 -4
  58. data/lib/twilio-ruby/rest/messaging/v3/typing_indicator.rb +4 -4
  59. data/lib/twilio-ruby/rest/numbers/v1/sms_verification.rb +231 -0
  60. data/lib/twilio-ruby/rest/numbers/v1/sms_verification_check.rb +238 -0
  61. data/lib/twilio-ruby/rest/numbers/v1/voice_verification.rb +245 -0
  62. data/lib/twilio-ruby/rest/numbers/v1/voice_verification_check.rb +224 -0
  63. data/lib/twilio-ruby/rest/numbers/v1.rb +24 -0
  64. data/lib/twilio-ruby/rest/{assistants/v1/session.rb → numbers/v2/caller_id.rb} +141 -127
  65. data/lib/twilio-ruby/rest/numbers/v2.rb +16 -0
  66. data/lib/twilio-ruby/rest/oauth/v2/authorize.rb +14 -2
  67. data/lib/twilio-ruby/rest/oauth/v2/oauth_authorization_server.rb +259 -0
  68. data/lib/twilio-ruby/rest/oauth/v2/token.rb +8 -2
  69. data/lib/twilio-ruby/rest/preview_iam/versionless/organization.rb +0 -19
  70. data/lib/twilio-ruby/rest/routes/v3/phone_number.rb +465 -0
  71. data/lib/twilio-ruby/rest/routes/v3.rb +50 -0
  72. data/lib/twilio-ruby/rest/routes_base.rb +6 -1
  73. data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration.rb +330 -0
  74. data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration_embedded_session.rb +233 -0
  75. data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration.rb +321 -0
  76. data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration_embedded_session.rb +233 -0
  77. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb +445 -0
  78. data/lib/twilio-ruby/rest/trusthub/v1/trust_products_provisional_copy.rb +445 -0
  79. data/lib/twilio-ruby/rest/trusthub/v1.rb +74 -0
  80. data/lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb +556 -0
  81. data/lib/twilio-ruby/rest/voice/v2/configuration/default.rb +356 -0
  82. data/lib/twilio-ruby/rest/voice/v2/configuration.rb +412 -0
  83. data/lib/twilio-ruby/rest/voice/v2/recording.rb +616 -0
  84. data/lib/twilio-ruby/rest/voice/v2/transcription.rb +591 -0
  85. data/lib/twilio-ruby/rest/voice/v2/type.rb +518 -0
  86. data/lib/twilio-ruby/rest/voice/v2.rb +141 -0
  87. data/lib/twilio-ruby/rest/voice_base.rb +5 -0
  88. data/lib/twilio-ruby/twiml/voice_response.rb +6 -68
  89. data/lib/twilio-ruby/version.rb +1 -1
  90. data/twilio-ruby.gemspec +1 -1
  91. metadata +33 -21
  92. data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb +0 -558
  93. data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb +0 -558
  94. data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +0 -431
  95. data/lib/twilio-ruby/rest/assistants/v1/assistant/message.rb +0 -296
  96. data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +0 -927
  97. data/lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb +0 -325
  98. data/lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb +0 -349
  99. data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +0 -871
  100. data/lib/twilio-ruby/rest/assistants/v1/policy.rb +0 -364
  101. data/lib/twilio-ruby/rest/assistants/v1/session/message.rb +0 -360
  102. data/lib/twilio-ruby/rest/assistants/v1/tool.rb +0 -847
  103. data/lib/twilio-ruby/rest/assistants/v1.rb +0 -104
  104. data/lib/twilio-ruby/rest/assistants.rb +0 -6
  105. data/lib/twilio-ruby/rest/assistants_base.rb +0 -38
@@ -38,8 +38,8 @@ module Twilio
38
38
  # Unlike stream(), this operation is eager and will load `limit` records into
39
39
  # memory before returning.
40
40
  # @param [String] page_token Token for pagination
41
- # @param [Time] created_at_before Filter by Conversations created before this timestamp.
42
- # @param [Time] created_at_after Filter by Conversations created after this timestamp.
41
+ # @param [Time] created_at_before Filter by Conversations created before this timestamp. The maximum allowed time range between `createdAtBefore` and `createdAtAfter` is 31 days.
42
+ # @param [Time] created_at_after Filter by Conversations created after this timestamp. The maximum allowed time range between `createdAtBefore` and `createdAtAfter` is 31 days.
43
43
  # @param [String] status Filter by Conversation status.
44
44
  # @param [String] channel_id Filters Conversations by the underlying channel resource ID, such as a Call ID or Message ID.
45
45
  # @param [Array[String]] channels Filters Conversations that include one or more of the specified communication channels (`OR` match).
@@ -74,8 +74,8 @@ module Twilio
74
74
  # This operation lazily loads records as efficiently as possible until the limit
75
75
  # is reached.
76
76
  # @param [String] page_token Token for pagination
77
- # @param [Time] created_at_before Filter by Conversations created before this timestamp.
78
- # @param [Time] created_at_after Filter by Conversations created after this timestamp.
77
+ # @param [Time] created_at_before Filter by Conversations created before this timestamp. The maximum allowed time range between `createdAtBefore` and `createdAtAfter` is 31 days.
78
+ # @param [Time] created_at_after Filter by Conversations created after this timestamp. The maximum allowed time range between `createdAtBefore` and `createdAtAfter` is 31 days.
79
79
  # @param [String] status Filter by Conversation status.
80
80
  # @param [String] channel_id Filters Conversations by the underlying channel resource ID, such as a Call ID or Message ID.
81
81
  # @param [Array[String]] channels Filters Conversations that include one or more of the specified communication channels (`OR` match).
@@ -114,8 +114,8 @@ module Twilio
114
114
  ##
115
115
  # Lists ConversationPageMetadata records from the API as a list.
116
116
  # @param [String] page_token Token for pagination
117
- # @param [Time] created_at_before Filter by Conversations created before this timestamp.
118
- # @param [Time] created_at_after Filter by Conversations created after this timestamp.
117
+ # @param [Time] created_at_before Filter by Conversations created before this timestamp. The maximum allowed time range between `createdAtBefore` and `createdAtAfter` is 31 days.
118
+ # @param [Time] created_at_after Filter by Conversations created after this timestamp. The maximum allowed time range between `createdAtBefore` and `createdAtAfter` is 31 days.
119
119
  # @param [String] status Filter by Conversation status.
120
120
  # @param [String] channel_id Filters Conversations by the underlying channel resource ID, such as a Call ID or Message ID.
121
121
  # @param [Array[String]] channels Filters Conversations that include one or more of the specified communication channels (`OR` match).
@@ -176,8 +176,8 @@ module Twilio
176
176
  # Retrieve a single page of ConversationInstance records from the API.
177
177
  # Request is executed immediately.
178
178
  # @param [String] page_token Token for pagination
179
- # @param [Time] created_at_before Filter by Conversations created before this timestamp.
180
- # @param [Time] created_at_after Filter by Conversations created after this timestamp.
179
+ # @param [Time] created_at_before Filter by Conversations created before this timestamp. The maximum allowed time range between `createdAtBefore` and `createdAtAfter` is 31 days.
180
+ # @param [Time] created_at_after Filter by Conversations created after this timestamp. The maximum allowed time range between `createdAtBefore` and `createdAtAfter` is 31 days.
181
181
  # @param [String] status Filter by Conversation status.
182
182
  # @param [String] channel_id Filters Conversations by the underlying channel resource ID, such as a Call ID or Message ID.
183
183
  # @param [Array[String]] channels Filters Conversations that include one or more of the specified communication channels (`OR` match).
@@ -0,0 +1,502 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio Conversational Intelligence API
8
+ # The Conversational Intelligence API includes resources to create and manage intelligence configurations, define and run language operators, and retrieve processed conversations and operator results. * Use the Configurations resource to create and manage intelligence configurations and define rules that control how and when language operators analyze and transform conversations. * Use the Operators resource to create custom language operators or retrieve Twilio-author and custom operators. * Use the Conversations resource to retrieve conversations processed with an intelligence configuration, and the OperatorResults resource to retrieve language operator results for those conversations.
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 Intelligence < IntelligenceBase
19
+ class V3 < Version
20
+ class RuleExecutionList < ListResource
21
+
22
+ class CreateRuleExecutionRequest
23
+ # @param [intelligence_configuration_id]: [String] The Intelligence Configuration identifier to execute the Rule within.
24
+ # @param [rule_id]: [String] The rule identifier to execute within the selected Intelligence Configuration.
25
+ # @param [conversation_id]: [String] The Conversation identifier to execute the Rule against.
26
+ attr_accessor :intelligence_configuration_id, :rule_id, :conversation_id
27
+ def initialize(payload)
28
+ @intelligence_configuration_id = payload["intelligence_configuration_id"]
29
+ @rule_id = payload["rule_id"]
30
+ @conversation_id = payload["conversation_id"]
31
+ end
32
+ def to_json(options = {})
33
+ {
34
+ "intelligenceConfigurationId": @intelligence_configuration_id,
35
+ "ruleId": @rule_id,
36
+ "conversationId": @conversation_id,
37
+ }.to_json(options)
38
+ end
39
+ end
40
+
41
+ class ExecutionDetailsCommunications
42
+ # @param [first]: [String] Communication `id` from the attached Conversation.
43
+ # @param [last]: [String] Communication `id` from the attached Conversation.
44
+ attr_accessor :first, :last
45
+ def initialize(payload)
46
+ @first = payload["first"]
47
+ @last = payload["last"]
48
+ end
49
+ def to_json(options = {})
50
+ {
51
+ "first": @first,
52
+ "last": @last,
53
+ }.to_json(options)
54
+ end
55
+ end
56
+
57
+ class ExecutionDetailsParticipants
58
+ # @param [id]: [String] The `id` of the Participant in the Conversation.
59
+ # @param [profile_id]: [String] Customer Memory Profile identifier
60
+ # @param [type]: [String] Type of participant in the conversation. Available types: - `CUSTOMER` - `HUMAN_AGENT` - `AI_AGENT` - `AGENT` - `UNKNOWN`
61
+ attr_accessor :id, :profile_id, :type
62
+ def initialize(payload)
63
+ @id = payload["id"]
64
+ @profile_id = payload["profile_id"]
65
+ @type = payload["type"]
66
+ end
67
+ def to_json(options = {})
68
+ {
69
+ "id": @id,
70
+ "profileId": @profile_id,
71
+ "type": @type,
72
+ }.to_json(options)
73
+ end
74
+ end
75
+
76
+ class ExecutionDetailsTrigger
77
+ # @param [on]: [String] The conversational lifecycle event that activated execution of the Rule. Available values are: - `COMMUNICATION`: Trigger the Rule on each communication within the Conversation. - `CONVERSATION_END`: Trigger the Rule when the Conversation moves to the `closed` state. - `CONVERSATION_INACTIVE`: Trigger the Rule when the Conversation moves to the `inactive` state.
78
+ # @param [timestamp]: [Time] Timestamp of when the trigger was activated.
79
+ attr_accessor :on, :timestamp
80
+ def initialize(payload)
81
+ @on = payload["on"]
82
+ @timestamp = payload["timestamp"]
83
+ end
84
+ def to_json(options = {})
85
+ {
86
+ "on": @on,
87
+ "timestamp": @timestamp,
88
+ }.to_json(options)
89
+ end
90
+ end
91
+
92
+ class ExtractionResultResultEntities
93
+ # @param [text]: [String] The actual text of the extracted entity as it appears in the Conversation.
94
+ # @param [label]: [String] The label for the extracted entity (e.g., `PERSON`, `LOCATION`).
95
+ attr_accessor :text, :label
96
+ def initialize(payload)
97
+ @text = payload["text"]
98
+ @label = payload["label"]
99
+ end
100
+ def to_json(options = {})
101
+ {
102
+ "text": @text,
103
+ "label": @label,
104
+ }.to_json(options)
105
+ end
106
+ end
107
+
108
+ class ResolvedContext
109
+ # @param [memory]: [ResolvedContextMemory]
110
+ # @param [knowledge]: [ResolvedContextKnowledge]
111
+ attr_accessor :memory, :knowledge
112
+ def initialize(payload)
113
+ @memory = payload["memory"]
114
+ @knowledge = payload["knowledge"]
115
+ end
116
+ def to_json(options = {})
117
+ {
118
+ "memory": @memory,
119
+ "knowledge": @knowledge,
120
+ }.to_json(options)
121
+ end
122
+ end
123
+
124
+ class ResolvedContextKnowledge
125
+ # @param [sources]: [Array<ResolvedContextKnowledgeSources>]
126
+ attr_accessor :sources
127
+ def initialize(payload)
128
+ @sources = payload["sources"]
129
+ end
130
+ def to_json(options = {})
131
+ {
132
+ "sources": @sources,
133
+ }.to_json(options)
134
+ end
135
+ end
136
+
137
+ class ResolvedContextKnowledgeSources
138
+ # @param [base_id]: [String] Knowledge base identifier
139
+ # @param [source_id]: [String] Knowledge source identifier
140
+ attr_accessor :base_id, :source_id
141
+ def initialize(payload)
142
+ @base_id = payload["base_id"]
143
+ @source_id = payload["source_id"]
144
+ end
145
+ def to_json(options = {})
146
+ {
147
+ "baseId": @base_id,
148
+ "sourceId": @source_id,
149
+ }.to_json(options)
150
+ end
151
+ end
152
+
153
+ class ResolvedContextMemory
154
+ # @param [profile_id]: [String] Customer Memory Profile identifier
155
+ # @param [memory_store_id]: [String] Customer Memory store identifier
156
+ attr_accessor :profile_id, :memory_store_id
157
+ def initialize(payload)
158
+ @profile_id = payload["profile_id"]
159
+ @memory_store_id = payload["memory_store_id"]
160
+ end
161
+ def to_json(options = {})
162
+ {
163
+ "profileId": @profile_id,
164
+ "memoryStoreId": @memory_store_id,
165
+ }.to_json(options)
166
+ end
167
+ end
168
+
169
+ class SystemMetaData
170
+ # @param [resolved_model]: [String] The underlying LLM model used for this execution.
171
+ # @param [latency_ms]: [Integer] Operator execution time in milliseconds.
172
+ # @param [input_characters]: [Integer] Number of characters in the input sent to the model. Aligns with the billing unit.
173
+ # @param [output_characters]: [Integer] Number of characters in the model's response. Aligns with the billing unit.
174
+ # @param [input_truncated]: [Boolean] Whether the conversation input was truncated to fit the model's context window.
175
+ attr_accessor :resolved_model, :latency_ms, :input_characters, :output_characters, :input_truncated
176
+ def initialize(payload)
177
+ @resolved_model = payload["resolved_model"]
178
+ @latency_ms = payload["latency_ms"]
179
+ @input_characters = payload["input_characters"]
180
+ @output_characters = payload["output_characters"]
181
+ @input_truncated = payload["input_truncated"]
182
+ end
183
+ def to_json(options = {})
184
+ {
185
+ "resolvedModel": @resolved_model,
186
+ "latencyMs": @latency_ms,
187
+ "inputCharacters": @input_characters,
188
+ "outputCharacters": @output_characters,
189
+ "inputTruncated": @input_truncated,
190
+ }.to_json(options)
191
+ end
192
+ end
193
+
194
+
195
+ ##
196
+ # Initialize the RuleExecutionList
197
+ # @param [Version] version Version that contains the resource
198
+ # @return [RuleExecutionList] RuleExecutionList
199
+ def initialize(version)
200
+
201
+ apiV1Version = ApiV1Version.new version.domain, version
202
+ super(apiV1Version)
203
+ # Path Solution
204
+ @solution = { }
205
+ @uri = "/RuleExecutions"
206
+
207
+ end
208
+ ##
209
+ # Create the RuleExecutionInstance
210
+ # @param [CreateRuleExecutionRequest] create_rule_execution_request
211
+ # @return [RuleExecutionInstance] Created RuleExecutionInstance
212
+ def create(create_rule_execution_request: nil
213
+ )
214
+
215
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
216
+ headers['Content-Type'] = 'application/json'
217
+
218
+
219
+
220
+
221
+ payload = @version.create('POST', @uri, headers: headers, data: create_rule_execution_request.to_json)
222
+ RuleExecutionInstance.new(
223
+ @version,
224
+ payload,
225
+ )
226
+ end
227
+
228
+ ##
229
+ # Create the RuleExecutionInstanceMetadata
230
+ # @param [CreateRuleExecutionRequest] create_rule_execution_request
231
+ # @return [RuleExecutionInstance] Created RuleExecutionInstance
232
+ def create_with_metadata(create_rule_execution_request: nil
233
+ )
234
+
235
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
236
+ headers['Content-Type'] = 'application/json'
237
+
238
+
239
+
240
+
241
+ response = @version.create_with_metadata('POST', @uri, headers: headers, data: create_rule_execution_request.to_json)
242
+ rule_execution_instance = RuleExecutionInstance.new(
243
+ @version,
244
+ response.body,
245
+ )
246
+ RuleExecutionInstanceMetadata.new(
247
+ @version,
248
+ rule_execution_instance,
249
+ response.headers,
250
+ response.status_code
251
+ )
252
+ end
253
+
254
+
255
+
256
+
257
+ # Provide a user friendly representation
258
+ def to_s
259
+ '#<Twilio.Intelligence.V3.RuleExecutionList>'
260
+ end
261
+ end
262
+
263
+ class RuleExecutionPage < TokenPage
264
+ ##
265
+ # Initialize the RuleExecutionPage
266
+ # @param [Version] version Version that contains the resource
267
+ # @param [Response] response Response from the API
268
+ # @param [Hash] solution Path solution for the resource
269
+ # @return [RuleExecutionPage] RuleExecutionPage
270
+ def initialize(version, response, solution)
271
+
272
+ apiV1Version = ApiV1Version.new version.domain, version
273
+ super(apiV1Version, response)
274
+
275
+ # Path Solution
276
+ @solution = solution
277
+ end
278
+
279
+ ##
280
+ # Build an instance of RuleExecutionInstance
281
+ # @param [Hash] payload Payload response from the API
282
+ # @return [RuleExecutionInstance] RuleExecutionInstance
283
+ def get_instance(payload)
284
+ RuleExecutionInstance.new(@version, payload)
285
+ end
286
+
287
+ ##
288
+ # Provide a user friendly representation
289
+ def to_s
290
+ '<Twilio.Intelligence.V3.RuleExecutionPage>'
291
+ end
292
+ end
293
+
294
+ class RuleExecutionPageMetadata < PageMetadata
295
+ attr_reader :rule_execution_page
296
+
297
+ def initialize(version, response, solution, limit)
298
+ super(version, response)
299
+ @rule_execution_page = []
300
+ @limit = limit
301
+ key = get_key(response.body)
302
+ records = 0
303
+ while( limit != :unset && records < limit )
304
+ @rule_execution_page << RuleExecutionListResponse.new(version, @payload, key, limit - records)
305
+ @payload = self.next_page
306
+ break unless @payload
307
+ records += (@payload.body[key] || []).size
308
+ end
309
+ # Path Solution
310
+ @solution = solution
311
+ end
312
+
313
+ def each
314
+ @rule_execution_page.each do |record|
315
+ yield record
316
+ end
317
+ end
318
+
319
+ def to_s
320
+ '<Twilio::REST::Intelligence::V3PageMetadata>';
321
+ end
322
+ end
323
+ class RuleExecutionListResponse < InstanceListResource
324
+
325
+ # @param [Array<RuleExecutionInstance>] instance
326
+ # @param [Hash{String => Object}] headers
327
+ # @param [Integer] status_code
328
+ def initialize(version, payload, key, limit = :unset)
329
+ data_list = payload.body[key] || []
330
+ if limit != :unset
331
+ data_list = data_list[0, limit]
332
+ end
333
+ @rule_execution = data_list.map do |data|
334
+ RuleExecutionInstance.new(version, data)
335
+ end
336
+ @headers = payload.headers
337
+ @status_code = payload.status_code
338
+ end
339
+
340
+ def rule_execution
341
+ @rule_execution
342
+ end
343
+
344
+ def headers
345
+ @headers
346
+ end
347
+
348
+ def status_code
349
+ @status_code
350
+ end
351
+ end
352
+
353
+ class RuleExecutionInstance < InstanceResource
354
+ ##
355
+ # Initialize the RuleExecutionInstance
356
+ # @param [Version] version Version that contains the resource
357
+ # @param [Hash] payload payload that contains response from Twilio
358
+ # @param [String] account_sid The SID of the
359
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this RuleExecution
360
+ # resource.
361
+ # @param [String] sid The SID of the Call resource to fetch.
362
+ # @return [RuleExecutionInstance] RuleExecutionInstance
363
+ def initialize(version, payload )
364
+
365
+ apiV1Version = ApiV1Version.new version.domain, version
366
+ super(apiV1Version)
367
+
368
+ # Marshaled Properties
369
+ @properties = {
370
+ 'code' => payload['code'],
371
+ 'message' => payload['message'],
372
+ 'http_status_code' => payload['http_status_code'],
373
+ 'user_error' => payload['user_error'],
374
+ 'params' => payload['params'],
375
+ 'output_format' => payload['output_format'],
376
+ 'id' => payload['id'],
377
+ 'account_id' => payload['account_id'],
378
+ 'intelligence_configuration' => payload['intelligence_configuration'],
379
+ 'conversation_id' => payload['conversation_id'],
380
+ 'operator' => payload['operator'],
381
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
382
+ 'reference_ids' => payload['reference_ids'],
383
+ 'execution_details' => payload['execution_details'],
384
+ 'metadata' => payload['metadata'],
385
+ 'result' => payload['result'],
386
+ }
387
+ end
388
+
389
+
390
+ ##
391
+ # @return [String] Twilio-specific error code
392
+ def code
393
+ @properties['code']
394
+ end
395
+
396
+ ##
397
+ # @return [String] A human readable error message
398
+ def message
399
+ @properties['message']
400
+ end
401
+
402
+ ##
403
+ # @return [String] HTTP response status code
404
+ def http_status_code
405
+ @properties['http_status_code']
406
+ end
407
+
408
+ ##
409
+ # @return [Boolean] Whether the error is a user error (true) or a system error (false)
410
+ def user_error
411
+ @properties['user_error']
412
+ end
413
+
414
+ ##
415
+ # @return [Hash<String, String>] A map of parameters related to the error, for example, a `params.twilioErrorCodeUrl` might hold a URL or link to additional information
416
+ def params
417
+ @properties['params']
418
+ end
419
+
420
+ ##
421
+ # @return [String] The output format set on the Operator that generated this result. Determines the structure of the `result` object.
422
+ def output_format
423
+ @properties['output_format']
424
+ end
425
+
426
+ ##
427
+ # @return [String] A unique identifier for the Operator Result. Assigned by Twilio (TTID).
428
+ def id
429
+ @properties['id']
430
+ end
431
+
432
+ ##
433
+ # @return [String] The ID of the Account that created the Language Operator.
434
+ def account_id
435
+ @properties['account_id']
436
+ end
437
+
438
+ ##
439
+ # @return [IntelligenceConfigurationReference]
440
+ def intelligence_configuration
441
+ @properties['intelligence_configuration']
442
+ end
443
+
444
+ ##
445
+ # @return [String] The `id` of the Conversation attached to the Operator Result.
446
+ def conversation_id
447
+ @properties['conversation_id']
448
+ end
449
+
450
+ ##
451
+ # @return [OperatorReference]
452
+ def operator
453
+ @properties['operator']
454
+ end
455
+
456
+ ##
457
+ # @return [Time] Timestamp for when the Operator Result was created.
458
+ def date_created
459
+ @properties['date_created']
460
+ end
461
+
462
+ ##
463
+ # @return [Array<String>] The `id`s of objects related to this Operator Result.
464
+ def reference_ids
465
+ @properties['reference_ids']
466
+ end
467
+
468
+ ##
469
+ # @return [ExecutionDetails]
470
+ def execution_details
471
+ @properties['execution_details']
472
+ end
473
+
474
+ ##
475
+ # @return [OperatorResultsResponseBaseMetadata]
476
+ def metadata
477
+ @properties['metadata']
478
+ end
479
+
480
+ ##
481
+ # @return [ExtractionResultResult]
482
+ def result
483
+ @properties['result']
484
+ end
485
+
486
+ ##
487
+ # Provide a user friendly representation
488
+ def to_s
489
+ "<Twilio.Intelligence.V3.RuleExecutionInstance>"
490
+ end
491
+
492
+ ##
493
+ # Provide a detailed, user friendly representation
494
+ def inspect
495
+ "<Twilio.Intelligence.V3.RuleExecutionInstance>"
496
+ end
497
+ end
498
+
499
+ end
500
+ end
501
+ end
502
+ end
@@ -25,6 +25,7 @@ module Twilio
25
25
  @conversations = nil
26
26
  @operators = nil
27
27
  @operator_results = nil
28
+ @rule_executions = nil
28
29
  @versions = nil
29
30
  end
30
31
 
@@ -89,6 +90,11 @@ module Twilio
89
90
  end
90
91
  end
91
92
  ##
93
+ # @return [Twilio::REST::Intelligence::V3::RuleExecutionList]
94
+ def rule_executions
95
+ @rule_executions ||= RuleExecutionList.new self
96
+ end
97
+ ##
92
98
  # @param [String] id The unique identifier (TTID) of the Language Operator.
93
99
  # @param [String] version
94
100
  # @return [Twilio::REST::Intelligence::V3::VersionContext] if version was passed.
@@ -271,6 +271,10 @@ module Twilio
271
271
  @properties = {
272
272
  'content' => payload['content'],
273
273
  'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
274
+ 'chunk_index' => payload['chunk_index'] == nil ? payload['chunk_index'] : payload['chunk_index'].to_i,
275
+ 'document_title' => payload['document_title'],
276
+ 'document_url' => payload['document_url'],
277
+ 'document_number' => payload['document_number'] == nil ? payload['document_number'] : payload['document_number'].to_i,
274
278
  }
275
279
  end
276
280
 
@@ -287,6 +291,30 @@ module Twilio
287
291
  @properties['created_at']
288
292
  end
289
293
 
294
+ ##
295
+ # @return [String] 0-based position of this chunk within its source document for a single ingestion run.
296
+ def chunk_index
297
+ @properties['chunk_index']
298
+ end
299
+
300
+ ##
301
+ # @return [String] Human-readable title of the source document. Web: HTML <title> from the crawled page. File: filename from Unstructured metadata. Text: knowledge name from the knowledge source.
302
+ def document_title
303
+ @properties['document_title']
304
+ end
305
+
306
+ ##
307
+ # @return [String] Specific page URL this chunk was crawled from. Web sources only; null for File and Text sources.
308
+ def document_url
309
+ @properties['document_url']
310
+ end
311
+
312
+ ##
313
+ # @return [String] Physical page number (1-based). PDF sources only; omitted for all other source types.
314
+ def document_number
315
+ @properties['document_number']
316
+ end
317
+
290
318
  ##
291
319
  # Provide a user friendly representation
292
320
  def to_s
@@ -38,6 +38,44 @@ module Twilio
38
38
  end
39
39
  end
40
40
 
41
+ class KnowledgeErrorGroup
42
+ # @param [title]: [String] The error type or reason (e.g., \"404 Not Found\", \"500 Internal Server Error\").
43
+ # @param [instances]: [Array<KnowledgeList.KnowledgeErrorInstance>] Array of error instances for this error title. Required when an error group is present.
44
+ attr_accessor :title, :instances
45
+ def initialize(payload)
46
+ @title = payload["title"]
47
+ @instances = payload["instances"]
48
+ end
49
+ def to_json(options = {})
50
+ {
51
+ "title": @title,
52
+ "instances": @instances,
53
+ }.to_json(options)
54
+ end
55
+ end
56
+
57
+ class KnowledgeErrorInstance
58
+ # @param [type]: [String] A URI reference identifying the problem type, resolving to human-readable documentation (e.g., https://www.twilio.com/docs/api/errors/420018).
59
+ # @param [code]: [String] Twilio-specific numeric error code for programmatic handling.
60
+ # @param [instance]: [String] The specific URL or resource that caused the error.
61
+ # @param [detail]: [String] Detailed explanation of the error.
62
+ attr_accessor :type, :code, :instance, :detail
63
+ def initialize(payload)
64
+ @type = payload["type"]
65
+ @code = payload["code"]
66
+ @instance = payload["instance"]
67
+ @detail = payload["detail"]
68
+ end
69
+ def to_json(options = {})
70
+ {
71
+ "type": @type,
72
+ "code": @code,
73
+ "instance": @instance,
74
+ "detail": @detail,
75
+ }.to_json(options)
76
+ end
77
+ end
78
+
41
79
 
42
80
  ##
43
81
  # Initialize the KnowledgeList