twilio-ruby 7.3.1 → 7.3.3

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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +24 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/accounts/v1/bulk_consents.rb +133 -0
  5. data/lib/twilio-ruby/rest/accounts/v1/bulk_contacts.rb +133 -0
  6. data/lib/twilio-ruby/rest/accounts/v1.rb +12 -0
  7. data/lib/twilio-ruby/rest/{preview/deployed_devices/fleet/key.rb → assistants/v1/assistant/assistants_knowledge.rb} +104 -170
  8. data/lib/twilio-ruby/rest/{preview/deployed_devices/fleet/deployment.rb → assistants/v1/assistant/assistants_tool.rb} +111 -157
  9. data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +1 -1
  10. data/lib/twilio-ruby/rest/assistants/v1/assistant/message.rb +201 -0
  11. data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +57 -15
  12. data/lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb +209 -0
  13. data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +21 -23
  14. data/lib/twilio-ruby/rest/assistants/v1/tool.rb +37 -0
  15. data/lib/twilio-ruby/rest/iam/v1/{new_api_key.rb → key.rb} +20 -20
  16. data/lib/twilio-ruby/rest/iam/v1.rb +4 -4
  17. data/lib/twilio-ruby/rest/numbers/v1/porting_portability.rb +8 -2
  18. data/lib/twilio-ruby/rest/numbers/v1/{porting_webhook_configuration_fetch.rb → webhook.rb} +20 -20
  19. data/lib/twilio-ruby/rest/numbers/v1.rb +6 -6
  20. data/lib/twilio-ruby/rest/preview_base.rb +0 -5
  21. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +4 -1
  22. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +3 -3
  23. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -0
  24. data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +4 -1
  25. data/lib/twilio-ruby/version.rb +1 -1
  26. metadata +10 -10
  27. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb +0 -424
  28. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb +0 -463
  29. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +0 -511
  30. data/lib/twilio-ruby/rest/preview/deployed_devices.rb +0 -49
@@ -4,7 +4,7 @@
4
4
  # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
5
  # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
6
  #
7
- # Twilio - Preview
7
+ # Twilio - Assistants
8
8
  # This is the public Twilio REST API.
9
9
  #
10
10
  # NOTE: This class is auto generated by OpenAPI Generator.
@@ -15,54 +15,28 @@
15
15
 
16
16
  module Twilio
17
17
  module REST
18
- class Preview < PreviewBase
19
- class DeployedDevices < Version
20
- class FleetContext < InstanceContext
18
+ class Assistants < AssistantsBase
19
+ class V1 < Version
20
+ class AssistantContext < InstanceContext
21
21
 
22
- class KeyList < ListResource
22
+ class AssistantsKnowledgeList < ListResource
23
23
 
24
24
  ##
25
- # Initialize the KeyList
25
+ # Initialize the AssistantsKnowledgeList
26
26
  # @param [Version] version Version that contains the resource
27
- # @return [KeyList] KeyList
28
- def initialize(version, fleet_sid: nil)
27
+ # @return [AssistantsKnowledgeList] AssistantsKnowledgeList
28
+ def initialize(version, assistant_id: nil)
29
29
  super(version)
30
30
  # Path Solution
31
- @solution = { fleet_sid: fleet_sid }
32
- @uri = "/Fleets/#{@solution[:fleet_sid]}/Keys"
31
+ @solution = { assistant_id: assistant_id }
32
+ @uri = "/Assistants/#{@solution[:assistant_id]}/Knowledge"
33
33
 
34
34
  end
35
- ##
36
- # Create the KeyInstance
37
- # @param [String] friendly_name Provides a human readable descriptive text for this Key credential, up to 256 characters long.
38
- # @param [String] device_sid Provides the unique string identifier of an existing Device to become authenticated with this Key credential.
39
- # @return [KeyInstance] Created KeyInstance
40
- def create(
41
- friendly_name: :unset,
42
- device_sid: :unset
43
- )
44
-
45
- data = Twilio::Values.of({
46
- 'FriendlyName' => friendly_name,
47
- 'DeviceSid' => device_sid,
48
- })
49
-
50
- headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
51
-
52
- payload = @version.create('POST', @uri, data: data, headers: headers)
53
- KeyInstance.new(
54
- @version,
55
- payload,
56
- fleet_sid: @solution[:fleet_sid],
57
- )
58
- end
59
-
60
35
 
61
36
  ##
62
- # Lists KeyInstance records from the API as a list.
37
+ # Lists AssistantsKnowledgeInstance records from the API as a list.
63
38
  # Unlike stream(), this operation is eager and will load `limit` records into
