twilio-ruby 5.14.1 → 5.15.0

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