twilio-ruby 7.3.0 → 7.3.2
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.
- checksums.yaml +4 -4
- data/CHANGES.md +21 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/accounts/v1/bulk_consents.rb +133 -0
- data/lib/twilio-ruby/rest/accounts/v1/bulk_contacts.rb +133 -0
- data/lib/twilio-ruby/rest/accounts/v1.rb +12 -0
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb +355 -0
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb +362 -0
- data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +303 -0
- data/lib/twilio-ruby/rest/assistants/v1/assistant/message.rb +201 -0
- data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +668 -0
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb +229 -0
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb +209 -0
- data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +591 -0
- data/lib/twilio-ruby/rest/assistants/v1/policy.rb +264 -0
- data/lib/twilio-ruby/rest/assistants/v1/session/message.rb +264 -0
- data/lib/twilio-ruby/rest/assistants/v1/session.rb +328 -0
- data/lib/twilio-ruby/rest/assistants/v1/tool.rb +586 -0
- data/lib/twilio-ruby/rest/assistants/v1.rb +100 -0
- data/lib/twilio-ruby/rest/assistants.rb +6 -0
- data/lib/twilio-ruby/rest/assistants_base.rb +38 -0
- data/lib/twilio-ruby/rest/client.rb +5 -0
- data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +11 -11
- data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_usage.rb +11 -24
- data/lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb +28 -15
- data/lib/twilio-ruby/rest/numbers/v1/{porting_webhook_configuration_fetch.rb → webhook.rb} +20 -20
- data/lib/twilio-ruby/rest/numbers/v1.rb +6 -6
- data/lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb +2 -2
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +4 -1
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +20 -3
@@ -0,0 +1,586 @@
|
|
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 ToolList < ListResource
|
21
|
+
|
22
|
+
class AssistantsV1ServiceCreatePolicyRequest
|
23
|
+
# @param [description]: [String] The description of the policy.
|
24
|
+
# @param [id]: [String] The Policy ID.
|
25
|
+
# @param [name]: [String] The name of the policy.
|
26
|
+
# @param [policy_details]: [Hash]
|
27
|
+
# @param [type]: [String] The description of the policy.
|
28
|
+
attr_accessor :description, :id, :name, :policy_details, :type
|
29
|
+
def initialize(payload)
|
30
|
+
@description = payload["description"]
|
31
|
+
@id = payload["id"]
|
32
|
+
@name = payload["name"]
|
33
|
+
@policy_details = payload["policy_details"]
|
34
|
+
@type = payload["type"]
|
35
|
+
end
|
36
|
+
def to_json(options = {})
|
37
|
+
{
|
38
|
+
description: @description,
|
39
|
+
id: @id,
|
40
|
+
name: @name,
|
41
|
+
policy_details: @policy_details,
|
42
|
+
type: @type,
|
43
|
+
}.to_json(options)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
class AssistantsV1ServiceCreateToolRequest
|
48
|
+
# @param [assistant_id]: [String] The Assistant ID.
|
49
|
+
# @param [description]: [String] The description of the tool.
|
50
|
+
# @param [enabled]: [Boolean] True if the tool is enabled.
|
51
|
+
# @param [meta]: [Hash] The metadata related to method, url, input_schema to used with the Tool.
|
52
|
+
# @param [name]: [String] The name of the tool.
|
53
|
+
# @param [policy]: [ToolList.AssistantsV1ServiceCreatePolicyRequest]
|
54
|
+
# @param [type]: [String] The description of the tool.
|
55
|
+
attr_accessor :assistant_id, :description, :enabled, :meta, :name, :policy, :type
|
56
|
+
def initialize(payload)
|
57
|
+
@assistant_id = payload["assistant_id"]
|
58
|
+
@description = payload["description"]
|
59
|
+
@enabled = payload["enabled"]
|
60
|
+
@meta = payload["meta"]
|
61
|
+
@name = payload["name"]
|
62
|
+
@policy = payload["policy"]
|
63
|
+
@type = payload["type"]
|
64
|
+
end
|
65
|
+
def to_json(options = {})
|
66
|
+
{
|
67
|
+
assistant_id: @assistant_id,
|
68
|
+
description: @description,
|
69
|
+
enabled: @enabled,
|
70
|
+
meta: @meta,
|
71
|
+
name: @name,
|
72
|
+
policy: @policy,
|
73
|
+
type: @type,
|
74
|
+
}.to_json(options)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
class AssistantsV1ServiceUpdateToolRequest
|
79
|
+
# @param [assistant_id]: [String] The Assistant ID.
|
80
|
+
# @param [description]: [String] The description of the tool.
|
81
|
+
# @param [enabled]: [Boolean] True if the tool is enabled.
|
82
|
+
# @param [meta]: [Hash] The metadata related to method, url, input_schema to used with the Tool.
|
83
|
+
# @param [name]: [String] The name of the tool.
|
84
|
+
# @param [policy]: [ToolList.AssistantsV1ServiceCreatePolicyRequest]
|
85
|
+
# @param [type]: [String] The type of the tool.
|
86
|
+
attr_accessor :assistant_id, :description, :enabled, :meta, :name, :policy, :type
|
87
|
+
def initialize(payload)
|
88
|
+
@assistant_id = payload["assistant_id"]
|
89
|
+
@description = payload["description"]
|
90
|
+
@enabled = payload["enabled"]
|
91
|
+
@meta = payload["meta"]
|
92
|
+
@name = payload["name"]
|
93
|
+
@policy = payload["policy"]
|
94
|
+
@type = payload["type"]
|
95
|
+
end
|
96
|
+
def to_json(options = {})
|
97
|
+
{
|
98
|
+
assistant_id: @assistant_id,
|
99
|
+
description: @description,
|
100
|
+
enabled: @enabled,
|
101
|
+
meta: @meta,
|
102
|
+
name: @name,
|
103
|
+
policy: @policy,
|
104
|
+
type: @type,
|
105
|
+
}.to_json(options)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
class AssistantsV1ServiceCreatePolicyRequest
|
110
|
+
# @param [description]: [String] The description of the policy.
|
111
|
+
# @param [id]: [String] The Policy ID.
|
112
|
+
# @param [name]: [String] The name of the policy.
|
113
|
+
# @param [policy_details]: [Hash]
|
114
|
+
# @param [type]: [String] The description of the policy.
|
115
|
+
attr_accessor :description, :id, :name, :policy_details, :type
|
116
|
+
def initialize(payload)
|
117
|
+
@description = payload["description"]
|
118
|
+
@id = payload["id"]
|
119
|
+
@name = payload["name"]
|
120
|
+
@policy_details = payload["policy_details"]
|
121
|
+
@type = payload["type"]
|
122
|
+
end
|
123
|
+
def to_json(options = {})
|
124
|
+
{
|
125
|
+
description: @description,
|
126
|
+
id: @id,
|
127
|
+
name: @name,
|
128
|
+
policy_details: @policy_details,
|
129
|
+
type: @type,
|
130
|
+
}.to_json(options)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
class AssistantsV1ServiceCreateToolRequest
|
135
|
+
# @param [assistant_id]: [String] The Assistant ID.
|
136
|
+
# @param [description]: [String] The description of the tool.
|
137
|
+
# @param [enabled]: [Boolean] True if the tool is enabled.
|
138
|
+
# @param [meta]: [Hash] The metadata related to method, url, input_schema to used with the Tool.
|
139
|
+
# @param [name]: [String] The name of the tool.
|
140
|
+
# @param [policy]: [ToolList.AssistantsV1ServiceCreatePolicyRequest]
|
141
|
+
# @param [type]: [String] The description of the tool.
|
142
|
+
attr_accessor :assistant_id, :description, :enabled, :meta, :name, :policy, :type
|
143
|
+
def initialize(payload)
|
144
|
+
@assistant_id = payload["assistant_id"]
|
145
|
+
@description = payload["description"]
|
146
|
+
@enabled = payload["enabled"]
|
147
|
+
@meta = payload["meta"]
|
148
|
+
@name = payload["name"]
|
149
|
+
@policy = payload["policy"]
|
150
|
+
@type = payload["type"]
|
151
|
+
end
|
152
|
+
def to_json(options = {})
|
153
|
+
{
|
154
|
+
assistant_id: @assistant_id,
|
155
|
+
description: @description,
|
156
|
+
enabled: @enabled,
|
157
|
+
meta: @meta,
|
158
|
+
name: @name,
|
159
|
+
policy: @policy,
|
160
|
+
type: @type,
|
161
|
+
}.to_json(options)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
class AssistantsV1ServiceUpdateToolRequest
|
166
|
+
# @param [assistant_id]: [String] The Assistant ID.
|
167
|
+
# @param [description]: [String] The description of the tool.
|
168
|
+
# @param [enabled]: [Boolean] True if the tool is enabled.
|
169
|
+
# @param [meta]: [Hash] The metadata related to method, url, input_schema to used with the Tool.
|
170
|
+
# @param [name]: [String] The name of the tool.
|
171
|
+
# @param [policy]: [ToolList.AssistantsV1ServiceCreatePolicyRequest]
|
172
|
+
# @param [type]: [String] The type of the tool.
|
173
|
+
attr_accessor :assistant_id, :description, :enabled, :meta, :name, :policy, :type
|
174
|
+
def initialize(payload)
|
175
|
+
@assistant_id = payload["assistant_id"]
|
176
|
+
@description = payload["description"]
|
177
|
+
@enabled = payload["enabled"]
|
178
|
+
@meta = payload["meta"]
|
179
|
+
@name = payload["name"]
|
180
|
+
@policy = payload["policy"]
|
181
|
+
@type = payload["type"]
|
182
|
+
end
|
183
|
+
def to_json(options = {})
|
184
|
+
{
|
185
|
+
assistant_id: @assistant_id,
|
186
|
+
description: @description,
|
187
|
+
enabled: @enabled,
|
188
|
+
meta: @meta,
|
189
|
+
name: @name,
|
190
|
+
policy: @policy,
|
191
|
+
type: @type,
|
192
|
+
}.to_json(options)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
##
|
197
|
+
# Initialize the ToolList
|
198
|
+
# @param [Version] version Version that contains the resource
|
199
|
+
# @return [ToolList] ToolList
|
200
|
+
def initialize(version)
|
201
|
+
super(version)
|
202
|
+
# Path Solution
|
203
|
+
@solution = { }
|
204
|
+
@uri = "/Tools"
|
205
|
+
|
206
|
+
end
|
207
|
+
##
|
208
|
+
# Create the ToolInstance
|
209
|
+
# @param [AssistantsV1ServiceCreateToolRequest] assistants_v1_service_create_tool_request
|
210
|
+
# @return [ToolInstance] Created ToolInstance
|
211
|
+
def create(assistants_v1_service_create_tool_request: nil
|
212
|
+
)
|
213
|
+
|
214
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
215
|
+
headers['Content-Type'] = 'application/json'
|
216
|
+
payload = @version.create('POST', @uri, headers: headers, data: assistants_v1_service_create_tool_request.to_json)
|
217
|
+
ToolInstance.new(
|
218
|
+
@version,
|
219
|
+
payload,
|
220
|
+
)
|
221
|
+
end
|
222
|
+
|
223
|
+
|
224
|
+
##
|
225
|
+
# Lists ToolInstance records from the API as a list.
|
226
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
227
|
+
# memory before returning.
|
228
|
+
# @param [String] assistant_id
|
229
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
230
|
+
# guarantees to never return more than limit. Default is no limit
|
231
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
232
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
233
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
234
|
+
# efficient page size, i.e. min(limit, 1000)
|
235
|
+
# @return [Array] Array of up to limit results
|
236
|
+
def list(assistant_id: :unset, limit: nil, page_size: nil)
|
237
|
+
self.stream(
|
238
|
+
assistant_id: assistant_id,
|
239
|
+
limit: limit,
|
240
|
+
page_size: page_size
|
241
|
+
).entries
|
242
|
+
end
|
243
|
+
|
244
|
+
##
|
245
|
+
# Streams Instance records from the API as an Enumerable.
|
246
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
247
|
+
# is reached.
|
248
|
+
# @param [String] assistant_id
|
249
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
250
|
+
# guarantees to never return more than limit. Default is no limit
|
251
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
252
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
253
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
254
|
+
# efficient page size, i.e. min(limit, 1000)
|
255
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
256
|
+
def stream(assistant_id: :unset, limit: nil, page_size: nil)
|
257
|
+
limits = @version.read_limits(limit, page_size)
|
258
|
+
|
259
|
+
page = self.page(
|
260
|
+
assistant_id: assistant_id,
|
261
|
+
page_size: limits[:page_size], )
|
262
|
+
|
263
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
264
|
+
end
|
265
|
+
|
266
|
+
##
|
267
|
+
# When passed a block, yields ToolInstance records from the API.
|
268
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
269
|
+
# is reached.
|
270
|
+
def each
|
271
|
+
limits = @version.read_limits
|
272
|
+
|
273
|
+
page = self.page(page_size: limits[:page_size], )
|
274
|
+
|
275
|
+
@version.stream(page,
|
276
|
+
limit: limits[:limit],
|
277
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
278
|
+
end
|
279
|
+
|
280
|
+
##
|
281
|
+
# Retrieve a single page of ToolInstance records from the API.
|
282
|
+
# Request is executed immediately.
|
283
|
+
# @param [String] assistant_id
|
284
|
+
# @param [String] page_token PageToken provided by the API
|
285
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
286
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
287
|
+
# @return [Page] Page of ToolInstance
|
288
|
+
def page(assistant_id: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
289
|
+
params = Twilio::Values.of({
|
290
|
+
'AssistantId' => assistant_id,
|
291
|
+
'PageToken' => page_token,
|
292
|
+
'Page' => page_number,
|
293
|
+
'PageSize' => page_size,
|
294
|
+
})
|
295
|
+
|
296
|
+
response = @version.page('GET', @uri, params: params)
|
297
|
+
|
298
|
+
ToolPage.new(@version, response, @solution)
|
299
|
+
end
|
300
|
+
|
301
|
+
##
|
302
|
+
# Retrieve a single page of ToolInstance records from the API.
|
303
|
+
# Request is executed immediately.
|
304
|
+
# @param [String] target_url API-generated URL for the requested results page
|
305
|
+
# @return [Page] Page of ToolInstance
|
306
|
+
def get_page(target_url)
|
307
|
+
response = @version.domain.request(
|
308
|
+
'GET',
|
309
|
+
target_url
|
310
|
+
)
|
311
|
+
ToolPage.new(@version, response, @solution)
|
312
|
+
end
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
# Provide a user friendly representation
|
317
|
+
def to_s
|
318
|
+
'#<Twilio.Assistants.V1.ToolList>'
|
319
|
+
end
|
320
|
+
end
|
321
|
+
|
322
|
+
|
323
|
+
class ToolContext < InstanceContext
|
324
|
+
##
|
325
|
+
# Initialize the ToolContext
|
326
|
+
# @param [Version] version Version that contains the resource
|
327
|
+
# @param [String] id
|
328
|
+
# @return [ToolContext] ToolContext
|
329
|
+
def initialize(version, id)
|
330
|
+
super(version)
|
331
|
+
|
332
|
+
# Path Solution
|
333
|
+
@solution = { id: id, }
|
334
|
+
@uri = "/Tools/#{@solution[:id]}"
|
335
|
+
|
336
|
+
|
337
|
+
end
|
338
|
+
##
|
339
|
+
# Delete the ToolInstance
|
340
|
+
# @return [Boolean] True if delete succeeds, false otherwise
|
341
|
+
def delete
|
342
|
+
|
343
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
344
|
+
|
345
|
+
@version.delete('DELETE', @uri, headers: headers)
|
346
|
+
end
|
347
|
+
|
348
|
+
##
|
349
|
+
# Fetch the ToolInstance
|
350
|
+
# @return [ToolInstance] Fetched ToolInstance
|
351
|
+
def fetch
|
352
|
+
|
353
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
354
|
+
|
355
|
+
payload = @version.fetch('GET', @uri, headers: headers)
|
356
|
+
ToolInstance.new(
|
357
|
+
@version,
|
358
|
+
payload,
|
359
|
+
id: @solution[:id],
|
360
|
+
)
|
361
|
+
end
|
362
|
+
|
363
|
+
##
|
364
|
+
# Update the ToolInstance
|
365
|
+
# @param [AssistantsV1ServiceUpdateToolRequest] assistants_v1_service_update_tool_request
|
366
|
+
# @return [ToolInstance] Updated ToolInstance
|
367
|
+
def update(assistants_v1_service_update_tool_request: :unset
|
368
|
+
)
|
369
|
+
|
370
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
371
|
+
headers['Content-Type'] = 'application/json'
|
372
|
+
payload = @version.update('PUT', @uri, headers: headers, data: assistants_v1_service_update_tool_request.to_json)
|
373
|
+
ToolInstance.new(
|
374
|
+
@version,
|
375
|
+
payload,
|
376
|
+
id: @solution[:id],
|
377
|
+
)
|
378
|
+
end
|
379
|
+
|
380
|
+
|
381
|
+
##
|
382
|
+
# Provide a user friendly representation
|
383
|
+
def to_s
|
384
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
385
|
+
"#<Twilio.Assistants.V1.ToolContext #{context}>"
|
386
|
+
end
|
387
|
+
|
388
|
+
##
|
389
|
+
# Provide a detailed, user friendly representation
|
390
|
+
def inspect
|
391
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
392
|
+
"#<Twilio.Assistants.V1.ToolContext #{context}>"
|
393
|
+
end
|
394
|
+
end
|
395
|
+
|
396
|
+
class ToolPage < Page
|
397
|
+
##
|
398
|
+
# Initialize the ToolPage
|
399
|
+
# @param [Version] version Version that contains the resource
|
400
|
+
# @param [Response] response Response from the API
|
401
|
+
# @param [Hash] solution Path solution for the resource
|
402
|
+
# @return [ToolPage] ToolPage
|
403
|
+
def initialize(version, response, solution)
|
404
|
+
super(version, response)
|
405
|
+
|
406
|
+
# Path Solution
|
407
|
+
@solution = solution
|
408
|
+
end
|
409
|
+
|
410
|
+
##
|
411
|
+
# Build an instance of ToolInstance
|
412
|
+
# @param [Hash] payload Payload response from the API
|
413
|
+
# @return [ToolInstance] ToolInstance
|
414
|
+
def get_instance(payload)
|
415
|
+
ToolInstance.new(@version, payload)
|
416
|
+
end
|
417
|
+
|
418
|
+
##
|
419
|
+
# Provide a user friendly representation
|
420
|
+
def to_s
|
421
|
+
'<Twilio.Assistants.V1.ToolPage>'
|
422
|
+
end
|
423
|
+
end
|
424
|
+
class ToolInstance < InstanceResource
|
425
|
+
##
|
426
|
+
# Initialize the ToolInstance
|
427
|
+
# @param [Version] version Version that contains the resource
|
428
|
+
# @param [Hash] payload payload that contains response from Twilio
|
429
|
+
# @param [String] account_sid The SID of the
|
430
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this Tool
|
431
|
+
# resource.
|
432
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
433
|
+
# @return [ToolInstance] ToolInstance
|
434
|
+
def initialize(version, payload , id: nil)
|
435
|
+
super(version)
|
436
|
+
|
437
|
+
# Marshaled Properties
|
438
|
+
@properties = {
|
439
|
+
'account_sid' => payload['account_sid'],
|
440
|
+
'description' => payload['description'],
|
441
|
+
'enabled' => payload['enabled'],
|
442
|
+
'id' => payload['id'],
|
443
|
+
'meta' => payload['meta'],
|
444
|
+
'name' => payload['name'],
|
445
|
+
'requires_auth' => payload['requires_auth'],
|
446
|
+
'type' => payload['type'],
|
447
|
+
'url' => payload['url'],
|
448
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
449
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
450
|
+
'policies' => payload['policies'],
|
451
|
+
}
|
452
|
+
|
453
|
+
# Context
|
454
|
+
@instance_context = nil
|
455
|
+
@params = { 'id' => id || @properties['id'] , }
|
456
|
+
end
|
457
|
+
|
458
|
+
##
|
459
|
+
# Generate an instance context for the instance, the context is capable of
|
460
|
+
# performing various actions. All instance actions are proxied to the context
|
461
|
+
# @return [ToolContext] CallContext for this CallInstance
|
462
|
+
def context
|
463
|
+
unless @instance_context
|
464
|
+
@instance_context = ToolContext.new(@version , @params['id'])
|
465
|
+
end
|
466
|
+
@instance_context
|
467
|
+
end
|
468
|
+
|
469
|
+
##
|
470
|
+
# @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Tool resource.
|
471
|
+
def account_sid
|
472
|
+
@properties['account_sid']
|
473
|
+
end
|
474
|
+
|
475
|
+
##
|
476
|
+
# @return [String] The description of the tool.
|
477
|
+
def description
|
478
|
+
@properties['description']
|
479
|
+
end
|
480
|
+
|
481
|
+
##
|
482
|
+
# @return [Boolean] True if the tool is enabled.
|
483
|
+
def enabled
|
484
|
+
@properties['enabled']
|
485
|
+
end
|
486
|
+
|
487
|
+
##
|
488
|
+
# @return [String] The tool ID.
|
489
|
+
def id
|
490
|
+
@properties['id']
|
491
|
+
end
|
492
|
+
|
493
|
+
##
|
494
|
+
# @return [Hash] The metadata related to method, url, input_schema to used with the Tool.
|
495
|
+
def meta
|
496
|
+
@properties['meta']
|
497
|
+
end
|
498
|
+
|
499
|
+
##
|
500
|
+
# @return [String] The name of the tool.
|
501
|
+
def name
|
502
|
+
@properties['name']
|
503
|
+
end
|
504
|
+
|
505
|
+
##
|
506
|
+
# @return [Boolean] The authentication requirement for the tool.
|
507
|
+
def requires_auth
|
508
|
+
@properties['requires_auth']
|
509
|
+
end
|
510
|
+
|
511
|
+
##
|
512
|
+
# @return [String] The type of the tool. ('WEBHOOK')
|
513
|
+
def type
|
514
|
+
@properties['type']
|
515
|
+
end
|
516
|
+
|
517
|
+
##
|
518
|
+
# @return [String] The url of the tool resource.
|
519
|
+
def url
|
520
|
+
@properties['url']
|
521
|
+
end
|
522
|
+
|
523
|
+
##
|
524
|
+
# @return [Time] The date and time in GMT when the Tool was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
525
|
+
def date_created
|
526
|
+
@properties['date_created']
|
527
|
+
end
|
528
|
+
|
529
|
+
##
|
530
|
+
# @return [Time] The date and time in GMT when the Tool was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
531
|
+
def date_updated
|
532
|
+
@properties['date_updated']
|
533
|
+
end
|
534
|
+
|
535
|
+
##
|
536
|
+
# @return [Array<AssistantsV1ServicePolicy>] The Policies associated with the tool.
|
537
|
+
def policies
|
538
|
+
@properties['policies']
|
539
|
+
end
|
540
|
+
|
541
|
+
##
|
542
|
+
# Delete the ToolInstance
|
543
|
+
# @return [Boolean] True if delete succeeds, false otherwise
|
544
|
+
def delete
|
545
|
+
|
546
|
+
context.delete
|
547
|
+
end
|
548
|
+
|
549
|
+
##
|
550
|
+
# Fetch the ToolInstance
|
551
|
+
# @return [ToolInstance] Fetched ToolInstance
|
552
|
+
def fetch
|
553
|
+
|
554
|
+
context.fetch
|
555
|
+
end
|
556
|
+
|
557
|
+
##
|
558
|
+
# Update the ToolInstance
|
559
|
+
# @param [AssistantsV1ServiceUpdateToolRequest] assistants_v1_service_update_tool_request
|
560
|
+
# @return [ToolInstance] Updated ToolInstance
|
561
|
+
def update(assistants_v1_service_update_tool_request: :unset
|
562
|
+
)
|
563
|
+
|
564
|
+
context.update(
|
565
|
+
)
|
566
|
+
end
|
567
|
+
|
568
|
+
##
|
569
|
+
# Provide a user friendly representation
|
570
|
+
def to_s
|
571
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
572
|
+
"<Twilio.Assistants.V1.ToolInstance #{values}>"
|
573
|
+
end
|
574
|
+
|
575
|
+
##
|
576
|
+
# Provide a detailed, user friendly representation
|
577
|
+
def inspect
|
578
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
579
|
+
"<Twilio.Assistants.V1.ToolInstance #{values}>"
|
580
|
+
end
|
581
|
+
end
|
582
|
+
|
583
|
+
end
|
584
|
+
end
|
585
|
+
end
|
586
|
+
end
|
@@ -0,0 +1,100 @@
|
|
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
|
+
module Twilio
|
16
|
+
module REST
|
17
|
+
class Assistants
|
18
|
+
class V1 < Version
|
19
|
+
##
|
20
|
+
# Initialize the V1 version of Assistants
|
21
|
+
def initialize(domain)
|
22
|
+
super
|
23
|
+
@version = 'v1'
|
24
|
+
@assistants = nil
|
25
|
+
@knowledge = nil
|
26
|
+
@policies = nil
|
27
|
+
@sessions = nil
|
28
|
+
@tools = nil
|
29
|
+
end
|
30
|
+
|
31
|
+
##
|
32
|
+
# @param [String] id
|
33
|
+
# @return [Twilio::REST::Assistants::V1::AssistantContext] if id was passed.
|
34
|
+
# @return [Twilio::REST::Assistants::V1::AssistantList]
|
35
|
+
def assistants(id=:unset)
|
36
|
+
if id.nil?
|
37
|
+
raise ArgumentError, 'id cannot be nil'
|
38
|
+
end
|
39
|
+
if id == :unset
|
40
|
+
@assistants ||= AssistantList.new self
|
41
|
+
else
|
42
|
+
AssistantContext.new(self, id)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
##
|
46
|
+
# @param [String] id
|
47
|
+
# @return [Twilio::REST::Assistants::V1::KnowledgeContext] if id was passed.
|
48
|
+
# @return [Twilio::REST::Assistants::V1::KnowledgeList]
|
49
|
+
def knowledge(id=:unset)
|
50
|
+
if id.nil?
|
51
|
+
raise ArgumentError, 'id cannot be nil'
|
52
|
+
end
|
53
|
+
if id == :unset
|
54
|
+
@knowledge ||= KnowledgeList.new self
|
55
|
+
else
|
56
|
+
KnowledgeContext.new(self, id)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
##
|
60
|
+
# @return [Twilio::REST::Assistants::V1::PolicyList]
|
61
|
+
def policies
|
62
|
+
@policies ||= PolicyList.new self
|
63
|
+
end
|
64
|
+
##
|
65
|
+
# @param [String] id
|
66
|
+
# @return [Twilio::REST::Assistants::V1::SessionContext] if id was passed.
|
67
|
+
# @return [Twilio::REST::Assistants::V1::SessionList]
|
68
|
+
def sessions(id=:unset)
|
69
|
+
if id.nil?
|
70
|
+
raise ArgumentError, 'id cannot be nil'
|
71
|
+
end
|
72
|
+
if id == :unset
|
73
|
+
@sessions ||= SessionList.new self
|
74
|
+
else
|
75
|
+
SessionContext.new(self, id)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
##
|
79
|
+
# @param [String] id
|
80
|
+
# @return [Twilio::REST::Assistants::V1::ToolContext] if id was passed.
|
81
|
+
# @return [Twilio::REST::Assistants::V1::ToolList]
|
82
|
+
def tools(id=:unset)
|
83
|
+
if id.nil?
|
84
|
+
raise ArgumentError, 'id cannot be nil'
|
85
|
+
end
|
86
|
+
if id == :unset
|
87
|
+
@tools ||= ToolList.new self
|
88
|
+
else
|
89
|
+
ToolContext.new(self, id)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
##
|
93
|
+
# Provide a user friendly representation
|
94
|
+
def to_s
|
95
|
+
'<Twilio::REST::Assistants::V1>';
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|