64
39
  # memory before returning.
65
- # @param [String] device_sid Filters the resulting list of Keys by a unique string identifier of an authenticated Device.
66
40
  # @param [Integer] limit Upper limit for the number of records to return. stream()
67
41
  # guarantees to never return more than limit. Default is no limit
68
42
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -70,9 +44,8 @@ module Twilio
70
44
  # but a limit is defined, stream() will attempt to read the limit with the most
71
45
  # efficient page size, i.e. min(limit, 1000)
72
46
  # @return [Array] Array of up to limit results
73
- def list(device_sid: :unset, limit: nil, page_size: nil)
47
+ def list(limit: nil, page_size: nil)
74
48
  self.stream(
75
- device_sid: device_sid,
76
49
  limit: limit,
77
50
  page_size: page_size
78
51
  ).entries
@@ -82,7 +55,6 @@ module Twilio
82
55
  # Streams Instance records from the API as an Enumerable.
83
56
  # This operation lazily loads records as efficiently as possible until the limit
84
57
  # is reached.
85
- # @param [String] device_sid Filters the resulting list of Keys by a unique string identifier of an authenticated Device.
86
58
  # @param [Integer] limit Upper limit for the number of records to return. stream()
87
59
  # guarantees to never return more than limit. Default is no limit
88
60
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -90,18 +62,17 @@ module Twilio
90
62
  # but a limit is defined, stream() will attempt to read the limit with the most
91
63
  # efficient page size, i.e. min(limit, 1000)
92
64
  # @return [Enumerable] Enumerable that will yield up to limit results
93
- def stream(device_sid: :unset, limit: nil, page_size: nil)
65
+ def stream(limit: nil, page_size: nil)
94
66
  limits = @version.read_limits(limit, page_size)
95
67
 
96
68
  page = self.page(
97
- device_sid: device_sid,
98
69
  page_size: limits[:page_size], )
99
70
 
100
71
  @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
101
72
  end
102
73
 
103
74
  ##
104
- # When passed a block, yields KeyInstance records from the API.
75
+ # When passed a block, yields AssistantsKnowledgeInstance records from the API.
105
76
  # This operation lazily loads records as efficiently as possible until the limit
106
77
  # is reached.
107
78
  def each
@@ -115,16 +86,14 @@ module Twilio
115
86
  end
116
87
 
117
88
  ##
118
- # Retrieve a single page of KeyInstance records from the API.
89
+ # Retrieve a single page of AssistantsKnowledgeInstance records from the API.
119
90
  # Request is executed immediately.
120
- # @param [String] device_sid Filters the resulting list of Keys by a unique string identifier of an authenticated Device.
121
91
  # @param [String] page_token PageToken provided by the API
122
92
  # @param [Integer] page_number Page Number, this value is simply for client state
123
93
  # @param [Integer] page_size Number of records to return, defaults to 50
