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.
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,463 +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
-
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 An ISO language-country string of the sample.
37
- # @param [String] query A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long.
38
- # @param [String] tasks Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2*
39
- # @param [String] model_build The Model Build Sid or unique name of the Model Build to be queried.
40
- # @param [String] field Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name*
41
- # @return [QueryInstance] Created QueryInstance
42
- def create(
43
- language: nil,
44
- query: nil,
45
- tasks: :unset,
46
- model_build: :unset,
47
- field: :unset
48
- )
49
-
50
- data = Twilio::Values.of({
51
- 'Language' => language,
52
- 'Query' => query,
53
- 'Tasks' => tasks,
54
- 'ModelBuild' => model_build,
55
- 'Field' => field,
56
- })
57
-
58
- payload = @version.create('POST', @uri, data: data)
59
- QueryInstance.new(
60
- @version,
61
- payload,
62
- assistant_sid: @solution[:assistant_sid],
63
- )
64
- end
65
-
66
-
67
- ##
68
- # Lists QueryInstance records from the API as a list.
69
- # Unlike stream(), this operation is eager and will load `limit` records into
70
- # memory before returning.
71
- # @param [String] language An ISO language-country string of the sample.
72
- # @param [String] model_build The Model Build Sid or unique name of the Model Build to be queried.
73
- # @param [String] status A string that described the query status. The values can be: pending_review, reviewed, discarded
74
- # @param [Integer] limit Upper limit for the number of records to return. stream()
75
- # guarantees to never return more than limit. Default is no limit
76
- # @param [Integer] page_size Number of records to fetch per request, when
77
- # not set will use the default value of 50 records. If no page_size is defined
78
- # but a limit is defined, stream() will attempt to read the limit with the most
79
- # efficient page size, i.e. min(limit, 1000)
80
- # @return [Array] Array of up to limit results
81
- def list(language: :unset, model_build: :unset, status: :unset, limit: nil, page_size: nil)
82
- self.stream(
83
- language: language,
84
- model_build: model_build,
85
- status: status,
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 [String] language An ISO language-country string of the sample.
96
- # @param [String] model_build The Model Build Sid or unique name of the Model Build to be queried.
97
- # @param [String] status A string that described the query status. The values can be: pending_review, reviewed, discarded
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, 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
- page_size: limits[:page_size], )
113
-
114
- @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
115
- end
116
-
117
- ##
118
- # When passed a block, yields QueryInstance records from the API.
119
- # This operation lazily loads records as efficiently as possible until the limit
120
- # is reached.
121
- def each
122
- limits = @version.read_limits
123
-
124
- page = self.page(page_size: limits[:page_size], )
125
-
126
- @version.stream(page,
127
- limit: limits[:limit],
128
- page_limit: limits[:page_limit]).each {|x| yield x}
129
- end
130
-
131
- ##
132
- # Retrieve a single page of QueryInstance records from the API.
133
- # Request is executed immediately.
134
- # @param [String] language An ISO language-country string of the sample.
135
- # @param [String] model_build The Model Build Sid or unique name of the Model Build to be queried.
136
- # @param [String] status A string that described the query status. The values can be: pending_review, reviewed, discarded
137
- # @param [String] page_token PageToken provided by the API
138
- # @param [Integer] page_number Page Number, this value is simply for client state
139
- # @param [Integer] page_size Number of records to return, defaults to 50
140
- # @return [Page] Page of QueryInstance
141
- def page(language: :unset, model_build: :unset, status: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
142
- params = Twilio::Values.of({
143
- 'Language' => language,
144
- 'ModelBuild' => model_build,
145
- 'Status' => status,
146
- 'PageToken' => page_token,
147
- 'Page' => page_number,
148
- 'PageSize' => page_size,
149
- })
150
-
151
- response = @version.page('GET', @uri, params: params)
152
-
153
- QueryPage.new(@version, response, @solution)
154
- end
155
-
156
- ##
157
- # Retrieve a single page of QueryInstance records from the API.
158
- # Request is executed immediately.
159
- # @param [String] target_url API-generated URL for the requested results page
160
- # @return [Page] Page of QueryInstance
161
- def get_page(target_url)
162
- response = @version.domain.request(
163
- 'GET',
164
- target_url
165
- )
166
- QueryPage.new(@version, response, @solution)
167
- end
168
-
169
-
170
-
171
- # Provide a user friendly representation
172
- def to_s
173
- '#<Twilio.Preview.Understand.QueryList>'
174
- end
175
- end
176
-
177
-
178
- ##
179
- #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.
180
- class QueryContext < InstanceContext
181
- ##
182
- # Initialize the QueryContext
183
- # @param [Version] version Version that contains the resource
184
- # @param [String] assistant_sid The unique ID of the parent Assistant.
185
- # @param [String] sid A 34 character string that uniquely identifies this resource.
186
- # @return [QueryContext] QueryContext
187
- def initialize(version, assistant_sid, sid)
188
- super(version)
189
-
190
- # Path Solution
191
- @solution = { assistant_sid: assistant_sid, sid: sid, }
192
- @uri = "/Assistants/#{@solution[:assistant_sid]}/Queries/#{@solution[:sid]}"
193
-
194
-
195
- end
196
- ##
197
- # Delete the QueryInstance
198
- # @return [Boolean] True if delete succeeds, false otherwise
199
- def delete
200
-
201
- @version.delete('DELETE', @uri)
202
- end
203
-
204
- ##
205
- # Fetch the QueryInstance
206
- # @return [QueryInstance] Fetched QueryInstance
207
- def fetch
208
-
209
- payload = @version.fetch('GET', @uri)
210
- QueryInstance.new(
211
- @version,
212
- payload,
213
- assistant_sid: @solution[:assistant_sid],
214
- sid: @solution[:sid],
215
- )
216
- end
217
-
218
- ##
219
- # Update the QueryInstance
220
- # @param [String] sample_sid An optional reference to the Sample created from this query.
221
- # @param [String] status A string that described the query status. The values can be: pending_review, reviewed, discarded
222
- # @return [QueryInstance] Updated QueryInstance
223
- def update(
224
- sample_sid: :unset,
225
- status: :unset
226
- )
227
-
228
- data = Twilio::Values.of({
229
- 'SampleSid' => sample_sid,
230
- 'Status' => status,
231
- })
232
-
233
- payload = @version.update('POST', @uri, data: data)
234
- QueryInstance.new(
235
- @version,
236
- payload,
237
- assistant_sid: @solution[:assistant_sid],
238
- sid: @solution[:sid],
239
- )
240
- end
241
-
242
-
243
- ##
244
- # Provide a user friendly representation
245
- def to_s
246
- context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
247
- "#<Twilio.Preview.Understand.QueryContext #{context}>"
248
- end
249
-
250
- ##
251
- # Provide a detailed, user friendly representation
252
- def inspect
253
- context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
254
- "#<Twilio.Preview.Understand.QueryContext #{context}>"
255
- end
256
- end
257
-
258
- class QueryPage < Page
259
- ##
260
- # Initialize the QueryPage
261
- # @param [Version] version Version that contains the resource
262
- # @param [Response] response Response from the API
263
- # @param [Hash] solution Path solution for the resource
264
- # @return [QueryPage] QueryPage
265
- def initialize(version, response, solution)
266
- super(version, response)
267
-
268
- # Path Solution
269
- @solution = solution
270
- end
271
-
272
- ##
273
- # Build an instance of QueryInstance
274
- # @param [Hash] payload Payload response from the API
275
- # @return [QueryInstance] QueryInstance
276
- def get_instance(payload)
277
- QueryInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid])
278
- end
279
-
280
- ##
281
- # Provide a user friendly representation
282
- def to_s
283
- '<Twilio.Preview.Understand.QueryPage>'
284
- end
285
- end
286
- class QueryInstance < InstanceResource
287
- ##
288
- # Initialize the QueryInstance
289
- # @param [Version] version Version that contains the resource
290
- # @param [Hash] payload payload that contains response from Twilio
291
- # @param [String] account_sid The SID of the
292
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Query
293
- # resource.
294
- # @param [String] sid The SID of the Call resource to fetch.
295
- # @return [QueryInstance] QueryInstance
296
- def initialize(version, payload , assistant_sid: nil, sid: nil)
297
- super(version)
298
-
299
- # Marshaled Properties
300
- @properties = {
301
- 'account_sid' => payload['account_sid'],
302
- 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
303
- 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
304
- 'results' => payload['results'],
305
- 'language' => payload['language'],
306
- 'model_build_sid' => payload['model_build_sid'],
307
- 'query' => payload['query'],
308
- 'sample_sid' => payload['sample_sid'],
309
- 'assistant_sid' => payload['assistant_sid'],
310
- 'sid' => payload['sid'],
311
- 'status' => payload['status'],
312
- 'url' => payload['url'],
313
- 'source_channel' => payload['source_channel'],
314
- }
315
-
316
- # Context
317
- @instance_context = nil
318
- @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'sid' => sid || @properties['sid'] , }
319
- end
320
-
321
- ##
322
- # Generate an instance context for the instance, the context is capable of
323
- # performing various actions. All instance actions are proxied to the context
324
- # @return [QueryContext] CallContext for this CallInstance
325
- def context
326
- unless @instance_context
327
- @instance_context = QueryContext.new(@version , @params['assistant_sid'], @params['sid'])
328
- end
329
- @instance_context
330
- end
331
-
332
- ##
333
- # @return [String] The unique ID of the Account that created this Query.
334
- def account_sid
335
- @properties['account_sid']
336
- end
337
-
338
- ##
339
- # @return [Time] The date that this resource was created
340
- def date_created
341
- @properties['date_created']
342
- end
343
-
344
- ##
345
- # @return [Time] The date that this resource was last updated
346
- def date_updated
347
- @properties['date_updated']
348
- end
349
-
350
- ##
351
- # @return [Hash] The natural language analysis results which include the Task recognized, the confidence score and a list of identified Fields.
352
- def results
353
- @properties['results']
354
- end
355
-
356
- ##
357
- # @return [String] An ISO language-country string of the sample.
358
- def language
359
- @properties['language']
360
- end
361
-
362
- ##
363
- # @return [String] The unique ID of the Model Build queried.
364
- def model_build_sid
365
- @properties['model_build_sid']
366
- end
367
-
368
- ##
369
- # @return [String] The end-user's natural language input.
370
- def query
371
- @properties['query']
372
- end
373
-
374
- ##
375
- # @return [String] An optional reference to the Sample created from this query.
376
- def sample_sid
377
- @properties['sample_sid']
378
- end
379
-
380
- ##
381
- # @return [String] The unique ID of the parent Assistant.
382
- def assistant_sid
383
- @properties['assistant_sid']
384
- end
385
-
386
- ##
387
- # @return [String] A 34 character string that uniquely identifies this resource.
388
- def sid
389
- @properties['sid']
390
- end
391
-
392
- ##
393
- # @return [String] A string that described the query status. The values can be: pending_review, reviewed, discarded
394
- def status
395
- @properties['status']
396
- end
397
-
398
- ##
399
- # @return [String]
400
- def url
401
- @properties['url']
402
- end
403
-
404
- ##
405
- # @return [String] The communication channel where this end-user input came from
406
- def source_channel
407
- @properties['source_channel']
408
- end
409
-
410
- ##
411
- # Delete the QueryInstance
412
- # @return [Boolean] True if delete succeeds, false otherwise
413
- def delete
414
-
415
- context.delete
416
- end
417
-
418
- ##
419
- # Fetch the QueryInstance
420
- # @return [QueryInstance] Fetched QueryInstance
421
- def fetch
422
-
423
- context.fetch
424
- end
425
-
426
- ##
427
- # Update the QueryInstance
428
- # @param [String] sample_sid An optional reference to the Sample created from this query.
429
- # @param [String] status A string that described the query status. The values can be: pending_review, reviewed, discarded
430
- # @return [QueryInstance] Updated QueryInstance
431
- def update(
432
- sample_sid: :unset,
433
- status: :unset
434
- )
435
-
436
- context.update(
437
- sample_sid: sample_sid,
438
- status: status,
439
- )
440
- end
441
-
442
- ##
443
- # Provide a user friendly representation
444
- def to_s
445
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
446
- "<Twilio.Preview.Understand.QueryInstance #{values}>"
447
- end
448
-
449
- ##
450
- # Provide a detailed, user friendly representation
451
- def inspect
452
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
453
- "<Twilio.Preview.Understand.QueryInstance #{values}>"
454
- end
455
- end
456
-
457
- end
458
- end
459
- end
460
- end
461
- end
462
-
463
-