twilio-ruby 6.9.0 → 6.9.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.
- 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,436 +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 AssistantContext < InstanceContext
|
21
|
-
class TaskContext < InstanceContext
|
22
|
-
|
23
|
-
class SampleList < ListResource
|
24
|
-
##
|
25
|
-
# Initialize the SampleList
|
26
|
-
# @param [Version] version Version that contains the resource
|
27
|
-
# @return [SampleList] SampleList
|
28
|
-
def initialize(version, assistant_sid: nil, task_sid: nil)
|
29
|
-
super(version)
|
30
|
-
# Path Solution
|
31
|
-
@solution = { assistant_sid: assistant_sid, task_sid: task_sid }
|
32
|
-
@uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Samples"
|
33
|
-
|
34
|
-
end
|
35
|
-
##
|
36
|
-
# Create the SampleInstance
|
37
|
-
# @param [String] language An ISO language-country string of the sample.
|
38
|
-
# @param [String] tagged_text The text example of how end-users may express this task. The sample may contain Field tag blocks.
|
39
|
-
# @param [String] source_channel The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null
|
40
|
-
# @return [SampleInstance] Created SampleInstance
|
41
|
-
def create(
|
42
|
-
language: nil,
|
43
|
-
tagged_text: nil,
|
44
|
-
source_channel: :unset
|
45
|
-
)
|
46
|
-
|
47
|
-
data = Twilio::Values.of({
|
48
|
-
'Language' => language,
|
49
|
-
'TaggedText' => tagged_text,
|
50
|
-
'SourceChannel' => source_channel,
|
51
|
-
})
|
52
|
-
|
53
|
-
payload = @version.create('POST', @uri, data: data)
|
54
|
-
SampleInstance.new(
|
55
|
-
@version,
|
56
|
-
payload,
|
57
|
-
assistant_sid: @solution[:assistant_sid],
|
58
|
-
task_sid: @solution[:task_sid],
|
59
|
-
)
|
60
|
-
end
|
61
|
-
|
62
|
-
|
63
|
-
##
|
64
|
-
# Lists SampleInstance records from the API as a list.
|
65
|
-
# Unlike stream(), this operation is eager and will load `limit` records into
|
66
|
-
# memory before returning.
|
67
|
-
# @param [String] language An ISO language-country string of the sample.
|
68
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
69
|
-
# guarantees to never return more than limit. Default is no limit
|
70
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
71
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
72
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
73
|
-
# efficient page size, i.e. min(limit, 1000)
|
74
|
-
# @return [Array] Array of up to limit results
|
75
|
-
def list(language: :unset, limit: nil, page_size: nil)
|
76
|
-
self.stream(
|
77
|
-
language: language,
|
78
|
-
limit: limit,
|
79
|
-
page_size: page_size
|
80
|
-
).entries
|
81
|
-
end
|
82
|
-
|
83
|
-
##
|
84
|
-
# Streams Instance records from the API as an Enumerable.
|
85
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
86
|
-
# is reached.
|
87
|
-
# @param [String] language An ISO language-country string of the sample.
|
88
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
89
|
-
# guarantees to never return more than limit. Default is no limit
|
90
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
91
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
92
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
93
|
-
# efficient page size, i.e. min(limit, 1000)
|
94
|
-
# @return [Enumerable] Enumerable that will yield up to limit results
|
95
|
-
def stream(language: :unset, limit: nil, page_size: nil)
|
96
|
-
limits = @version.read_limits(limit, page_size)
|
97
|
-
|
98
|
-
page = self.page(
|
99
|
-
language: language,
|
100
|
-
page_size: limits[:page_size], )
|
101
|
-
|
102
|
-
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
103
|
-
end
|
104
|
-
|
105
|
-
##
|
106
|
-
# When passed a block, yields SampleInstance records from the API.
|
107
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
108
|
-
# is reached.
|
109
|
-
def each
|
110
|
-
limits = @version.read_limits
|
111
|
-
|
112
|
-
page = self.page(page_size: limits[:page_size], )
|
113
|
-
|
114
|
-
@version.stream(page,
|
115
|
-
limit: limits[:limit],
|
116
|
-
page_limit: limits[:page_limit]).each {|x| yield x}
|
117
|
-
end
|
118
|
-
|
119
|
-
##
|
120
|
-
# Retrieve a single page of SampleInstance records from the API.
|
121
|
-
# Request is executed immediately.
|
122
|
-
# @param [String] language An ISO language-country string of the sample.
|
123
|
-
# @param [String] page_token PageToken provided by the API
|
124
|
-
# @param [Integer] page_number Page Number, this value is simply for client state
|
125
|
-
# @param [Integer] page_size Number of records to return, defaults to 50
|
126
|
-
# @return [Page] Page of SampleInstance
|
127
|
-
def page(language: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
128
|
-
params = Twilio::Values.of({
|
129
|
-
'Language' => language,
|
130
|
-
'PageToken' => page_token,
|
131
|
-
'Page' => page_number,
|
132
|
-
'PageSize' => page_size,
|
133
|
-
})
|
134
|
-
|
135
|
-
response = @version.page('GET', @uri, params: params)
|
136
|
-
|
137
|
-
SamplePage.new(@version, response, @solution)
|
138
|
-
end
|
139
|
-
|
140
|
-
##
|
141
|
-
# Retrieve a single page of SampleInstance records from the API.
|
142
|
-
# Request is executed immediately.
|
143
|
-
# @param [String] target_url API-generated URL for the requested results page
|
144
|
-
# @return [Page] Page of SampleInstance
|
145
|
-
def get_page(target_url)
|
146
|
-
response = @version.domain.request(
|
147
|
-
'GET',
|
148
|
-
target_url
|
149
|
-
)
|
150
|
-
SamplePage.new(@version, response, @solution)
|
151
|
-
end
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
# Provide a user friendly representation
|
156
|
-
def to_s
|
157
|
-
'#<Twilio.Preview.Understand.SampleList>'
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
|
-
|
162
|
-
##
|
163
|
-
#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.
|
164
|
-
class SampleContext < InstanceContext
|
165
|
-
##
|
166
|
-
# Initialize the SampleContext
|
167
|
-
# @param [Version] version Version that contains the resource
|
168
|
-
# @param [String] assistant_sid The unique ID of the Assistant.
|
169
|
-
# @param [String] task_sid The unique ID of the Task associated with this Sample.
|
170
|
-
# @param [String] sid A 34 character string that uniquely identifies this resource.
|
171
|
-
# @return [SampleContext] SampleContext
|
172
|
-
def initialize(version, assistant_sid, task_sid, sid)
|
173
|
-
super(version)
|
174
|
-
|
175
|
-
# Path Solution
|
176
|
-
@solution = { assistant_sid: assistant_sid, task_sid: task_sid, sid: sid, }
|
177
|
-
@uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Samples/#{@solution[:sid]}"
|
178
|
-
|
179
|
-
|
180
|
-
end
|
181
|
-
##
|
182
|
-
# Delete the SampleInstance
|
183
|
-
# @return [Boolean] True if delete succeeds, false otherwise
|
184
|
-
def delete
|
185
|
-
|
186
|
-
@version.delete('DELETE', @uri)
|
187
|
-
end
|
188
|
-
|
189
|
-
##
|
190
|
-
# Fetch the SampleInstance
|
191
|
-
# @return [SampleInstance] Fetched SampleInstance
|
192
|
-
def fetch
|
193
|
-
|
194
|
-
payload = @version.fetch('GET', @uri)
|
195
|
-
SampleInstance.new(
|
196
|
-
@version,
|
197
|
-
payload,
|
198
|
-
assistant_sid: @solution[:assistant_sid],
|
199
|
-
task_sid: @solution[:task_sid],
|
200
|
-
sid: @solution[:sid],
|
201
|
-
)
|
202
|
-
end
|
203
|
-
|
204
|
-
##
|
205
|
-
# Update the SampleInstance
|
206
|
-
# @param [String] language An ISO language-country string of the sample.
|
207
|
-
# @param [String] tagged_text The text example of how end-users may express this task. The sample may contain Field tag blocks.
|
208
|
-
# @param [String] source_channel The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null
|
209
|
-
# @return [SampleInstance] Updated SampleInstance
|
210
|
-
def update(
|
211
|
-
language: :unset,
|
212
|
-
tagged_text: :unset,
|
213
|
-
source_channel: :unset
|
214
|
-
)
|
215
|
-
|
216
|
-
data = Twilio::Values.of({
|
217
|
-
'Language' => language,
|
218
|
-
'TaggedText' => tagged_text,
|
219
|
-
'SourceChannel' => source_channel,
|
220
|
-
})
|
221
|
-
|
222
|
-
payload = @version.update('POST', @uri, data: data)
|
223
|
-
SampleInstance.new(
|
224
|
-
@version,
|
225
|
-
payload,
|
226
|
-
assistant_sid: @solution[:assistant_sid],
|
227
|
-
task_sid: @solution[:task_sid],
|
228
|
-
sid: @solution[:sid],
|
229
|
-
)
|
230
|
-
end
|
231
|
-
|
232
|
-
|
233
|
-
##
|
234
|
-
# Provide a user friendly representation
|
235
|
-
def to_s
|
236
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
237
|
-
"#<Twilio.Preview.Understand.SampleContext #{context}>"
|
238
|
-
end
|
239
|
-
|
240
|
-
##
|
241
|
-
# Provide a detailed, user friendly representation
|
242
|
-
def inspect
|
243
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
244
|
-
"#<Twilio.Preview.Understand.SampleContext #{context}>"
|
245
|
-
end
|
246
|
-
end
|
247
|
-
|
248
|
-
class SamplePage < Page
|
249
|
-
##
|
250
|
-
# Initialize the SamplePage
|
251
|
-
# @param [Version] version Version that contains the resource
|
252
|
-
# @param [Response] response Response from the API
|
253
|
-
# @param [Hash] solution Path solution for the resource
|
254
|
-
# @return [SamplePage] SamplePage
|
255
|
-
def initialize(version, response, solution)
|
256
|
-
super(version, response)
|
257
|
-
|
258
|
-
# Path Solution
|
259
|
-
@solution = solution
|
260
|
-
end
|
261
|
-
|
262
|
-
##
|
263
|
-
# Build an instance of SampleInstance
|
264
|
-
# @param [Hash] payload Payload response from the API
|
265
|
-
# @return [SampleInstance] SampleInstance
|
266
|
-
def get_instance(payload)
|
267
|
-
SampleInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:task_sid])
|
268
|
-
end
|
269
|
-
|
270
|
-
##
|
271
|
-
# Provide a user friendly representation
|
272
|
-
def to_s
|
273
|
-
'<Twilio.Preview.Understand.SamplePage>'
|
274
|
-
end
|
275
|
-
end
|
276
|
-
class SampleInstance < InstanceResource
|
277
|
-
##
|
278
|
-
# Initialize the SampleInstance
|
279
|
-
# @param [Version] version Version that contains the resource
|
280
|
-
# @param [Hash] payload payload that contains response from Twilio
|
281
|
-
# @param [String] account_sid The SID of the
|
282
|
-
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this Sample
|
283
|
-
# resource.
|
284
|
-
# @param [String] sid The SID of the Call resource to fetch.
|
285
|
-
# @return [SampleInstance] SampleInstance
|
286
|
-
def initialize(version, payload , assistant_sid: nil, task_sid: nil, sid: nil)
|
287
|
-
super(version)
|
288
|
-
|
289
|
-
# Marshaled Properties
|
290
|
-
@properties = {
|
291
|
-
'account_sid' => payload['account_sid'],
|
292
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
293
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
294
|
-
'task_sid' => payload['task_sid'],
|
295
|
-
'language' => payload['language'],
|
296
|
-
'assistant_sid' => payload['assistant_sid'],
|
297
|
-
'sid' => payload['sid'],
|
298
|
-
'tagged_text' => payload['tagged_text'],
|
299
|
-
'url' => payload['url'],
|
300
|
-
'source_channel' => payload['source_channel'],
|
301
|
-
}
|
302
|
-
|
303
|
-
# Context
|
304
|
-
@instance_context = nil
|
305
|
-
@params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'task_sid' => task_sid || @properties['task_sid'] ,'sid' => sid || @properties['sid'] , }
|
306
|
-
end
|
307
|
-
|
308
|
-
##
|
309
|
-
# Generate an instance context for the instance, the context is capable of
|
310
|
-
# performing various actions. All instance actions are proxied to the context
|
311
|
-
# @return [SampleContext] CallContext for this CallInstance
|
312
|
-
def context
|
313
|
-
unless @instance_context
|
314
|
-
@instance_context = SampleContext.new(@version , @params['assistant_sid'], @params['task_sid'], @params['sid'])
|
315
|
-
end
|
316
|
-
@instance_context
|
317
|
-
end
|
318
|
-
|
319
|
-
##
|
320
|
-
# @return [String] The unique ID of the Account that created this Sample.
|
321
|
-
def account_sid
|
322
|
-
@properties['account_sid']
|
323
|
-
end
|
324
|
-
|
325
|
-
##
|
326
|
-
# @return [Time] The date that this resource was created
|
327
|
-
def date_created
|
328
|
-
@properties['date_created']
|
329
|
-
end
|
330
|
-
|
331
|
-
##
|
332
|
-
# @return [Time] The date that this resource was last updated
|
333
|
-
def date_updated
|
334
|
-
@properties['date_updated']
|
335
|
-
end
|
336
|
-
|
337
|
-
##
|
338
|
-
# @return [String] The unique ID of the Task associated with this Sample.
|
339
|
-
def task_sid
|
340
|
-
@properties['task_sid']
|
341
|
-
end
|
342
|
-
|
343
|
-
##
|
344
|
-
# @return [String] An ISO language-country string of the sample.
|
345
|
-
def language
|
346
|
-
@properties['language']
|
347
|
-
end
|
348
|
-
|
349
|
-
##
|
350
|
-
# @return [String] The unique ID of the Assistant.
|
351
|
-
def assistant_sid
|
352
|
-
@properties['assistant_sid']
|
353
|
-
end
|
354
|
-
|
355
|
-
##
|
356
|
-
# @return [String] A 34 character string that uniquely identifies this resource.
|
357
|
-
def sid
|
358
|
-
@properties['sid']
|
359
|
-
end
|
360
|
-
|
361
|
-
##
|
362
|
-
# @return [String] The text example of how end-users may express this task. The sample may contain Field tag blocks.
|
363
|
-
def tagged_text
|
364
|
-
@properties['tagged_text']
|
365
|
-
end
|
366
|
-
|
367
|
-
##
|
368
|
-
# @return [String]
|
369
|
-
def url
|
370
|
-
@properties['url']
|
371
|
-
end
|
372
|
-
|
373
|
-
##
|
374
|
-
# @return [String] The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null
|
375
|
-
def source_channel
|
376
|
-
@properties['source_channel']
|
377
|
-
end
|
378
|
-
|
379
|
-
##
|
380
|
-
# Delete the SampleInstance
|
381
|
-
# @return [Boolean] True if delete succeeds, false otherwise
|
382
|
-
def delete
|
383
|
-
|
384
|
-
context.delete
|
385
|
-
end
|
386
|
-
|
387
|
-
##
|
388
|
-
# Fetch the SampleInstance
|
389
|
-
# @return [SampleInstance] Fetched SampleInstance
|
390
|
-
def fetch
|
391
|
-
|
392
|
-
context.fetch
|
393
|
-
end
|
394
|
-
|
395
|
-
##
|
396
|
-
# Update the SampleInstance
|
397
|
-
# @param [String] language An ISO language-country string of the sample.
|
398
|
-
# @param [String] tagged_text The text example of how end-users may express this task. The sample may contain Field tag blocks.
|
399
|
-
# @param [String] source_channel The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null
|
400
|
-
# @return [SampleInstance] Updated SampleInstance
|
401
|
-
def update(
|
402
|
-
language: :unset,
|
403
|
-
tagged_text: :unset,
|
404
|
-
source_channel: :unset
|
405
|
-
)
|
406
|
-
|
407
|
-
context.update(
|
408
|
-
language: language,
|
409
|
-
tagged_text: tagged_text,
|
410
|
-
source_channel: source_channel,
|
411
|
-
)
|
412
|
-
end
|
413
|
-
|
414
|
-
##
|
415
|
-
# Provide a user friendly representation
|
416
|
-
def to_s
|
417
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
418
|
-
"<Twilio.Preview.Understand.SampleInstance #{values}>"
|
419
|
-
end
|
420
|
-
|
421
|
-
##
|
422
|
-
# Provide a detailed, user friendly representation
|
423
|
-
def inspect
|
424
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
425
|
-
"<Twilio.Preview.Understand.SampleInstance #{values}>"
|
426
|
-
end
|
427
|
-
end
|
428
|
-
|
429
|
-
end
|
430
|
-
end
|
431
|
-
end
|
432
|
-
end
|
433
|
-
end
|
434
|
-
end
|
435
|
-
|
436
|
-
|
@@ -1,253 +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 AssistantContext < InstanceContext
|
21
|
-
class TaskContext < InstanceContext
|
22
|
-
|
23
|
-
class TaskActionsList < ListResource
|
24
|
-
##
|
25
|
-
# Initialize the TaskActionsList
|
26
|
-
# @param [Version] version Version that contains the resource
|
27
|
-
# @return [TaskActionsList] TaskActionsList
|
28
|
-
def initialize(version, assistant_sid: nil, task_sid: nil)
|
29
|
-
super(version)
|
30
|
-
# Path Solution
|
31
|
-
@solution = { assistant_sid: assistant_sid, task_sid: task_sid }
|
32
|
-
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
# Provide a user friendly representation
|
39
|
-
def to_s
|
40
|
-
'#<Twilio.Preview.Understand.TaskActionsList>'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
|
45
|
-
##
|
46
|
-
#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.
|
47
|
-
class TaskActionsContext < InstanceContext
|
48
|
-
##
|
49
|
-
# Initialize the TaskActionsContext
|
50
|
-
# @param [Version] version Version that contains the resource
|
51
|
-
# @param [String] assistant_sid The unique ID of the parent Assistant.
|
52
|
-
# @param [String] task_sid The unique ID of the Task.
|
53
|
-
# @return [TaskActionsContext] TaskActionsContext
|
54
|
-
def initialize(version, assistant_sid, task_sid)
|
55
|
-
super(version)
|
56
|
-
|
57
|
-
# Path Solution
|
58
|
-
@solution = { assistant_sid: assistant_sid, task_sid: task_sid, }
|
59
|
-
@uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Actions"
|
60
|
-
|
61
|
-
|
62
|
-
end
|
63
|
-
##
|
64
|
-
# Fetch the TaskActionsInstance
|
65
|
-
# @return [TaskActionsInstance] Fetched TaskActionsInstance
|
66
|
-
def fetch
|
67
|
-
|
68
|
-
payload = @version.fetch('GET', @uri)
|
69
|
-
TaskActionsInstance.new(
|
70
|
-
@version,
|
71
|
-
payload,
|
72
|
-
assistant_sid: @solution[:assistant_sid],
|
73
|
-
task_sid: @solution[:task_sid],
|
74
|
-
)
|
75
|
-
end
|
76
|
-
|
77
|
-
##
|
78
|
-
# Update the TaskActionsInstance
|
79
|
-
# @param [Object] actions The JSON actions that instruct the Assistant how to perform this task.
|
80
|
-
# @return [TaskActionsInstance] Updated TaskActionsInstance
|
81
|
-
def update(
|
82
|
-
actions: :unset
|
83
|
-
)
|
84
|
-
|
85
|
-
data = Twilio::Values.of({
|
86
|
-
'Actions' => Twilio.serialize_object(actions),
|
87
|
-
})
|
88
|
-
|
89
|
-
payload = @version.update('POST', @uri, data: data)
|
90
|
-
TaskActionsInstance.new(
|
91
|
-
@version,
|
92
|
-
payload,
|
93
|
-
assistant_sid: @solution[:assistant_sid],
|
94
|
-
task_sid: @solution[:task_sid],
|
95
|
-
)
|
96
|
-
end
|
97
|
-
|
98
|
-
|
99
|
-
##
|
100
|
-
# Provide a user friendly representation
|
101
|
-
def to_s
|
102
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
103
|
-
"#<Twilio.Preview.Understand.TaskActionsContext #{context}>"
|
104
|
-
end
|
105
|
-
|
106
|
-
##
|
107
|
-
# Provide a detailed, user friendly representation
|
108
|
-
def inspect
|
109
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
110
|
-
"#<Twilio.Preview.Understand.TaskActionsContext #{context}>"
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
class TaskActionsPage < Page
|
115
|
-
##
|
116
|
-
# Initialize the TaskActionsPage
|
117
|
-
# @param [Version] version Version that contains the resource
|
118
|
-
# @param [Response] response Response from the API
|
119
|
-
# @param [Hash] solution Path solution for the resource
|
120
|
-
# @return [TaskActionsPage] TaskActionsPage
|
121
|
-
def initialize(version, response, solution)
|
122
|
-
super(version, response)
|
123
|
-
|
124
|
-
# Path Solution
|
125
|
-
@solution = solution
|
126
|
-
end
|
127
|
-
|
128
|
-
##
|
129
|
-
# Build an instance of TaskActionsInstance
|
130
|
-
# @param [Hash] payload Payload response from the API
|
131
|
-
# @return [TaskActionsInstance] TaskActionsInstance
|
132
|
-
def get_instance(payload)
|
133
|
-
TaskActionsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:task_sid])
|
134
|
-
end
|
135
|
-
|
136
|
-
##
|
137
|
-
# Provide a user friendly representation
|
138
|
-
def to_s
|
139
|
-
'<Twilio.Preview.Understand.TaskActionsPage>'
|
140
|
-
end
|
141
|
-
end
|
142
|
-
class TaskActionsInstance < InstanceResource
|
143
|
-
##
|
144
|
-
# Initialize the TaskActionsInstance
|
145
|
-
# @param [Version] version Version that contains the resource
|
146
|
-
# @param [Hash] payload payload that contains response from Twilio
|
147
|
-
# @param [String] account_sid The SID of the
|
148
|
-
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this TaskActions
|
149
|
-
# resource.
|
150
|
-
# @param [String] sid The SID of the Call resource to fetch.
|
151
|
-
# @return [TaskActionsInstance] TaskActionsInstance
|
152
|
-
def initialize(version, payload , assistant_sid: nil, task_sid: nil)
|
153
|
-
super(version)
|
154
|
-
|
155
|
-
# Marshaled Properties
|
156
|
-
@properties = {
|
157
|
-
'account_sid' => payload['account_sid'],
|
158
|
-
'assistant_sid' => payload['assistant_sid'],
|
159
|
-
'task_sid' => payload['task_sid'],
|
160
|
-
'url' => payload['url'],
|
161
|
-
'data' => payload['data'],
|
162
|
-
}
|
163
|
-
|
164
|
-
# Context
|
165
|
-
@instance_context = nil
|
166
|
-
@params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'task_sid' => task_sid || @properties['task_sid'] , }
|
167
|
-
end
|
168
|
-
|
169
|
-
##
|
170
|
-
# Generate an instance context for the instance, the context is capable of
|
171
|
-
# performing various actions. All instance actions are proxied to the context
|
172
|
-
# @return [TaskActionsContext] CallContext for this CallInstance
|
173
|
-
def context
|
174
|
-
unless @instance_context
|
175
|
-
@instance_context = TaskActionsContext.new(@version , @params['assistant_sid'], @params['task_sid'])
|
176
|
-
end
|
177
|
-
@instance_context
|
178
|
-
end
|
179
|
-
|
180
|
-
##
|
181
|
-
# @return [String] The unique ID of the Account that created this Field.
|
182
|
-
def account_sid
|
183
|
-
@properties['account_sid']
|
184
|
-
end
|
185
|
-
|
186
|
-
##
|
187
|
-
# @return [String] The unique ID of the parent Assistant.
|
188
|
-
def assistant_sid
|
189
|
-
@properties['assistant_sid']
|
190
|
-
end
|
191
|
-
|
192
|
-
##
|
193
|
-
# @return [String] The unique ID of the Task.
|
194
|
-
def task_sid
|
195
|
-
@properties['task_sid']
|
196
|
-
end
|
197
|
-
|
198
|
-
##
|
199
|
-
# @return [String]
|
200
|
-
def url
|
201
|
-
@properties['url']
|
202
|
-
end
|
203
|
-
|
204
|
-
##
|
205
|
-
# @return [Hash]
|
206
|
-
def data
|
207
|
-
@properties['data']
|
208
|
-
end
|
209
|
-
|
210
|
-
##
|
211
|
-
# Fetch the TaskActionsInstance
|
212
|
-
# @return [TaskActionsInstance] Fetched TaskActionsInstance
|
213
|
-
def fetch
|
214
|
-
|
215
|
-
context.fetch
|
216
|
-
end
|
217
|
-
|
218
|
-
##
|
219
|
-
# Update the TaskActionsInstance
|
220
|
-
# @param [Object] actions The JSON actions that instruct the Assistant how to perform this task.
|
221
|
-
# @return [TaskActionsInstance] Updated TaskActionsInstance
|
222
|
-
def update(
|
223
|
-
actions: :unset
|
224
|
-
)
|
225
|
-
|
226
|
-
context.update(
|
227
|
-
actions: actions,
|
228
|
-
)
|
229
|
-
end
|
230
|
-
|
231
|
-
##
|
232
|
-
# Provide a user friendly representation
|
233
|
-
def to_s
|
234
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
235
|
-
"<Twilio.Preview.Understand.TaskActionsInstance #{values}>"
|
236
|
-
end
|
237
|
-
|
238
|
-
##
|
239
|
-
# Provide a detailed, user friendly representation
|
240
|
-
def inspect
|
241
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
242
|
-
"<Twilio.Preview.Understand.TaskActionsInstance #{values}>"
|
243
|
-
end
|
244
|
-
end
|
245
|
-
|
246
|
-
end
|
247
|
-
end
|
248
|
-
end
|
249
|
-
end
|
250
|
-
end
|
251
|
-
end
|
252
|
-
|
253
|
-
|