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
@@ -1,431 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
- # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
- # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
- #
7
- # Twilio - Assistants
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 Assistants < AssistantsBase
19
- class V1 < Version
20
- class AssistantContext < InstanceContext
21
-
22
- class FeedbackList < ListResource
23
-
24
- class AssistantsV1ServiceCreateFeedbackRequest
25
- # @param [message_id]: [String] The message ID.
26
- # @param [score]: [Float] The score to be given(0-1).
27
- # @param [session_id]: [String] The Session ID.
28
- # @param [text]: [String] The text to be given as feedback.
29
- attr_accessor :message_id, :score, :session_id, :text
30
- def initialize(payload)
31
- @message_id = payload["message_id"]
32
- @score = payload["score"]
33
- @session_id = payload["session_id"]
34
- @text = payload["text"]
35
- end
36
- def to_json(options = {})
37
- {
38
- "message_id": @message_id,
39
- "score": @score,
40
- "session_id": @session_id,
41
- "text": @text,
42
- }.to_json(options)
43
- end
44
- end
45
-
46
-
47
- ##
48
- # Initialize the FeedbackList
49
- # @param [Version] version Version that contains the resource
50
- # @return [FeedbackList] FeedbackList
51
- def initialize(version, id: nil)
52
- super(version)
53
-
54
- # Path Solution
55
- @solution = { id: id }
56
- @uri = "/Assistants/#{@solution[:id]}/Feedbacks"
57
-
58
- end
59
- ##
60
- # Create the FeedbackInstance
61
- # @param [AssistantsV1ServiceCreateFeedbackRequest] assistants_v1_service_create_feedback_request
62
- # @return [FeedbackInstance] Created FeedbackInstance
63
- def create(assistants_v1_service_create_feedback_request: nil
64
- )
65
-
66
- headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
67
- headers['Content-Type'] = 'application/json'
68
-
69
-
70
-
71
-
72
- payload = @version.create('POST', @uri, headers: headers, data: assistants_v1_service_create_feedback_request.to_json)
73
- FeedbackInstance.new(
74
- @version,
75
- payload,
76
- id: @solution[:id],
77
- )
78
- end
79
-
80
- ##
81
- # Create the FeedbackInstanceMetadata
82
- # @param [AssistantsV1ServiceCreateFeedbackRequest] assistants_v1_service_create_feedback_request
83
- # @return [FeedbackInstance] Created FeedbackInstance
84
- def create_with_metadata(assistants_v1_service_create_feedback_request: nil
85
- )
86
-
87
- headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
88
- headers['Content-Type'] = 'application/json'
89
-
90
-
91
-
92
-
93
- response = @version.create_with_metadata('POST', @uri, headers: headers, data: assistants_v1_service_create_feedback_request.to_json)
94
- feedback_instance = FeedbackInstance.new(
95
- @version,
96
- response.body,
97
- id: @solution[:id],
98
- )
99
- FeedbackInstanceMetadata.new(
100
- @version,
101
- feedback_instance,
102
- response.headers,
103
- response.status_code
104
- )
105
- end
106
-
107
-
108
- ##
109
- # Lists FeedbackInstance records from the API as a list.
110
- # Unlike stream(), this operation is eager and will load `limit` records into
111
- # memory before returning.
112
- # @param [Integer] limit Upper limit for the number of records to return. stream()
113
- # guarantees to never return more than limit. Default is no limit
114
- # @param [Integer] page_size Number of records to fetch per request, when
115
- # not set will use the default value of 50 records. If no page_size is defined
116
- # but a limit is defined, stream() will attempt to read the limit with the most
117
- # efficient page size, i.e. min(limit, 1000)
118
- # @return [Array] Array of up to limit results
119
- def list(limit: nil, page_size: nil)
120
- self.stream(
121
- limit: limit,
122
- page_size: page_size
123
- ).entries
124
- end
125
-
126
- ##
127
- # Streams Instance records from the API as an Enumerable.
128
- # This operation lazily loads records as efficiently as possible until the limit
129
- # is reached.
130
- # @param [Integer] limit Upper limit for the number of records to return. stream()
131
- # guarantees to never return more than limit. Default is no limit
132
- # @param [Integer] page_size Number of records to fetch per request, when
133
- # not set will use the default value of 50 records. If no page_size is defined
134
- # but a limit is defined, stream() will attempt to read the limit with the most
135
- # efficient page size, i.e. min(limit, 1000)
136
- # @return [Enumerable] Enumerable that will yield up to limit results
137
- def stream(limit: nil, page_size: nil)
138
- limits = @version.read_limits(limit, page_size)
139
-
140
- page = self.page(
141
- page_size: limits[:page_size], )
142
-
143
- return [].each if page.nil?
144
-
145
- result = @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
146
- return [].each if result.nil?
147
- result
148
- end
149
-
150
- ##
151
- # Lists FeedbackPageMetadata records from the API as a list.
152
- # @param [Integer] limit Upper limit for the number of records to return. stream()
153
- # guarantees to never return more than limit. Default is no limit
154
- # @param [Integer] page_size Number of records to fetch per request, when
155
- # not set will use the default value of 50 records. If no page_size is defined
156
- # but a limit is defined, stream() will attempt to read the limit with the most
157
- # efficient page size, i.e. min(limit, 1000)
158
- # @return [Array] Array of up to limit results
159
- def list_with_metadata(limit: nil, page_size: nil)
160
- limits = @version.read_limits(limit, page_size)
161
- params = Twilio::Values.of({
162
-
163
- 'PageSize' => limits[:page_size],
164
- });
165
- headers = Twilio::Values.of({})
166
-
167
- response = @version.page('GET', @uri, params: params, headers: headers)
168
-
169
- FeedbackPageMetadata.new(@version, response, @solution, limits[:limit])
170
- end
171
-
172
- ##
173
- # When passed a block, yields FeedbackInstance records from the API.
174
- # This operation lazily loads records as efficiently as possible until the limit
175
- # is reached.
176
- def each
177
- limits = @version.read_limits
178
-
179
- page = self.page(page_size: limits[:page_size], )
180
-
181
- return [].each if page.nil?
182
-
183
- result = @version.stream(page,
184
- limit: limits[:limit],
185
- page_limit: limits[:page_limit])
186
- return [].each if result.nil?
187
- result.each {|x| yield x}
188
- end
189
-
190
- ##
191
- # Retrieve a single page of FeedbackInstance records from the API.
192
- # Request is executed immediately.
193
- # @param [String] page_token PageToken provided by the API
194
- # @param [Integer] page_number Page Number, this value is simply for client state
195
- # @param [Integer] page_size Number of records to return, defaults to 50
196
- # @return [Page] Page of FeedbackInstance
197
- def page(page_token: :unset, page_number: :unset,page_size: :unset)
198
- params = Twilio::Values.of({
199
- 'PageToken' => page_token,
200
- 'Page' => page_number,
201
- 'PageSize' => page_size,
202
- })
203
- headers = Twilio::Values.of({})
204
-
205
-
206
-
207
- response = @version.page('GET', @uri, params: params, headers: headers)
208
-
209
- FeedbackPage.new(@version, response, @solution)
210
- end
211
-
212
- ##
213
- # Retrieve a single page of FeedbackInstance records from the API.
214
- # Request is executed immediately.
215
- # @param [String] target_url API-generated URL for the requested results page
216
- # @return [Page] Page of FeedbackInstance
217
- def get_page(target_url)
218
- response = @version.domain.request(
219
- 'GET',
220
- target_url
221
- )
222
- FeedbackPage.new(@version, response, @solution)
223
- end
224
-
225
-
226
-
227
- # Provide a user friendly representation
228
- def to_s
229
- '#<Twilio.Assistants.V1.FeedbackList>'
230
- end
231
- end
232
-
233
- class FeedbackPage < Page
234
- ##
235
- # Initialize the FeedbackPage
236
- # @param [Version] version Version that contains the resource
237
- # @param [Response] response Response from the API
238
- # @param [Hash] solution Path solution for the resource
239
- # @return [FeedbackPage] FeedbackPage
240
- def initialize(version, response, solution)
241
- super(version, response)
242
-
243
-
244
- # Path Solution
245
- @solution = solution
246
- end
247
-
248
- ##
249
- # Build an instance of FeedbackInstance
250
- # @param [Hash] payload Payload response from the API
251
- # @return [FeedbackInstance] FeedbackInstance
252
- def get_instance(payload)
253
- FeedbackInstance.new(@version, payload, id: @solution[:id])
254
- end
255
-
256
- ##
257
- # Provide a user friendly representation
258
- def to_s
259
- '<Twilio.Assistants.V1.FeedbackPage>'
260
- end
261
- end
262
-
263
- class FeedbackPageMetadata < PageMetadata
264
- attr_reader :feedback_page
265
-
266
- def initialize(version, response, solution, limit)
267
- super(version, response)
268
- @feedback_page = []
269
- @limit = limit
270
- key = get_key(response.body)
271
- records = 0
272
- while( limit != :unset && records < limit )
273
- @feedback_page << FeedbackListResponse.new(version, @payload, key, limit - records)
274
- @payload = self.next_page
275
- break unless @payload
276
- records += (@payload.body[key] || []).size
277
- end
278
- # Path Solution
279
- @solution = solution
280
- end
281
-
282
- def each
283
- @feedback_page.each do |record|
284
- yield record
285
- end
286
- end
287
-
288
- def to_s
289
- '<Twilio::REST::Assistants::V1PageMetadata>';
290
- end
291
- end
292
- class FeedbackListResponse < InstanceListResource
293
-
294
- # @param [Array<FeedbackInstance>] instance
295
- # @param [Hash{String => Object}] headers
296
- # @param [Integer] status_code
297
- def initialize(version, payload, key, limit = :unset)
298
- data_list = payload.body[key] || []
299
- if limit != :unset
300
- data_list = data_list[0, limit]
301
- end
302
- @feedback = data_list.map do |data|
303
- FeedbackInstance.new(version, data)
304
- end
305
- @headers = payload.headers
306
- @status_code = payload.status_code
307
- end
308
-
309
- def feedback
310
- @feedback
311
- end
312
-
313
- def headers
314
- @headers
315
- end
316
-
317
- def status_code
318
- @status_code
319
- end
320
- end
321
-
322
- class FeedbackInstance < InstanceResource
323
- ##
324
- # Initialize the FeedbackInstance
325
- # @param [Version] version Version that contains the resource
326
- # @param [Hash] payload payload that contains response from Twilio
327
- # @param [String] account_sid The SID of the
328
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Feedback
329
- # resource.
330
- # @param [String] sid The SID of the Call resource to fetch.
331
- # @return [FeedbackInstance] FeedbackInstance
332
- def initialize(version, payload , id: nil)
333
- super(version)
334
-
335
-
336
- # Marshaled Properties
337
- @properties = {
338
- 'assistant_id' => payload['assistant_id'],
339
- 'id' => payload['id'],
340
- 'account_sid' => payload['account_sid'],
341
- 'user_sid' => payload['user_sid'],
342
- 'message_id' => payload['message_id'],
343
- 'score' => payload['score'],
344
- 'session_id' => payload['session_id'],
345
- 'text' => payload['text'],
346
- 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
347
- 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
348
- }
349
- end
350
-
351
-
352
- ##
353
- # @return [String] The Assistant ID.
354
- def assistant_id
355
- @properties['assistant_id']
356
- end
357
-
358
- ##
359
- # @return [String] The Feedback ID.
360
- def id
361
- @properties['id']
362
- end
363
-
364
- ##
365
- # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Feedback.
366
- def account_sid
367
- @properties['account_sid']
368
- end
369
-
370
- ##
371
- # @return [String] The SID of the User created the Feedback.
372
- def user_sid
373
- @properties['user_sid']
374
- end
375
-
376
- ##
377
- # @return [String] The Message ID.
378
- def message_id
379
- @properties['message_id']
380
- end
381
-
382
- ##
383
- # @return [Float] The Score to provide as Feedback (0-1)
384
- def score
385
- @properties['score']
386
- end
387
-
388
- ##
389
- # @return [String] The Session ID.
390
- def session_id
391
- @properties['session_id']
392
- end
393
-
394
- ##
395
- # @return [String] The text to be given as feedback.
396
- def text
397
- @properties['text']
398
- end
399
-
400
- ##
401
- # @return [Time] The date and time in GMT when the Feedback was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
402
- def date_created
403
- @properties['date_created']
404
- end
405
-
406
- ##
407
- # @return [Time] The date and time in GMT when the Feedback was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
408
- def date_updated
409
- @properties['date_updated']
410
- end
411
-
412
- ##
413
- # Provide a user friendly representation
414
- def to_s
415
- "<Twilio.Assistants.V1.FeedbackInstance>"
416
- end
417
-
418
- ##
419
- # Provide a detailed, user friendly representation
420
- def inspect
421
- "<Twilio.Assistants.V1.FeedbackInstance>"
422
- end
423
- end
424
-
425
- end
426
- end
427
- end
428
- end
429
- end
430
-
431
-