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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +12 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/http/http_client.rb +3 -2
  5. data/lib/twilio-ruby/rest/client.rb +0 -5
  6. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +27 -27
  7. data/lib/twilio-ruby/rest/preview/sync/service.rb +27 -27
  8. data/lib/twilio-ruby/rest/preview.rb +1 -11
  9. data/lib/twilio-ruby/rest/preview_base.rb +0 -5
  10. data/lib/twilio-ruby/version.rb +1 -1
  11. metadata +2 -35
  12. data/lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb +0 -241
  13. data/lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb +0 -217
  14. data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +0 -389
  15. data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb +0 -435
  16. data/lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb +0 -409
  17. data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +0 -473
  18. data/lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb +0 -241
  19. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb +0 -373
  20. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +0 -436
  21. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb +0 -253
  22. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +0 -226
  23. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb +0 -525
  24. data/lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb +0 -433
  25. data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +0 -683
  26. data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +0 -207
  27. data/lib/twilio-ruby/rest/autopilot/v1.rb +0 -55
  28. data/lib/twilio-ruby/rest/autopilot.rb +0 -22
  29. data/lib/twilio-ruby/rest/autopilot_base.rb +0 -38
  30. data/lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb +0 -241
  31. data/lib/twilio-ruby/rest/preview/understand/assistant/assistant_initiation_actions.rb +0 -241
  32. data/lib/twilio-ruby/rest/preview/understand/assistant/dialogue.rb +0 -217
  33. data/lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb +0 -389
  34. data/lib/twilio-ruby/rest/preview/understand/assistant/field_type.rb +0 -435
  35. data/lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb +0 -409
  36. data/lib/twilio-ruby/rest/preview/understand/assistant/query.rb +0 -463
  37. data/lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb +0 -241
  38. data/lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb +0 -373
  39. data/lib/twilio-ruby/rest/preview/understand/assistant/task/sample.rb +0 -436
  40. data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_actions.rb +0 -253
  41. data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +0 -226
  42. data/lib/twilio-ruby/rest/preview/understand/assistant/task.rb +0 -525
  43. data/lib/twilio-ruby/rest/preview/understand/assistant.rb +0 -663
  44. data/lib/twilio-ruby/rest/preview/understand.rb +0 -49
