twilio-ruby 6.9.0 → 6.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +12 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/http/http_client.rb +3 -2
- data/lib/twilio-ruby/rest/client.rb +0 -5
- data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +27 -27
- data/lib/twilio-ruby/rest/preview/sync/service.rb +27 -27
- data/lib/twilio-ruby/rest/preview.rb +1 -11
- data/lib/twilio-ruby/rest/preview_base.rb +0 -5
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +2 -35
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb +0 -241
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb +0 -217
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +0 -389
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb +0 -435
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb +0 -409
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +0 -473
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb +0 -241
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb +0 -373
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +0 -436
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb +0 -253
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +0 -226
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb +0 -525
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb +0 -433
- data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +0 -683
- data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +0 -207
- data/lib/twilio-ruby/rest/autopilot/v1.rb +0 -55
- data/lib/twilio-ruby/rest/autopilot.rb +0 -22
- data/lib/twilio-ruby/rest/autopilot_base.rb +0 -38
- data/lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb +0 -241
- data/lib/twilio-ruby/rest/preview/understand/assistant/assistant_initiation_actions.rb +0 -241
- data/lib/twilio-ruby/rest/preview/understand/assistant/dialogue.rb +0 -217
- data/lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb +0 -389
- data/lib/twilio-ruby/rest/preview/understand/assistant/field_type.rb +0 -435
- data/lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb +0 -409
- data/lib/twilio-ruby/rest/preview/understand/assistant/query.rb +0 -463
- data/lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb +0 -241
- data/lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb +0 -373
- data/lib/twilio-ruby/rest/preview/understand/assistant/task/sample.rb +0 -436
- data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_actions.rb +0 -253
- data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +0 -226
- data/lib/twilio-ruby/rest/preview/understand/assistant/task.rb +0 -525
- data/lib/twilio-ruby/rest/preview/understand/assistant.rb +0 -663
- data/lib/twilio-ruby/rest/preview/understand.rb +0 -49
@@ -1,663 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# This code was generated by
|
3
|
-
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
-
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
-
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
-
#
|
7
|
-
# Twilio - Preview
|
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 Preview < PreviewBase
|
19
|
-
class Understand < Version
|
20
|
-
class AssistantList < ListResource
|
21
|
-
##
|
22
|
-
# Initialize the AssistantList
|
23
|
-
# @param [Version] version Version that contains the resource
|
24
|
-
# @return [AssistantList] AssistantList
|
25
|
-
def initialize(version)
|
26
|
-
super(version)
|
27
|
-
# Path Solution
|
28
|
-
@solution = { }
|
29
|
-
@uri = "/Assistants"
|
30
|
-
|
31
|
-
end
|
32
|
-
##
|
33
|
-
# Create the AssistantInstance
|
34
|
-
# @param [String] friendly_name A text description for the Assistant. It is non-unique and can up to 255 characters long.
|
35
|
-
# @param [Boolean] log_queries A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided.
|
36
|
-
# @param [String] unique_name A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long.
|
37
|
-
# @param [String] callback_url A user-provided URL to send event callbacks to.
|
38
|
-
# @param [String] callback_events Space-separated list of callback events that will trigger callbacks.
|
39
|
-
# @param [Object] fallback_actions The JSON actions to be executed when the user's input is not recognized as matching any Task.
|
40
|
-
# @param [Object] initiation_actions The JSON actions to be executed on inbound phone calls when the Assistant has to say something first.
|
41
|
-
# @param [Object] style_sheet The JSON object that holds the style sheet for the assistant
|
42
|
-
# @return [AssistantInstance] Created AssistantInstance
|
43
|
-
def create(
|
44
|
-
friendly_name: :unset,
|
45
|
-
log_queries: :unset,
|
46
|
-
unique_name: :unset,
|
47
|
-
callback_url: :unset,
|
48
|
-
callback_events: :unset,
|
49
|
-
fallback_actions: :unset,
|
50
|
-
initiation_actions: :unset,
|
51
|
-
style_sheet: :unset
|
52
|
-
)
|
53
|
-
|
54
|
-
data = Twilio::Values.of({
|
55
|
-
'FriendlyName' => friendly_name,
|
56
|
-
'LogQueries' => log_queries,
|
57
|
-
'UniqueName' => unique_name,
|
58
|
-
'CallbackUrl' => callback_url,
|
59
|
-
'CallbackEvents' => callback_events,
|
60
|
-
'FallbackActions' => Twilio.serialize_object(fallback_actions),
|
61
|
-
'InitiationActions' => Twilio.serialize_object(initiation_actions),
|
62
|
-
'StyleSheet' => Twilio.serialize_object(style_sheet),
|
63
|
-
})
|
64
|
-
|
65
|
-
payload = @version.create('POST', @uri, data: data)
|
66
|
-
AssistantInstance.new(
|
67
|
-
@version,
|
68
|
-
payload,
|
69
|
-
)
|
70
|
-
end
|
71
|
-
|
72
|
-
|
73
|
-
##
|
74
|
-
# Lists AssistantInstance records from the API as a list.
|
75
|
-
# Unlike stream(), this operation is eager and will load `limit` records into
|
76
|
-
# memory before returning.
|
77
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
78
|
-
# guarantees to never return more than limit. Default is no limit
|
79
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
80
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
81
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
82
|
-
# efficient page size, i.e. min(limit, 1000)
|
83
|
-
# @return [Array] Array of up to limit results
|
84
|
-
def list(limit: nil, page_size: nil)
|
85
|
-
self.stream(
|
86
|
-
limit: limit,
|
87
|
-
page_size: page_size
|
88
|
-
).entries
|
89
|
-
end
|
90
|
-
|
91
|
-
##
|
92
|
-
# Streams Instance records from the API as an Enumerable.
|
93
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
94
|
-
# is reached.
|
95
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
96
|
-
# guarantees to never return more than limit. Default is no limit
|
97
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
98
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
99
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
100
|
-
# efficient page size, i.e. min(limit, 1000)
|
101
|
-
# @return [Enumerable] Enumerable that will yield up to limit results
|
102
|
-
def stream(limit: nil, page_size: nil)
|
103
|
-
limits = @version.read_limits(limit, page_size)
|
104
|
-
|
105
|
-
page = self.page(
|
106
|
-
page_size: limits[:page_size], )
|
107
|
-
|
108
|
-
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
109
|
-
end
|
110
|
-
|
111
|
-
##
|
112
|
-
# When passed a block, yields AssistantInstance records from the API.
|
113
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
114
|
-
# is reached.
|
115
|
-
def each
|
116
|
-
limits = @version.read_limits
|
117
|
-
|
118
|
-
page = self.page(page_size: limits[:page_size], )
|
119
|
-
|
120
|
-
@version.stream(page,
|
121
|
-
limit: limits[:limit],
|
122
|
-
page_limit: limits[:page_limit]).each {|x| yield x}
|
123
|
-
end
|
124
|
-
|
125
|
-
##
|
126
|
-
# Retrieve a single page of AssistantInstance records from the API.
|
127
|
-
# Request is executed immediately.
|
128
|
-
# @param [String] page_token PageToken provided by the API
|
129
|
-
# @param [Integer] page_number Page Number, this value is simply for client state
|
130
|
-
# @param [Integer] page_size Number of records to return, defaults to 50
|
131
|
-
# @return [Page] Page of AssistantInstance
|
132
|
-
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
133
|
-
params = Twilio::Values.of({
|
134
|
-
'PageToken' => page_token,
|
135
|
-
'Page' => page_number,
|
136
|
-
'PageSize' => page_size,
|
137
|
-
})
|
138
|
-
|
139
|
-
response = @version.page('GET', @uri, params: params)
|
140
|
-
|
141
|
-
AssistantPage.new(@version, response, @solution)
|
142
|
-
end
|
143
|
-
|
144
|
-
##
|
145
|
-
# Retrieve a single page of AssistantInstance records from the API.
|
146
|
-
# Request is executed immediately.
|
147
|
-
# @param [String] target_url API-generated URL for the requested results page
|
148
|
-
# @return [Page] Page of AssistantInstance
|
149
|
-
def get_page(target_url)
|
150
|
-
response = @version.domain.request(
|
151
|
-
'GET',
|
152
|
-
target_url
|
153
|
-
)
|
154
|
-
AssistantPage.new(@version, response, @solution)
|
155
|
-
end
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
# Provide a user friendly representation
|
160
|
-
def to_s
|
161
|
-
'#<Twilio.Preview.Understand.AssistantList>'
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
|
166
|
-
##
|
167
|
-
#PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
168
|
-
class AssistantContext < InstanceContext
|
169
|
-
##
|
170
|
-
# Initialize the AssistantContext
|
171
|
-
# @param [Version] version Version that contains the resource
|
172
|
-
# @param [String] sid A 34 character string that uniquely identifies this resource.
|
173
|
-
# @return [AssistantContext] AssistantContext
|
174
|
-
def initialize(version, sid)
|
175
|
-
super(version)
|
176
|
-
|
177
|
-
# Path Solution
|
178
|
-
@solution = { sid: sid, }
|
179
|
-
@uri = "/Assistants/#{@solution[:sid]}"
|
180
|
-
|
181
|
-
# Dependents
|
182
|
-
@field_types = nil
|
183
|
-
@assistant_fallback_actions = nil
|
184
|
-
@tasks = nil
|
185
|
-
@dialogues = nil
|
186
|
-
@assistant_initiation_actions = nil
|
187
|
-
@model_builds = nil
|
188
|
-
@style_sheet = nil
|
189
|
-
@queries = nil
|
190
|
-
end
|
191
|
-
##
|
192
|
-
# Delete the AssistantInstance
|
193
|
-
# @return [Boolean] True if delete succeeds, false otherwise
|
194
|
-
def delete
|
195
|
-
|
196
|
-
@version.delete('DELETE', @uri)
|
197
|
-
end
|
198
|
-
|
199
|
-
##
|
200
|
-
# Fetch the AssistantInstance
|
201
|
-
# @return [AssistantInstance] Fetched AssistantInstance
|
202
|
-
def fetch
|
203
|
-
|
204
|
-
payload = @version.fetch('GET', @uri)
|
205
|
-
AssistantInstance.new(
|
206
|
-
@version,
|
207
|
-
payload,
|
208
|
-
sid: @solution[:sid],
|
209
|
-
)
|
210
|
-
end
|
211
|
-
|
212
|
-
##
|
213
|
-
# Update the AssistantInstance
|
214
|
-
# @param [String] friendly_name A text description for the Assistant. It is non-unique and can up to 255 characters long.
|
215
|
-
# @param [Boolean] log_queries A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided.
|
216
|
-
# @param [String] unique_name A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long.
|
217
|
-
# @param [String] callback_url A user-provided URL to send event callbacks to.
|
218
|
-
# @param [String] callback_events Space-separated list of callback events that will trigger callbacks.
|
219
|
-
# @param [Object] fallback_actions The JSON actions to be executed when the user's input is not recognized as matching any Task.
|
220
|
-
# @param [Object] initiation_actions The JSON actions to be executed on inbound phone calls when the Assistant has to say something first.
|
221
|
-
# @param [Object] style_sheet The JSON object that holds the style sheet for the assistant
|
222
|
-
# @return [AssistantInstance] Updated AssistantInstance
|
223
|
-
def update(
|
224
|
-
friendly_name: :unset,
|
225
|
-
log_queries: :unset,
|
226
|
-
unique_name: :unset,
|
227
|
-
callback_url: :unset,
|
228
|
-
callback_events: :unset,
|
229
|
-
fallback_actions: :unset,
|
230
|
-
initiation_actions: :unset,
|
231
|
-
style_sheet: :unset
|
232
|
-
)
|
233
|
-
|
234
|
-
data = Twilio::Values.of({
|
235
|
-
'FriendlyName' => friendly_name,
|
236
|
-
'LogQueries' => log_queries,
|
237
|
-
'UniqueName' => unique_name,
|
238
|
-
'CallbackUrl' => callback_url,
|
239
|
-
'CallbackEvents' => callback_events,
|
240
|
-
'FallbackActions' => Twilio.serialize_object(fallback_actions),
|
241
|
-
'InitiationActions' => Twilio.serialize_object(initiation_actions),
|
242
|
-
'StyleSheet' => Twilio.serialize_object(style_sheet),
|
243
|
-
})
|
244
|
-
|
245
|
-
payload = @version.update('POST', @uri, data: data)
|
246
|
-
AssistantInstance.new(
|
247
|
-
@version,
|
248
|
-
payload,
|
249
|
-
sid: @solution[:sid],
|
250
|
-
)
|
251
|
-
end
|
252
|
-
|
253
|
-
##
|
254
|
-
# Access the field_types
|
255
|
-
# @return [FieldTypeList]
|
256
|
-
# @return [FieldTypeContext] if sid was passed.
|
257
|
-
def field_types(sid=:unset)
|
258
|
-
|
259
|
-
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
260
|
-
|
261
|
-
if sid != :unset
|
262
|
-
return FieldTypeContext.new(@version, @solution[:sid],sid )
|
263
|
-
end
|
264
|
-
|
265
|
-
unless @field_types
|
266
|
-
@field_types = FieldTypeList.new(
|
267
|
-
@version, assistant_sid: @solution[:sid], )
|
268
|
-
end
|
269
|
-
|
270
|
-
@field_types
|
271
|
-
end
|
272
|
-
##
|
273
|
-
# Access the assistant_fallback_actions
|
274
|
-
# @return [AssistantFallbackActionsList]
|
275
|
-
# @return [AssistantFallbackActionsContext]
|
276
|
-
def assistant_fallback_actions
|
277
|
-
AssistantFallbackActionsContext.new(
|
278
|
-
@version,
|
279
|
-
@solution[:sid]
|
280
|
-
)
|
281
|
-
end
|
282
|
-
##
|
283
|
-
# Access the tasks
|
284
|
-
# @return [TaskList]
|
285
|
-
# @return [TaskContext] if sid was passed.
|
286
|
-
def tasks(sid=:unset)
|
287
|
-
|
288
|
-
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
289
|
-
|
290
|
-
if sid != :unset
|
291
|
-
return TaskContext.new(@version, @solution[:sid],sid )
|
292
|
-
end
|
293
|
-
|
294
|
-
unless @tasks
|
295
|
-
@tasks = TaskList.new(
|
296
|
-
@version, assistant_sid: @solution[:sid], )
|
297
|
-
end
|
298
|
-
|
299
|
-
@tasks
|
300
|
-
end
|
301
|
-
##
|
302
|
-
# Access the dialogues
|
303
|
-
# @return [DialogueList]
|
304
|
-
# @return [DialogueContext] if sid was passed.
|
305
|
-
def dialogues(sid=:unset)
|
306
|
-
|
307
|
-
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
308
|
-
|
309
|
-
if sid != :unset
|
310
|
-
return DialogueContext.new(@version, @solution[:sid],sid )
|
311
|
-
end
|
312
|
-
|
313
|
-
unless @dialogues
|
314
|
-
@dialogues = DialogueList.new(
|
315
|
-
@version, assistant_sid: @solution[:sid], )
|
316
|
-
end
|
317
|
-
|
318
|
-
@dialogues
|
319
|
-
end
|
320
|
-
##
|
321
|
-
# Access the assistant_initiation_actions
|
322
|
-
# @return [AssistantInitiationActionsList]
|
323
|
-
# @return [AssistantInitiationActionsContext]
|
324
|
-
def assistant_initiation_actions
|
325
|
-
AssistantInitiationActionsContext.new(
|
326
|
-
@version,
|
327
|
-
@solution[:sid]
|
328
|
-
)
|
329
|
-
end
|
330
|
-
##
|
331
|
-
# Access the model_builds
|
332
|
-
# @return [ModelBuildList]
|
333
|
-
# @return [ModelBuildContext] if sid was passed.
|
334
|
-
def model_builds(sid=:unset)
|
335
|
-
|
336
|
-
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
337
|
-
|
338
|
-
if sid != :unset
|
339
|
-
return ModelBuildContext.new(@version, @solution[:sid],sid )
|
340
|
-
end
|
341
|
-
|
342
|
-
unless @model_builds
|
343
|
-
@model_builds = ModelBuildList.new(
|
344
|
-
@version, assistant_sid: @solution[:sid], )
|
345
|
-
end
|
346
|
-
|
347
|
-
@model_builds
|
348
|
-
end
|
349
|
-
##
|
350
|
-
# Access the style_sheet
|
351
|
-
# @return [StyleSheetList]
|
352
|
-
# @return [StyleSheetContext]
|
353
|
-
def style_sheet
|
354
|
-
StyleSheetContext.new(
|
355
|
-
@version,
|
356
|
-
@solution[:sid]
|
357
|
-
)
|
358
|
-
end
|
359
|
-
##
|
360
|
-
# Access the queries
|
361
|
-
# @return [QueryList]
|
362
|
-
# @return [QueryContext] if sid was passed.
|
363
|
-
def queries(sid=:unset)
|
364
|
-
|
365
|
-
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
366
|
-
|
367
|
-
if sid != :unset
|
368
|
-
return QueryContext.new(@version, @solution[:sid],sid )
|
369
|
-
end
|
370
|
-
|
371
|
-
unless @queries
|
372
|
-
@queries = QueryList.new(
|
373
|
-
@version, assistant_sid: @solution[:sid], )
|
374
|
-
end
|
375
|
-
|
376
|
-
@queries
|
377
|
-
end
|
378
|
-
|
379
|
-
##
|
380
|
-
# Provide a user friendly representation
|
381
|
-
def to_s
|
382
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
383
|
-
"#<Twilio.Preview.Understand.AssistantContext #{context}>"
|
384
|
-
end
|
385
|
-
|
386
|
-
##
|
387
|
-
# Provide a detailed, user friendly representation
|
388
|
-
def inspect
|
389
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
390
|
-
"#<Twilio.Preview.Understand.AssistantContext #{context}>"
|
391
|
-
end
|
392
|
-
end
|
393
|
-
|
394
|
-
class AssistantPage < Page
|
395
|
-
##
|
396
|
-
# Initialize the AssistantPage
|
397
|
-
# @param [Version] version Version that contains the resource
|
398
|
-
# @param [Response] response Response from the API
|
399
|
-
# @param [Hash] solution Path solution for the resource
|
400
|
-
# @return [AssistantPage] AssistantPage
|
401
|
-
def initialize(version, response, solution)
|
402
|
-
super(version, response)
|
403
|
-
|
404
|
-
# Path Solution
|
405
|
-
@solution = solution
|
406
|
-
end
|
407
|
-
|
408
|
-
##
|
409
|
-
# Build an instance of AssistantInstance
|
410
|
-
# @param [Hash] payload Payload response from the API
|
411
|
-
# @return [AssistantInstance] AssistantInstance
|
412
|
-
def get_instance(payload)
|
413
|
-
AssistantInstance.new(@version, payload)
|
414
|
-
end
|
415
|
-
|
416
|
-
##
|
417
|
-
# Provide a user friendly representation
|
418
|
-
def to_s
|
419
|
-
'<Twilio.Preview.Understand.AssistantPage>'
|
420
|
-
end
|
421
|
-
end
|
422
|
-
class AssistantInstance < InstanceResource
|
423
|
-
##
|
424
|
-
# Initialize the AssistantInstance
|
425
|
-
# @param [Version] version Version that contains the resource
|
426
|
-
# @param [Hash] payload payload that contains response from Twilio
|
427
|
-
# @param [String] account_sid The SID of the
|
428
|
-
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this Assistant
|
429
|
-
# resource.
|
430
|
-
# @param [String] sid The SID of the Call resource to fetch.
|
431
|
-
# @return [AssistantInstance] AssistantInstance
|
432
|
-
def initialize(version, payload , sid: nil)
|
433
|
-
super(version)
|
434
|
-
|
435
|
-
# Marshaled Properties
|
436
|
-
@properties = {
|
437
|
-
'account_sid' => payload['account_sid'],
|
438
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
439
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
440
|
-
'friendly_name' => payload['friendly_name'],
|
441
|
-
'latest_model_build_sid' => payload['latest_model_build_sid'],
|
442
|
-
'links' => payload['links'],
|
443
|
-
'log_queries' => payload['log_queries'],
|
444
|
-
'sid' => payload['sid'],
|
445
|
-
'unique_name' => payload['unique_name'],
|
446
|
-
'url' => payload['url'],
|
447
|
-
'callback_url' => payload['callback_url'],
|
448
|
-
'callback_events' => payload['callback_events'],
|
449
|
-
}
|
450
|
-
|
451
|
-
# Context
|
452
|
-
@instance_context = nil
|
453
|
-
@params = { 'sid' => sid || @properties['sid'] , }
|
454
|
-
end
|
455
|
-
|
456
|
-
##
|
457
|
-
# Generate an instance context for the instance, the context is capable of
|
458
|
-
# performing various actions. All instance actions are proxied to the context
|
459
|
-
# @return [AssistantContext] CallContext for this CallInstance
|
460
|
-
def context
|
461
|
-
unless @instance_context
|
462
|
-
@instance_context = AssistantContext.new(@version , @params['sid'])
|
463
|
-
end
|
464
|
-
@instance_context
|
465
|
-
end
|
466
|
-
|
467
|
-
##
|
468
|
-
# @return [String] The unique ID of the Account that created this Assistant.
|
469
|
-
def account_sid
|
470
|
-
@properties['account_sid']
|
471
|
-
end
|
472
|
-
|
473
|
-
##
|
474
|
-
# @return [Time] The date that this resource was created
|
475
|
-
def date_created
|
476
|
-
@properties['date_created']
|
477
|
-
end
|
478
|
-
|
479
|
-
##
|
480
|
-
# @return [Time] The date that this resource was last updated
|
481
|
-
def date_updated
|
482
|
-
@properties['date_updated']
|
483
|
-
end
|
484
|
-
|
485
|
-
##
|
486
|
-
# @return [String] A text description for the Assistant. It is non-unique and can up to 255 characters long.
|
487
|
-
def friendly_name
|
488
|
-
@properties['friendly_name']
|
489
|
-
end
|
490
|
-
|
491
|
-
##
|
492
|
-
# @return [String] The unique ID (Sid) of the latest model build. Null if no model has been built.
|
493
|
-
def latest_model_build_sid
|
494
|
-
@properties['latest_model_build_sid']
|
495
|
-
end
|
496
|
-
|
497
|
-
##
|
498
|
-
# @return [Hash]
|
499
|
-
def links
|
500
|
-
@properties['links']
|
501
|
-
end
|
502
|
-
|
503
|
-
##
|
504
|
-
# @return [Boolean] A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter.
|
505
|
-
def log_queries
|
506
|
-
@properties['log_queries']
|
507
|
-
end
|
508
|
-
|
509
|
-
##
|
510
|
-
# @return [String] A 34 character string that uniquely identifies this resource.
|
511
|
-
def sid
|
512
|
-
@properties['sid']
|
513
|
-
end
|
514
|
-
|
515
|
-
##
|
516
|
-
# @return [String] A user-provided string that uniquely identifies this resource as an alternative to the sid. You can use the unique name in the URL path. Unique up to 64 characters long.
|
517
|
-
def unique_name
|
518
|
-
@properties['unique_name']
|
519
|
-
end
|
520
|
-
|
521
|
-
##
|
522
|
-
# @return [String]
|
523
|
-
def url
|
524
|
-
@properties['url']
|
525
|
-
end
|
526
|
-
|
527
|
-
##
|
528
|
-
# @return [String] A user-provided URL to send event callbacks to.
|
529
|
-
def callback_url
|
530
|
-
@properties['callback_url']
|
531
|
-
end
|
532
|
-
|
533
|
-
##
|
534
|
-
# @return [String] Space-separated list of callback events that will trigger callbacks.
|
535
|
-
def callback_events
|
536
|
-
@properties['callback_events']
|
537
|
-
end
|
538
|
-
|
539
|
-
##
|
540
|
-
# Delete the AssistantInstance
|
541
|
-
# @return [Boolean] True if delete succeeds, false otherwise
|
542
|
-
def delete
|
543
|
-
|
544
|
-
context.delete
|
545
|
-
end
|
546
|
-
|
547
|
-
##
|
548
|
-
# Fetch the AssistantInstance
|
549
|
-
# @return [AssistantInstance] Fetched AssistantInstance
|
550
|
-
def fetch
|
551
|
-
|
552
|
-
context.fetch
|
553
|
-
end
|
554
|
-
|
555
|
-
##
|
556
|
-
# Update the AssistantInstance
|
557
|
-
# @param [String] friendly_name A text description for the Assistant. It is non-unique and can up to 255 characters long.
|
558
|
-
# @param [Boolean] log_queries A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided.
|
559
|
-
# @param [String] unique_name A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long.
|
560
|
-
# @param [String] callback_url A user-provided URL to send event callbacks to.
|
561
|
-
# @param [String] callback_events Space-separated list of callback events that will trigger callbacks.
|
562
|
-
# @param [Object] fallback_actions The JSON actions to be executed when the user's input is not recognized as matching any Task.
|
563
|
-
# @param [Object] initiation_actions The JSON actions to be executed on inbound phone calls when the Assistant has to say something first.
|
564
|
-
# @param [Object] style_sheet The JSON object that holds the style sheet for the assistant
|
565
|
-
# @return [AssistantInstance] Updated AssistantInstance
|
566
|
-
def update(
|
567
|
-
friendly_name: :unset,
|
568
|
-
log_queries: :unset,
|
569
|
-
unique_name: :unset,
|
570
|
-
callback_url: :unset,
|
571
|
-
callback_events: :unset,
|
572
|
-
fallback_actions: :unset,
|
573
|
-
initiation_actions: :unset,
|
574
|
-
style_sheet: :unset
|
575
|
-
)
|
576
|
-
|
577
|
-
context.update(
|
578
|
-
friendly_name: friendly_name,
|
579
|
-
log_queries: log_queries,
|
580
|
-
unique_name: unique_name,
|
581
|
-
callback_url: callback_url,
|
582
|
-
callback_events: callback_events,
|
583
|
-
fallback_actions: fallback_actions,
|
584
|
-
initiation_actions: initiation_actions,
|
585
|
-
style_sheet: style_sheet,
|
586
|
-
)
|
587
|
-
end
|
588
|
-
|
589
|
-
##
|
590
|
-
# Access the field_types
|
591
|
-
# @return [field_types] field_types
|
592
|
-
def field_types
|
593
|
-
context.field_types
|
594
|
-
end
|
595
|
-
|
596
|
-
##
|
597
|
-
# Access the assistant_fallback_actions
|
598
|
-
# @return [assistant_fallback_actions] assistant_fallback_actions
|
599
|
-
def assistant_fallback_actions
|
600
|
-
context.assistant_fallback_actions
|
601
|
-
end
|
602
|
-
|
603
|
-
##
|
604
|
-
# Access the tasks
|
605
|
-
# @return [tasks] tasks
|
606
|
-
def tasks
|
607
|
-
context.tasks
|
608
|
-
end
|
609
|
-
|
610
|
-
##
|
611
|
-
# Access the dialogues
|
612
|
-
# @return [dialogues] dialogues
|
613
|
-
def dialogues
|
614
|
-
context.dialogues
|
615
|
-
end
|
616
|
-
|
617
|
-
##
|
618
|
-
# Access the assistant_initiation_actions
|
619
|
-
# @return [assistant_initiation_actions] assistant_initiation_actions
|
620
|
-
def assistant_initiation_actions
|
621
|
-
context.assistant_initiation_actions
|
622
|
-
end
|
623
|
-
|
624
|
-
##
|
625
|
-
# Access the model_builds
|
626
|
-
# @return [model_builds] model_builds
|
627
|
-
def model_builds
|
628
|
-
context.model_builds
|
629
|
-
end
|
630
|
-
|
631
|
-
##
|
632
|
-
# Access the style_sheet
|
633
|
-
# @return [style_sheet] style_sheet
|
634
|
-
def style_sheet
|
635
|
-
context.style_sheet
|
636
|
-
end
|
637
|
-
|
638
|
-
##
|
639
|
-
# Access the queries
|
640
|
-
# @return [queries] queries
|
641
|
-
def queries
|
642
|
-
context.queries
|
643
|
-
end
|
644
|
-
|
645
|
-
##
|
646
|
-
# Provide a user friendly representation
|
647
|
-
def to_s
|
648
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
649
|
-
"<Twilio.Preview.Understand.AssistantInstance #{values}>"
|
650
|
-
end
|
651
|
-
|
652
|
-
##
|
653
|
-
# Provide a detailed, user friendly representation
|
654
|
-
def inspect
|
655
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
656
|
-
"<Twilio.Preview.Understand.AssistantInstance #{values}>"
|
657
|
-
end
|
658
|
-
end
|
659
|
-
|
660
|
-
end
|
661
|
-
end
|
662
|
-
end
|
663
|
-
end
|