124
- # @return [Page] Page of KeyInstance
125
- def page(device_sid: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
94
+ # @return [Page] Page of AssistantsKnowledgeInstance
95
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
126
96
  params = Twilio::Values.of({
127
- 'DeviceSid' => device_sid,
128
97
  'PageToken' => page_token,
129
98
  'Page' => page_number,
130
99
  'PageSize' => page_size,
@@ -132,97 +101,71 @@ module Twilio
132
101
 
133
102
  response = @version.page('GET', @uri, params: params)
134
103
 
135
- KeyPage.new(@version, response, @solution)
104
+ AssistantsKnowledgePage.new(@version, response, @solution)
136
105
  end
137
106
 
138
107
  ##
139
- # Retrieve a single page of KeyInstance records from the API.
108
+ # Retrieve a single page of AssistantsKnowledgeInstance records from the API.
140
109
  # Request is executed immediately.
141
110
  # @param [String] target_url API-generated URL for the requested results page
142
- # @return [Page] Page of KeyInstance
111
+ # @return [Page] Page of AssistantsKnowledgeInstance
143
112
  def get_page(target_url)
144
113
  response = @version.domain.request(
145
114
  'GET',
146
115
  target_url
147
116
  )
148
- KeyPage.new(@version, response, @solution)
117
+ AssistantsKnowledgePage.new(@version, response, @solution)
149
118
  end
150
119
 
151
120
 
152
121
 
153
122
  # Provide a user friendly representation
154
123
  def to_s
155
- '#<Twilio.Preview.DeployedDevices.KeyList>'
124
+ '#<Twilio.Assistants.V1.AssistantsKnowledgeList>'
156
125
  end
157
126
  end
158
127
 
159
128
 
160
- class KeyContext < InstanceContext
129
+ class AssistantsKnowledgeContext < InstanceContext
161
130
  ##
162
- # Initialize the KeyContext
131
+ # Initialize the AssistantsKnowledgeContext
163
132
  # @param [Version] version Version that contains the resource
164
- # @param [String] fleet_sid
165
- # @param [String] sid Provides a 34 character string that uniquely identifies the requested Key credential resource.
166
- # @return [KeyContext] KeyContext
167
- def initialize(version, fleet_sid, sid)
133
+ # @param [String] assistant_id The assistant ID.
134
+ # @param [String] id The knowledge ID.
135
+ # @return [AssistantsKnowledgeContext] AssistantsKnowledgeContext
136
+ def initialize(version, assistant_id, id)
168
137
  super(version)
169
138
 
170
139
  # Path Solution
171
- @solution = { fleet_sid: fleet_sid, sid: sid, }
172
- @uri = "/Fleets/#{@solution[:fleet_sid]}/Keys/#{@solution[:sid]}"
140
+ @solution = { assistant_id: assistant_id, id: id, }
141
+ @uri = "/Assistants/#{@solution[:assistant_id]}/Knowledge/#{@solution[:id]}"
173
142
 
174
143
 
175
144
  end
176
145
  ##
177
- # Delete the KeyInstance
178
- # @return [Boolean] True if delete succeeds, false otherwise
179
- def delete
146
+ # Create the AssistantsKnowledgeInstance
147
+ # @return [AssistantsKnowledgeInstance] Created AssistantsKnowledgeInstance
148
+ def create
180
149
 
181
150
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
182
151
 
183
- @version.delete('DELETE', @uri, headers: headers)
184
- end
185
-
186
- ##
187
- # Fetch the KeyInstance
188
- # @return [KeyInstance] Fetched KeyInstance
189
- def fetch
190
-
191
- headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
192
-
193
- payload = @version.fetch('GET', @uri, headers: headers)
194
- KeyInstance.new(
152
+ payload = @version.create('POST', @uri, headers: headers)
153
+ AssistantsKnowledgeInstance.new(
195
154
  @version,
196
155
  payload,
197
- fleet_sid: @solution[:fleet_sid],
198
- sid: @solution[:sid],
156
+ assistant_id: @solution[:assistant_id],
157
+ id: @solution[:id],
199
158
  )
200
159
  end
201
160
 
202
161
  ##
203
- # Update the KeyInstance
204
- # @param [String] friendly_name Provides a human readable descriptive text for this Key credential, up to 256 characters long.
205
- # @param [String] device_sid Provides the unique string identifier of an existing Device to become authenticated with this Key credential.
206
- # @return [KeyInstance] Updated KeyInstance
207
- def update(
208
- friendly_name: :unset,
209
- device_sid: :unset
210
- )
211
-
212
- data = Twilio::Values.of({
213
- 'FriendlyName' => friendly_name,
214
- 'DeviceSid' => device_sid,
215
- })
162
+ # Delete the AssistantsKnowledgeInstance
163
+ # @return [Boolean] True if delete succeeds, false otherwise
164
+ def delete
216
165
 
217
166
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
218
167
 
219
- payload = @version.update('POST', @uri, data: data, headers: headers)
220
- KeyInstance.new(
221
- @version,
222
- payload,
223
- fleet_sid: @solution[:fleet_sid],
224
- sid: @solution[:sid],
225
- )
168
+ @version.delete('DELETE', @uri, headers: headers)
226
169
  end
227
170
 
228
171
 
@@ -230,24 +173,24 @@ module Twilio
230
173
  # Provide a user friendly representation
231
174
  def to_s
232
175
  context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
233
- "#<Twilio.Preview.DeployedDevices.KeyContext #{context}>"
176
+ "#<Twilio.Assistants.V1.AssistantsKnowledgeContext #{context}>"
234
177
  end
235
178
 
236
179
  ##
237
180
  # Provide a detailed, user friendly representation
238
181
  def inspect
239
182
  context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
240
- "#<Twilio.Preview.DeployedDevices.KeyContext #{context}>"
183
+ "#<Twilio.Assistants.V1.AssistantsKnowledgeContext #{context}>"
241
184
  end
242
185
  end
243
186
 
244
- class KeyPage < Page
187
+ class AssistantsKnowledgePage < Page
245
188
  ##
246
- # Initialize the KeyPage
189
+ # Initialize the AssistantsKnowledgePage
247
190
  # @param [Version] version Version that contains the resource
248
191
  # @param [Response] response Response from the API
249
192
  # @param [Hash] solution Path solution for the resource
250
- # @return [KeyPage] KeyPage
193
+ # @return [AssistantsKnowledgePage] AssistantsKnowledgePage
251
194
  def initialize(version, response, solution)
252
195
  super(version, response)
253
196
 
@@ -256,159 +199,150 @@ module Twilio
256
199
  end
257
200
 
258
201
  ##
259
- # Build an instance of KeyInstance
202
+ # Build an instance of AssistantsKnowledgeInstance
260
203
  # @param [Hash] payload Payload response from the API
261
- # @return [KeyInstance] KeyInstance
204
+ # @return [AssistantsKnowledgeInstance] AssistantsKnowledgeInstance
262
205
  def get_instance(payload)
263
- KeyInstance.new(@version, payload, fleet_sid: @solution[:fleet_sid])
206
+ AssistantsKnowledgeInstance.new(@version, payload, assistant_id: @solution[:assistant_id])
264
207
  end
265
208
 
266
209
  ##
267
210
  # Provide a user friendly representation
268
211
  def to_s
269
- '<Twilio.Preview.DeployedDevices.KeyPage>'
212
+ '<Twilio.Assistants.V1.AssistantsKnowledgePage>'
270
213
  end
271
214
  end
272
- class KeyInstance < InstanceResource
215
+ class AssistantsKnowledgeInstance < InstanceResource
273
216
  ##
274
- # Initialize the KeyInstance
217
+ # Initialize the AssistantsKnowledgeInstance
275
218
  # @param [Version] version Version that contains the resource
276
219
  # @param [Hash] payload payload that contains response from Twilio
277
220
  # @param [String] account_sid The SID of the
278
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Key
221
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this AssistantsKnowledge
279
222
  # resource.
280
223
  # @param [String] sid The SID of the Call resource to fetch.
281
- # @return [KeyInstance] KeyInstance
282
- def initialize(version, payload , fleet_sid: nil, sid: nil)
224
+ # @return [AssistantsKnowledgeInstance] AssistantsKnowledgeInstance
225
+ def initialize(version, payload , assistant_id: nil, id: nil)
283
226
  super(version)
284
227
 
285
228
  # Marshaled Properties
286
229
  @properties = {
287
- 'sid' => payload['sid'],
288
- 'url' => payload['url'],
289
- 'friendly_name' => payload['friendly_name'],
290
- 'fleet_sid' => payload['fleet_sid'],
230
+ 'description' => payload['description'],
231
+ 'id' => payload['id'],
291
232
  'account_sid' => payload['account_sid'],
292
- 'device_sid' => payload['device_sid'],
293
- 'secret' => payload['secret'],
233
+ 'knowledge_source_details' => payload['knowledge_source_details'],
234
+ 'name' => payload['name'],
235
+ 'status' => payload['status'],
236
+ 'type' => payload['type'],
237
+ 'url' => payload['url'],
294
238
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
295
239
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
296
240
  }
297
241
 
298
242
  # Context
299
243
  @instance_context = nil
300
- @params = { 'fleet_sid' => fleet_sid || @properties['fleet_sid'] ,'sid' => sid || @properties['sid'] , }
244
+ @params = { 'assistant_id' => assistant_id || @properties['assistant_id'] ,'id' => id || @properties['id'] , }
301
245
  end
302
246
 
303
247
  ##
304
248
  # Generate an instance context for the instance, the context is capable of
305
249
  # performing various actions. All instance actions are proxied to the context
306
- # @return [KeyContext] CallContext for this CallInstance
250
+ # @return [AssistantsKnowledgeContext] CallContext for this CallInstance
307
251
  def context
308
252
  unless @instance_context
309
- @instance_context = KeyContext.new(@version , @params['fleet_sid'], @params['sid'])
253
+ @instance_context = AssistantsKnowledgeContext.new(@version , @params['assistant_id'], @params['id'])
310
254
  end
311
255
  @instance_context
312
256
  end
313
257
 
314
258
  ##
315
- # @return [String] Contains a 34 character string that uniquely identifies this Key credential resource.
316
- def sid
317
- @properties['sid']
259
+ # @return [String] The type of knowledge source.
260
+ def description
261
+ @properties['description']
318
262
  end
319
263
 
320
264
  ##
321
- # @return [String] Contains an absolute URL for this Key credential resource.
322
- def url
323
- @properties['url']
265
+ # @return [String] The description of knowledge.
266
+ def id
267
+ @properties['id']
268
+ end
269
+
270
+ ##
271
+ # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
272
+ def account_sid
273
+ @properties['account_sid']
324
274
  end
325
275
 
326
276
  ##
327
- # @return [String] Contains a human readable descriptive text for this Key credential, up to 256 characters long.
328
- def friendly_name
329
- @properties['friendly_name']
277
+ # @return [Hash] The details of the knowledge source based on the type.
278
+ def knowledge_source_details
279
+ @properties['knowledge_source_details']
330
280
  end
331
281
 
332
282
  ##
333
- # @return [String] Specifies the unique string identifier of the Fleet that the given Key credential belongs to.
334
- def fleet_sid
335
- @properties['fleet_sid']
283
+ # @return [String] The name of the knowledge source.
284
+ def name
285
+ @properties['name']
336
286
  end
337
287
 
338
288
  ##
339
- # @return [String] Specifies the unique string identifier of the Account responsible for this Key credential.
340
- def account_sid
341
- @properties['account_sid']
289
+ # @return [String] The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED')
290
+ def status
291
+ @properties['status']
342
292
  end
343
293
 
344
294
  ##
345
- # @return [String] Specifies the unique string identifier of a Device authenticated with this Key credential.
346
- def device_sid
347
- @properties['device_sid']
295
+ # @return [String] The type of knowledge source ('Web', 'Database', 'Text', 'File')
296
+ def type
297
+ @properties['type']
348
298
  end
349
299
 
350
300
  ##
351
- # @return [String] Contains the automatically generated secret belonging to this Key credential, used to authenticate the Device.
352
- def secret
353
- @properties['secret']
301
+ # @return [String] The url of the knowledge resource.
302
+ def url
303
+ @properties['url']
354
304
  end
355
305
 
356
306
  ##
357
- # @return [Time] Specifies the date this Key credential was created, given in UTC ISO 8601 format.
307
+ # @return [Time] The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
358
308
  def date_created
359
309
  @properties['date_created']
360
310
  end
361
311
 
362
312
  ##
363
- # @return [Time] Specifies the date this Key credential was last updated, given in UTC ISO 8601 format.
313
+ # @return [Time] The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
364
314
  def date_updated
365
315
  @properties['date_updated']
366
316
  end
367
317
 
368
318
  ##
369
- # Delete the KeyInstance
370
- # @return [Boolean] True if delete succeeds, false otherwise
371
- def delete
319
+ # Create the AssistantsKnowledgeInstance
320
+ # @return [AssistantsKnowledgeInstance] Created AssistantsKnowledgeInstance
321
+ def create
372
322
 
373
- context.delete
323
+ context.create
374
324
  end
375
325
 
376
326
  ##
377
- # Fetch the KeyInstance
378
- # @return [KeyInstance] Fetched KeyInstance
379
- def fetch
380
-
381
- context.fetch
382
- end
327
+ # Delete the AssistantsKnowledgeInstance
328
+ # @return [Boolean] True if delete succeeds, false otherwise
329
+ def delete
383
330
 
384
- ##
385
- # Update the KeyInstance
386
- # @param [String] friendly_name Provides a human readable descriptive text for this Key credential, up to 256 characters long.
387
- # @param [String] device_sid Provides the unique string identifier of an existing Device to become authenticated with this Key credential.
388
- # @return [KeyInstance] Updated KeyInstance
389
- def update(
390
- friendly_name: :unset,
391
- device_sid: :unset
392
- )
393
-
394
- context.update(
395
- friendly_name: friendly_name,
396
- device_sid: device_sid,
397
- )
331
+ context.delete
398
332
  end
399
333
 
400
334
  ##
401
335
  # Provide a user friendly representation
402
336
  def to_s
403
337
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
404
- "<Twilio.Preview.DeployedDevices.KeyInstance #{values}>"
338
+ "<Twilio.Assistants.V1.AssistantsKnowledgeInstance #{values}>"
405
339
  end
406
340
 
407
341
  ##
408
342
  # Provide a detailed, user friendly representation
409
343
  def inspect
410
344
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
411
- "<Twilio.Preview.DeployedDevices.KeyInstance #{values}>"
345
+ "<Twilio.Assistants.V1.AssistantsKnowledgeInstance #{values}>"
412
346
  end
413
347
  end
414
348