twilio-ruby 5.14.1 → 5.15.0

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 (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,405 @@
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 Authy < Domain
12
+ class V1 < Version
13
+ class ServiceContext < InstanceContext
14
+ class EntityContext < InstanceContext
15
+ class FactorContext < InstanceContext
16
+ ##
17
+ # 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.
18
+ class ChallengeList < ListResource
19
+ ##
20
+ # Initialize the ChallengeList
21
+ # @param [Version] version Version that contains the resource
22
+ # @param [String] service_sid The unique SID identifier of the Service.
23
+ # @param [String] identity Customer unique identity for the Entity owner of the
24
+ # Challenge
25
+ # @param [String] factor_sid The unique SID identifier of the Factor.
26
+ # @return [ChallengeList] ChallengeList
27
+ def initialize(version, service_sid: nil, identity: nil, factor_sid: nil)
28
+ super(version)
29
+
30
+ # Path Solution
31
+ @solution = {service_sid: service_sid, identity: identity, factor_sid: factor_sid}
32
+ @uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}/Factors/#{@solution[:factor_sid]}/Challenges"
33
+ end
34
+
35
+ ##
36
+ # Retrieve a single page of ChallengeInstance records from the API.
37
+ # Request is executed immediately.
38
+ # @param [Time] expiration_date The future date in which this Challenge will
39
+ # expire, given in ISO 8601 format (https://en.wikipedia.org/wiki/ISO_8601).
40
+ # @param [String] details Details provided to give context about the Challenge.
41
+ # Shown to the end user.
42
+ # @param [String] hidden_details Details provided to give context about the
43
+ # Challenge. Not shown to the end user.
44
+ # @return [ChallengeInstance] Newly created ChallengeInstance
45
+ def create(expiration_date: :unset, details: :unset, hidden_details: :unset)
46
+ data = Twilio::Values.of({
47
+ 'ExpirationDate' => Twilio.serialize_iso8601_datetime(expiration_date),
48
+ 'Details' => details,
49
+ 'HiddenDetails' => hidden_details,
50
+ })
51
+
52
+ payload = @version.create(
53
+ 'POST',
54
+ @uri,
55
+ data: data
56
+ )
57
+
58
+ ChallengeInstance.new(
59
+ @version,
60
+ payload,
61
+ service_sid: @solution[:service_sid],
62
+ identity: @solution[:identity],
63
+ factor_sid: @solution[:factor_sid],
64
+ )
65
+ end
66
+
67
+ ##
68
+ # Provide a user friendly representation
69
+ def to_s
70
+ '#<Twilio.Authy.V1.ChallengeList>'
71
+ end
72
+ end
73
+
74
+ ##
75
+ # 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.
76
+ class ChallengePage < Page
77
+ ##
78
+ # Initialize the ChallengePage
79
+ # @param [Version] version Version that contains the resource
80
+ # @param [Response] response Response from the API
81
+ # @param [Hash] solution Path solution for the resource
82
+ # @return [ChallengePage] ChallengePage
83
+ def initialize(version, response, solution)
84
+ super(version, response)
85
+
86
+ # Path Solution
87
+ @solution = solution
88
+ end
89
+
90
+ ##
91
+ # Build an instance of ChallengeInstance
92
+ # @param [Hash] payload Payload response from the API
93
+ # @return [ChallengeInstance] ChallengeInstance
94
+ def get_instance(payload)
95
+ ChallengeInstance.new(
96
+ @version,
97
+ payload,
98
+ service_sid: @solution[:service_sid],
99
+ identity: @solution[:identity],
100
+ factor_sid: @solution[:factor_sid],
101
+ )
102
+ end
103
+
104
+ ##
105
+ # Provide a user friendly representation
106
+ def to_s
107
+ '<Twilio.Authy.V1.ChallengePage>'
108
+ end
109
+ end
110
+
111
+ ##
112
+ # 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.
113
+ class ChallengeContext < InstanceContext
114
+ ##
115
+ # Initialize the ChallengeContext
116
+ # @param [Version] version Version that contains the resource
117
+ # @param [String] service_sid The unique SID identifier of the Service.
118
+ # @param [String] identity Customer unique identity for the Entity owner of the
119
+ # Challenge
120
+ # @param [String] factor_sid The unique SID identifier of the Factor.
121
+ # @param [String] sid A 34 character string that uniquely identifies this
122
+ # Challenge. It also allows the keyword `latest` to fetch the most recent active
123
+ # Challenge created for a Factor.
124
+ # @return [ChallengeContext] ChallengeContext
125
+ def initialize(version, service_sid, identity, factor_sid, sid)
126
+ super(version)
127
+
128
+ # Path Solution
129
+ @solution = {service_sid: service_sid, identity: identity, factor_sid: factor_sid, sid: sid, }
130
+ @uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}/Factors/#{@solution[:factor_sid]}/Challenges/#{@solution[:sid]}"
131
+ end
132
+
133
+ ##
134
+ # Deletes the ChallengeInstance
135
+ # @return [Boolean] true if delete succeeds, true otherwise
136
+ def delete
137
+ @version.delete('delete', @uri)
138
+ end
139
+
140
+ ##
141
+ # Fetch a ChallengeInstance
142
+ # @return [ChallengeInstance] Fetched ChallengeInstance
143
+ def fetch
144
+ params = Twilio::Values.of({})
145
+
146
+ payload = @version.fetch(
147
+ 'GET',
148
+ @uri,
149
+ params,
150
+ )
151
+
152
+ ChallengeInstance.new(
153
+ @version,
154
+ payload,
155
+ service_sid: @solution[:service_sid],
156
+ identity: @solution[:identity],
157
+ factor_sid: @solution[:factor_sid],
158
+ sid: @solution[:sid],
159
+ )
160
+ end
161
+
162
+ ##
163
+ # Update the ChallengeInstance
164
+ # @param [String] auth_payload The optional payload needed to verify the
165
+ # Challenge. E.g., a TOTP would use the numeric code.
166
+ # @return [ChallengeInstance] Updated ChallengeInstance
167
+ def update(auth_payload: :unset)
168
+ data = Twilio::Values.of({'AuthPayload' => auth_payload, })
169
+
170
+ payload = @version.update(
171
+ 'POST',
172
+ @uri,
173
+ data: data,
174
+ )
175
+
176
+ ChallengeInstance.new(
177
+ @version,
178
+ payload,
179
+ service_sid: @solution[:service_sid],
180
+ identity: @solution[:identity],
181
+ factor_sid: @solution[:factor_sid],
182
+ sid: @solution[:sid],
183
+ )
184
+ end
185
+
186
+ ##
187
+ # Provide a user friendly representation
188
+ def to_s
189
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
190
+ "#<Twilio.Authy.V1.ChallengeContext #{context}>"
191
+ end
192
+ end
193
+
194
+ ##
195
+ # 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.
196
+ class ChallengeInstance < InstanceResource
197
+ ##
198
+ # Initialize the ChallengeInstance
199
+ # @param [Version] version Version that contains the resource
200
+ # @param [Hash] payload payload that contains response from Twilio
201
+ # @param [String] service_sid The unique SID identifier of the Service.
202
+ # @param [String] identity Customer unique identity for the Entity owner of the
203
+ # Challenge
204
+ # @param [String] factor_sid The unique SID identifier of the Factor.
205
+ # @param [String] sid A 34 character string that uniquely identifies this
206
+ # Challenge. It also allows the keyword `latest` to fetch the most recent active
207
+ # Challenge created for a Factor.
208
+ # @return [ChallengeInstance] ChallengeInstance
209
+ def initialize(version, payload, service_sid: nil, identity: nil, factor_sid: nil, sid: nil)
210
+ super(version)
211
+
212
+ # Marshaled Properties
213
+ @properties = {
214
+ 'sid' => payload['sid'],
215
+ 'account_sid' => payload['account_sid'],
216
+ 'service_sid' => payload['service_sid'],
217
+ 'entity_sid' => payload['entity_sid'],
218
+ 'identity' => payload['identity'],
219
+ 'factor_sid' => payload['factor_sid'],
220
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
221
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
222
+ 'date_responded' => Twilio.deserialize_iso8601_datetime(payload['date_responded']),
223
+ 'expiration_date' => Twilio.deserialize_iso8601_datetime(payload['expiration_date']),
224
+ 'verification_sid' => payload['verification_sid'],
225
+ 'status' => payload['status'],
226
+ 'reason' => payload['reason'],
227
+ 'details' => payload['details'],
228
+ 'hidden_details' => payload['hidden_details'],
229
+ 'type' => payload['type'],
230
+ 'url' => payload['url'],
231
+ }
232
+
233
+ # Context
234
+ @instance_context = nil
235
+ @params = {
236
+ 'service_sid' => service_sid,
237
+ 'identity' => identity,
238
+ 'factor_sid' => factor_sid,
239
+ 'sid' => sid || @properties['sid'],
240
+ }
241
+ end
242
+
243
+ ##
244
+ # Generate an instance context for the instance, the context is capable of
245
+ # performing various actions. All instance actions are proxied to the context
246
+ # @return [ChallengeContext] ChallengeContext for this ChallengeInstance
247
+ def context
248
+ unless @instance_context
249
+ @instance_context = ChallengeContext.new(
250
+ @version,
251
+ @params['service_sid'],
252
+ @params['identity'],
253
+ @params['factor_sid'],
254
+ @params['sid'],
255
+ )
256
+ end
257
+ @instance_context
258
+ end
259
+
260
+ ##
261
+ # @return [String] A string that uniquely identifies this Challenge.
262
+ def sid
263
+ @properties['sid']
264
+ end
265
+
266
+ ##
267
+ # @return [String] Account Sid.
268
+ def account_sid
269
+ @properties['account_sid']
270
+ end
271
+
272
+ ##
273
+ # @return [String] Service Sid.
274
+ def service_sid
275
+ @properties['service_sid']
276
+ end
277
+
278
+ ##
279
+ # @return [String] Entity Sid.
280
+ def entity_sid
281
+ @properties['entity_sid']
282
+ end
283
+
284
+ ##
285
+ # @return [String] Unique identity of the Entity
286
+ def identity
287
+ @properties['identity']
288
+ end
289
+
290
+ ##
291
+ # @return [String] Factor Sid.
292
+ def factor_sid
293
+ @properties['factor_sid']
294
+ end
295
+
296
+ ##
297
+ # @return [Time] The date this Challenge was created
298
+ def date_created
299
+ @properties['date_created']
300
+ end
301
+
302
+ ##
303
+ # @return [Time] The date this Challenge was updated
304
+ def date_updated
305
+ @properties['date_updated']
306
+ end
307
+
308
+ ##
309
+ # @return [Time] The date this Challenge was responded
310
+ def date_responded
311
+ @properties['date_responded']
312
+ end
313
+
314
+ ##
315
+ # @return [Time] The date this Challenge is expired
316
+ def expiration_date
317
+ @properties['expiration_date']
318
+ end
319
+
320
+ ##
321
+ # @return [String] Verification Sid.
322
+ def verification_sid
323
+ @properties['verification_sid']
324
+ end
325
+
326
+ ##
327
+ # @return [challenge.ChallengeStatus] The Status of this Challenge
328
+ def status
329
+ @properties['status']
330
+ end
331
+
332
+ ##
333
+ # @return [challenge.ChallengeReason] The Reason of this Challenge `status`
334
+ def reason
335
+ @properties['reason']
336
+ end
337
+
338
+ ##
339
+ # @return [String] Public details provided to contextualize the Challenge
340
+ def details
341
+ @properties['details']
342
+ end
343
+
344
+ ##
345
+ # @return [String] Hidden details provided to contextualize the Challenge
346
+ def hidden_details
347
+ @properties['hidden_details']
348
+ end
349
+
350
+ ##
351
+ # @return [String] The Factor Type of this Challenge
352
+ def type
353
+ @properties['type']
354
+ end
355
+
356
+ ##
357
+ # @return [String] The URL of this resource.
358
+ def url
359
+ @properties['url']
360
+ end
361
+
362
+ ##
363
+ # Deletes the ChallengeInstance
364
+ # @return [Boolean] true if delete succeeds, true otherwise
365
+ def delete
366
+ context.delete
367
+ end
368
+
369
+ ##
370
+ # Fetch a ChallengeInstance
371
+ # @return [ChallengeInstance] Fetched ChallengeInstance
372
+ def fetch
373
+ context.fetch
374
+ end
375
+
376
+ ##
377
+ # Update the ChallengeInstance
378
+ # @param [String] auth_payload The optional payload needed to verify the
379
+ # Challenge. E.g., a TOTP would use the numeric code.
380
+ # @return [ChallengeInstance] Updated ChallengeInstance
381
+ def update(auth_payload: :unset)
382
+ context.update(auth_payload: auth_payload, )
383
+ end
384
+
385
+ ##
386
+ # Provide a user friendly representation
387
+ def to_s
388
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
389
+ "<Twilio.Authy.V1.ChallengeInstance #{values}>"
390
+ end
391
+
392
+ ##
393
+ # Provide a detailed, user friendly representation
394
+ def inspect
395
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
396
+ "<Twilio.Authy.V1.ChallengeInstance #{values}>"
397
+ end
398
+ end
399
+ end
400
+ end
401
+ end
402
+ end
403
+ end
404
+ end
405
+ end
@@ -0,0 +1,47 @@
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
+ ##
13
+ # Initialize the Autopilot Domain
14
+ def initialize(twilio)
15
+ super
16
+
17
+ @base_url = 'https://autopilot.twilio.com'
18
+ @host = 'autopilot.twilio.com'
19
+ @port = 443
20
+
21
+ # Versions
22
+ @v1 = nil
23
+ end
24
+
25
+ ##
26
+ # Version v1 of autopilot
27
+ def v1
28
+ @v1 ||= V1.new self
29
+ end
30
+
31
+ ##
32
+ # @param [String] sid A 34 character string that uniquely identifies this
33
+ # resource.
34
+ # @return [Twilio::REST::Autopilot::V1::AssistantInstance] if sid was passed.
35
+ # @return [Twilio::REST::Autopilot::V1::AssistantList]
36
+ def assistants(sid=:unset)
37
+ self.v1.assistants(sid)
38
+ end
39
+
40
+ ##
41
+ # Provide a user friendly representation
42
+ def to_s
43
+ '#<Twilio::REST::Autopilot>'
44
+ end
45
+ end
46
+ end
47
+ end