@@ -1,473 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
- # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
- # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
- #
7
- # Twilio - Autopilot
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 Autopilot < AutopilotBase
19
- class V1 < Version
20
- class AssistantContext < InstanceContext
21
-
22
- class QueryList < ListResource
23
- ##
24
- # Initialize the QueryList
25
- # @param [Version] version Version that contains the resource
26
- # @return [QueryList] QueryList
27
- def initialize(version, assistant_sid: nil)
28
- super(version)
29
- # Path Solution
30
- @solution = { assistant_sid: assistant_sid }
31
- @uri = "/Assistants/#{@solution[:assistant_sid]}/Queries"
32
-
33
- end
34
- ##
35
- # Create the QueryInstance
36
- # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new query. For example: `en-US`.
37
- # @param [String] query The end-user's natural language input. It can be up to 2048 characters long.
38
- # @param [String] tasks The list of tasks to limit the new query to. Tasks are expressed as a comma-separated list of task `unique_name` values. For example, `task-unique_name-1, task-unique_name-2`. Listing specific tasks is useful to constrain the paths that a user can take.
39
- # @param [String] model_build The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried.
40
- # @return [QueryInstance] Created QueryInstance
41
- def create(
42
- language: nil,
43
- query: nil,
44
- tasks: :unset,
45
- model_build: :unset
46
- )
47
-
48
- data = Twilio::Values.of({
49
- 'Language' => language,
50
- 'Query' => query,
51
- 'Tasks' => tasks,
52
- 'ModelBuild' => model_build,
53
- })
54
-
55
- payload = @version.create('POST', @uri, data: data)
56
- QueryInstance.new(
57
- @version,
58
- payload,
59
- assistant_sid: @solution[:assistant_sid],
60
- )
61
- end
62
-
63
-
64
- ##
65
- # Lists QueryInstance records from the API as a list.
66
- # Unlike stream(), this operation is eager and will load `limit` records into
67
- # memory before returning.
68
- # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`.
69
- # @param [String] model_build The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried.
70
- # @param [String] status The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded`
71
- # @param [String] dialogue_sid The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue).
72
- # @param [Integer] limit Upper limit for the number of records to return. stream()
73
- # guarantees to never return more than limit. Default is no limit
74
- # @param [Integer] page_size Number of records to fetch per request, when
75
- # not set will use the default value of 50 records. If no page_size is defined
76
- # but a limit is defined, stream() will attempt to read the limit with the most
77
- # efficient page size, i.e. min(limit, 1000)
78
- # @return [Array] Array of up to limit results
79
- def list(language: :unset, model_build: :unset, status: :unset, dialogue_sid: :unset, limit: nil, page_size: nil)
80
- self.stream(
81
- language: language,
82
- model_build: model_build,
83
- status: status,
84
- dialogue_sid: dialogue_sid,
85
- limit: limit,
86
- page_size: page_size
87
- ).entries
88
- end
89
-
90
- ##
91
- # Streams Instance records from the API as an Enumerable.
92
- # This operation lazily loads records as efficiently as possible until the limit
93
- # is reached.
94
- # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`.
95
- # @param [String] model_build The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried.
96
- # @param [String] status The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded`
97
- # @param [String] dialogue_sid The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue).
98
- # @param [Integer] limit Upper limit for the number of records to return. stream()
99
- # guarantees to never return more than limit. Default is no limit
100
- # @param [Integer] page_size Number of records to fetch per request, when
101
- # not set will use the default value of 50 records. If no page_size is defined
102
- # but a limit is defined, stream() will attempt to read the limit with the most
103
- # efficient page size, i.e. min(limit, 1000)
104
- # @return [Enumerable] Enumerable that will yield up to limit results
105
- def stream(language: :unset, model_build: :unset, status: :unset, dialogue_sid: :unset, limit: nil, page_size: nil)
106
- limits = @version.read_limits(limit, page_size)
107
-
108
- page = self.page(
109
- language: language,
110
- model_build: model_build,
111
- status: status,
112
- dialogue_sid: dialogue_sid,
113
- page_size: limits[:page_size], )
114
-
115
- @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
116
- end
117
-
118
- ##
119
- # When passed a block, yields QueryInstance records from the API.
120
- # This operation lazily loads records as efficiently as possible until the limit
121
- # is reached.
122
- def each
123
- limits = @version.read_limits
124
-
125
- page = self.page(page_size: limits[:page_size], )
126
-
127
- @version.stream(page,
128
- limit: limits[:limit],
129
- page_limit: limits[:page_limit]).each {|x| yield x}
130
- end
131
-
132
- ##
133
- # Retrieve a single page of QueryInstance records from the API.
134
- # Request is executed immediately.
135
- # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`.
136
- # @param [String] model_build The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried.
137
- # @param [String] status The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded`
138
- # @param [String] dialogue_sid The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue).
139
- # @param [String] page_token PageToken provided by the API
140
- # @param [Integer] page_number Page Number, this value is simply for client state
141
- # @param [Integer] page_size Number of records to return, defaults to 50
142
- # @return [Page] Page of QueryInstance
143
- def page(language: :unset, model_build: :unset, status: :unset, dialogue_sid: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
144
- params = Twilio::Values.of({
145
- 'Language' => language,
146
- 'ModelBuild' => model_build,
147
- 'Status' => status,
148
- 'DialogueSid' => dialogue_sid,
149
- 'PageToken' => page_token,
150
- 'Page' => page_number,
151
- 'PageSize' => page_size,
152
- })
153
-
154
- response = @version.page('GET', @uri, params: params)
155
-
156
- QueryPage.new(@version, response, @solution)
157
- end
158
-
159
- ##
160
- # Retrieve a single page of QueryInstance records from the API.
161
- # Request is executed immediately.
162
- # @param [String] target_url API-generated URL for the requested results page
163
- # @return [Page] Page of QueryInstance
164
- def get_page(target_url)
165
- response = @version.domain.request(
166
- 'GET',
167
- target_url
168
- )
169
- QueryPage.new(@version, response, @solution)
170
- end
171
-
172
-
173
-
174
- # Provide a user friendly representation
175
- def to_s
176
- '#<Twilio.Autopilot.V1.QueryList>'
177
- end
178
- end
179
-
180
-
181
- ##
182
- #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.
183
- class QueryContext < InstanceContext
184
- ##
185
- # Initialize the QueryContext
186
- # @param [Version] version Version that contains the resource
187
- # @param [String] assistant_sid The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update.
188
- # @param [String] sid The Twilio-provided string that uniquely identifies the Query resource to update.
189
- # @return [QueryContext] QueryContext
190
- def initialize(version, assistant_sid, sid)
191
- super(version)
192
-
193
- # Path Solution
194
- @solution = { assistant_sid: assistant_sid, sid: sid, }
195
- @uri = "/Assistants/#{@solution[:assistant_sid]}/Queries/#{@solution[:sid]}"
196
-
197
-
198
- end
199
- ##
200
- # Delete the QueryInstance
201
- # @return [Boolean] True if delete succeeds, false otherwise
202
- def delete
203
-
204
- @version.delete('DELETE', @uri)
205
- end
206
-
207
- ##
208
- # Fetch the QueryInstance
209
- # @return [QueryInstance] Fetched QueryInstance
210
- def fetch
211
-
212
- payload = @version.fetch('GET', @uri)
213
- QueryInstance.new(
214
- @version,
215
- payload,
216
- assistant_sid: @solution[:assistant_sid],
217
- sid: @solution[:sid],
218
- )
219
- end
220
-
221
- ##
222
- # Update the QueryInstance
223
- # @param [String] sample_sid The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query.
224
- # @param [String] status The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded`
225
- # @return [QueryInstance] Updated QueryInstance
226
- def update(
227
- sample_sid: :unset,
228
- status: :unset
229
- )
230
-
231
- data = Twilio::Values.of({
232
- 'SampleSid' => sample_sid,
233
- 'Status' => status,
234
- })
235
-
236
- payload = @version.update('POST', @uri, data: data)
237
- QueryInstance.new(
238
- @version,
239
- payload,
240
- assistant_sid: @solution[:assistant_sid],
241
- sid: @solution[:sid],
242
- )
243
- end
244
-
245
-
246
- ##
247
- # Provide a user friendly representation
248
- def to_s
249
- context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
250
- "#<Twilio.Autopilot.V1.QueryContext #{context}>"
251
- end
252
-
253
- ##
254
- # Provide a detailed, user friendly representation
255
- def inspect
256
- context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
257
- "#<Twilio.Autopilot.V1.QueryContext #{context}>"
258
- end
259
- end
260
-
261
- class QueryPage < Page
262
- ##
263
- # Initialize the QueryPage
264
- # @param [Version] version Version that contains the resource
265
- # @param [Response] response Response from the API
266
- # @param [Hash] solution Path solution for the resource
267
- # @return [QueryPage] QueryPage
268
- def initialize(version, response, solution)
269
- super(version, response)
270
-
271
- # Path Solution
272
- @solution = solution
273
- end
274
-
275
- ##
276
- # Build an instance of QueryInstance
277
- # @param [Hash] payload Payload response from the API
278
- # @return [QueryInstance] QueryInstance
279
- def get_instance(payload)
280
- QueryInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid])
281
- end
282
-
283
- ##
284
- # Provide a user friendly representation
285
- def to_s
286
- '<Twilio.Autopilot.V1.QueryPage>'
287
- end
288
- end
289
- class QueryInstance < InstanceResource
290
- ##
291
- # Initialize the QueryInstance
292
- # @param [Version] version Version that contains the resource
293
- # @param [Hash] payload payload that contains response from Twilio
294
- # @param [String] account_sid The SID of the
295
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Query
296
- # resource.
297
- # @param [String] sid The SID of the Call resource to fetch.
298
- # @return [QueryInstance] QueryInstance
299
- def initialize(version, payload , assistant_sid: nil, sid: nil)
300
- super(version)
301
-
302
- # Marshaled Properties
303
- @properties = {
304
- 'account_sid' => payload['account_sid'],
305
- 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
306
- 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
307
- 'results' => payload['results'],
308
- 'language' => payload['language'],
309
- 'model_build_sid' => payload['model_build_sid'],
310
- 'query' => payload['query'],
311
- 'sample_sid' => payload['sample_sid'],
312
- 'assistant_sid' => payload['assistant_sid'],
313
- 'sid' => payload['sid'],
314
- 'status' => payload['status'],
315
- 'url' => payload['url'],
316
- 'source_channel' => payload['source_channel'],
317
- 'dialogue_sid' => payload['dialogue_sid'],
318
- }
319
-
320
- # Context
321
- @instance_context = nil
322
- @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'sid' => sid || @properties['sid'] , }
323
- end
324
-
325
- ##
326
- # Generate an instance context for the instance, the context is capable of
327
- # performing various actions. All instance actions are proxied to the context
328
- # @return [QueryContext] CallContext for this CallInstance
329
- def context
330
- unless @instance_context
331
- @instance_context = QueryContext.new(@version , @params['assistant_sid'], @params['sid'])
332
- end
333
- @instance_context
334
- end
335
-
336
- ##
337
- # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Query resource.
338
- def account_sid
339
- @properties['account_sid']
340
- end
341
-
342
- ##
343
- # @return [Time] The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
344
- def date_created
345
- @properties['date_created']
346
- end
347
-
348
- ##
349
- # @return [Time] The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
350
- def date_updated
351
- @properties['date_updated']
352
- end
353
-
354
- ##
355
- # @return [Hash] The natural language analysis results that include the [Task](https://www.twilio.com/docs/autopilot/api/task) recognized and a list of identified [Fields](https://www.twilio.com/docs/autopilot/api/task-field).
356
- def results
357
- @properties['results']
358
- end
359
-
360
- ##
361
- # @return [String] The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query. For example: `en-US`.
362
- def language
363
- @properties['language']
364
- end
365
-
366
- ##
367
- # @return [String] The SID of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) queried.
368
- def model_build_sid
369
- @properties['model_build_sid']
370
- end
371
-
372
- ##
373
- # @return [String] The end-user's natural language input.
374
- def query
375
- @properties['query']
376
- end
377
-
378
- ##
379
- # @return [String] The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query.
380
- def sample_sid
381
- @properties['sample_sid']
382
- end
383
-
384
- ##
385
- # @return [String] The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource.
386
- def assistant_sid
387
- @properties['assistant_sid']
388
- end
389
-
390
- ##
391
- # @return [String] The unique string that we created to identify the Query resource.
392
- def sid
393
- @properties['sid']
394
- end
395
-
396
- ##
397
- # @return [String] The status of the Query. Can be: `pending-review`, `reviewed`, or `discarded`
398
- def status
399
- @properties['status']
400
- end
401
-
402
- ##
403
- # @return [String] The absolute URL of the Query resource.
404
- def url
405
- @properties['url']
406
- end
407
-
408
- ##
409
- # @return [String] The communication channel from where the end-user input came.
410
- def source_channel
411
- @properties['source_channel']
412
- end
413
-
414
- ##
415
- # @return [String] The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue).
416
- def dialogue_sid
417
- @properties['dialogue_sid']
418
- end
419
-
420
- ##
421
- # Delete the QueryInstance
422
- # @return [Boolean] True if delete succeeds, false otherwise
423
- def delete
424
-
425
- context.delete
426
- end
427
-
428
- ##
429
- # Fetch the QueryInstance
430
- # @return [QueryInstance] Fetched QueryInstance
431
- def fetch
432
-
433
- context.fetch
434
- end
435
-
436
- ##
437
- # Update the QueryInstance
438
- # @param [String] sample_sid The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query.
439
- # @param [String] status The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded`
440
- # @return [QueryInstance] Updated QueryInstance
441
- def update(
442
- sample_sid: :unset,
443
- status: :unset
444
- )
445
-
446
- context.update(
447
- sample_sid: sample_sid,
448
- status: status,
449
- )
450
- end
451
-
452
- ##
453
- # Provide a user friendly representation
454
- def to_s
455
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
456
- "<Twilio.Autopilot.V1.QueryInstance #{values}>"
457
- end
458
-
459
- ##
460
- # Provide a detailed, user friendly representation
461
- def inspect
462
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
463
- "<Twilio.Autopilot.V1.QueryInstance #{values}>"
464
- end
465
- end
466
-
467
- end
468
- end
469
- end
470
- end
471
- end
472
-
473
-