twilio-ruby 5.34.0 → 5.38.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +126 -0
  3. data/README.md +24 -3
  4. data/lib/twilio-ruby.rb +1 -1
  5. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +87 -87
  6. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +14 -0
  7. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +47 -9
  8. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +71 -71
  9. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +29 -29
  10. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +38 -3
  11. data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +12 -12
  12. data/lib/twilio-ruby/rest/autopilot.rb +6 -0
  13. data/lib/twilio-ruby/rest/autopilot/v1.rb +7 -0
  14. data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +0 -16
  15. data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +12 -3
  16. data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +198 -0
  17. data/lib/twilio-ruby/rest/client.rb +35 -15
  18. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +28 -3
  19. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +27 -4
  20. data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +2 -1
  21. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
  22. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +6 -3
  23. data/lib/twilio-ruby/rest/monitor/v1/alert.rb +8 -8
  24. data/lib/twilio-ruby/rest/notify/v1/service.rb +20 -1
  25. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +26 -0
  26. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +324 -0
  27. data/lib/twilio-ruby/rest/preview.rb +6 -0
  28. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +7 -0
  29. data/lib/twilio-ruby/rest/preview/trusted_comms/brands_information.rb +193 -0
  30. data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +26 -0
  31. data/lib/twilio-ruby/rest/{autopilot/v1/assistant/export_assistant.rb → preview/trusted_comms/business/brand.rb} +88 -71
  32. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +266 -0
  33. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +194 -0
  34. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +7 -0
  35. data/lib/twilio-ruby/rest/supersim.rb +18 -0
  36. data/lib/twilio-ruby/rest/supersim/v1.rb +30 -0
  37. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +63 -16
  38. data/lib/twilio-ruby/rest/supersim/v1/network.rb +315 -0
  39. data/lib/twilio-ruby/rest/{authy/v1/service.rb → supersim/v1/network_access_profile.rb} +95 -121
  40. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +352 -0
  41. data/lib/twilio-ruby/rest/verify.rb +9 -0
  42. data/lib/twilio-ruby/rest/verify/v2.rb +16 -0
  43. data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/form.rb +8 -8
  44. data/lib/twilio-ruby/rest/verify/v2/service.rb +74 -3
  45. data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/service/entity.rb +32 -8
  46. data/lib/twilio-ruby/rest/verify/v2/service/entity/access_token.rb +141 -0
  47. data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/service/entity/factor.rb +8 -8
  48. data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/service/entity/factor/challenge.rb +8 -8
  49. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -3
  50. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +425 -0
  51. data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +8 -4
  52. data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +8 -4
  53. data/lib/twilio-ruby/rest/voice.rb +36 -0
  54. data/lib/twilio-ruby/rest/voice/v1.rb +64 -0
  55. data/lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb +513 -0
  56. data/lib/twilio-ruby/rest/voice/v1/connection_policy.rb +379 -0
  57. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +458 -0
  58. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +366 -0
  59. data/lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb +346 -0
  60. data/lib/twilio-ruby/util/configuration.rb +9 -1
  61. data/lib/twilio-ruby/version.rb +1 -1
  62. data/spec/integration/api/v2010/account/call_spec.rb +5 -5
  63. data/spec/integration/api/v2010/account/conference/participant_spec.rb +177 -0
  64. data/spec/integration/api/v2010/account/conference_spec.rb +42 -14
  65. data/spec/integration/api/v2010/account/outgoing_caller_id_spec.rb +8 -14
  66. data/spec/integration/api/v2010/account/sip/domain_spec.rb +12 -4
  67. data/spec/integration/api/v2010/account/token_spec.rb +23 -11
  68. data/spec/integration/api/v2010/account/validation_request_spec.rb +1 -1
  69. data/spec/integration/autopilot/v1/assistant/query_spec.rb +4 -4
  70. data/spec/integration/autopilot/v1/assistant_spec.rb +4 -8
  71. data/spec/integration/autopilot/v1/restore_assistant_spec.rb +53 -0
  72. data/spec/integration/conversations/v1/conversation/participant_spec.rb +7 -0
  73. data/spec/integration/conversations/v1/conversation_spec.rb +16 -0
  74. data/spec/integration/flex_api/v1/configuration_spec.rb +3 -0
  75. data/spec/integration/numbers/v2/regulatory_compliance/bundle/evaluation_spec.rb +623 -0
  76. data/spec/integration/numbers/v2/regulatory_compliance/bundle_spec.rb +4 -0
  77. data/spec/integration/preview/trusted_comms/brands_information_spec.rb +44 -0
  78. data/spec/integration/preview/trusted_comms/business/brand/branded_channel/channel_spec.rb +54 -0
  79. data/spec/integration/preview/trusted_comms/business/brand/branded_channel_spec.rb +52 -0
  80. data/spec/integration/preview/trusted_comms/business/brand_spec.rb +49 -0
  81. data/spec/integration/preview/trusted_comms/business_spec.rb +1 -0
  82. data/spec/integration/serverless/v1/service/environment/log_spec.rb +1 -0
  83. data/spec/integration/supersim/v1/fleet_spec.rb +16 -7
  84. data/spec/integration/supersim/v1/network_access_profile/network_access_profile_network_spec.rb +179 -0
  85. data/spec/integration/supersim/v1/network_access_profile_spec.rb +223 -0
  86. data/spec/integration/supersim/v1/network_spec.rb +139 -0
  87. data/spec/integration/supersim/v1/sim_spec.rb +78 -6
  88. data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +13 -13
  89. data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +23 -23
  90. data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +28 -28
  91. data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +17 -17
  92. data/spec/integration/trunking/v1/trunk_spec.rb +33 -33
  93. data/spec/integration/{authy/v1 → verify/v2}/form_spec.rb +4 -4
  94. data/spec/integration/verify/v2/service/entity/access_token_spec.rb +46 -0
  95. data/spec/integration/{authy/v1 → verify/v2}/service/entity/factor/challenge_spec.rb +73 -73
  96. data/spec/integration/{authy/v1 → verify/v2}/service/entity/factor_spec.rb +54 -54
  97. data/spec/integration/verify/v2/service/entity_spec.rb +204 -0
  98. data/spec/integration/verify/v2/service/webhook_spec.rb +262 -0
  99. data/spec/integration/verify/v2/service_spec.rb +32 -4
  100. data/spec/integration/voice/v1/byoc_trunk_spec.rb +250 -0
  101. data/spec/integration/voice/v1/connection_policy/connection_policy_target_spec.rb +246 -0
  102. data/spec/integration/voice/v1/connection_policy_spec.rb +226 -0
  103. data/spec/integration/voice/v1/ip_record_spec.rb +223 -0
  104. data/spec/integration/voice/v1/source_ip_mapping_spec.rb +219 -0
  105. data/spec/rest/client_spec.rb +168 -58
  106. data/spec/util/configuration_spec.rb +12 -0
  107. data/twilio-ruby.gemspec +1 -1
  108. metadata +63 -23
  109. data/lib/twilio-ruby/rest/authy.rb +0 -55
  110. data/lib/twilio-ruby/rest/authy/v1.rb +0 -59
  111. data/spec/integration/authy/v1/service/entity_spec.rb +0 -201
  112. data/spec/integration/authy/v1/service_spec.rb +0 -231
  113. data/spec/integration/autopilot/v1/assistant/export_assistant_spec.rb +0 -49
@@ -45,8 +45,11 @@ module Twilio
45
45
  # at the end of an SMS verification body. Disabled by default and applies only to
46
46
  # SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share
47
47
  # this code with anyone; our employees will never ask for the code`
48
+ # @param [Boolean] custom_code_enabled Whether to allow sending verifications with
49
+ # a custom code instead of a randomly generated one. Not available for all
50
+ # customers.
48
51
  # @return [ServiceInstance] Newly created ServiceInstance
49
- def create(friendly_name: nil, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset)
52
+ def create(friendly_name: nil, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset)
50
53
  data = Twilio::Values.of({
51
54
  'FriendlyName' => friendly_name,
52
55
  'CodeLength' => code_length,
@@ -56,6 +59,7 @@ module Twilio
56
59
  'TtsName' => tts_name,
57
60
  'Psd2Enabled' => psd2_enabled,
58
61
  'DoNotShareWarningEnabled' => do_not_share_warning_enabled,
62
+ 'CustomCodeEnabled' => custom_code_enabled,
59
63
  })
60
64
 
61
65
  payload = @version.create(
@@ -204,6 +208,8 @@ module Twilio
204
208
  @verification_checks = nil
205
209
  @rate_limits = nil
206
210
  @messaging_configurations = nil
211
+ @entities = nil
212
+ @webhooks = nil
207
213
  end
208
214
 
209
215
  ##
@@ -247,8 +253,11 @@ module Twilio
247
253
  # starting a verification.
248
254
  # @param [Boolean] do_not_share_warning_enabled Whether to add a privacy warning
249
255
  # at the end of an SMS. **Disabled by default and applies only for SMS.**
256
+ # @param [Boolean] custom_code_enabled Whether to allow sending verifications with
257
+ # a custom code instead of a randomly generated one. Not available for all
258
+ # customers.
250
259
  # @return [ServiceInstance] Updated ServiceInstance
251
- def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset)
260
+ def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset)
252
261
  data = Twilio::Values.of({
253
262
  'FriendlyName' => friendly_name,
254
263
  'CodeLength' => code_length,
@@ -258,6 +267,7 @@ module Twilio
258
267
  'TtsName' => tts_name,
259
268
  'Psd2Enabled' => psd2_enabled,
260
269
  'DoNotShareWarningEnabled' => do_not_share_warning_enabled,
270
+ 'CustomCodeEnabled' => custom_code_enabled,
261
271
  })
262
272
 
263
273
  payload = @version.update(
@@ -335,6 +345,42 @@ module Twilio
335
345
  @messaging_configurations
336
346
  end
337
347
 
348
+ ##
349
+ # Access the entities
350
+ # @return [EntityList]
351
+ # @return [EntityContext] if identity was passed.
352
+ def entities(identity=:unset)
353
+ raise ArgumentError, 'identity cannot be nil' if identity.nil?
354
+
355
+ if identity != :unset
356
+ return EntityContext.new(@version, @solution[:sid], identity, )
357
+ end
358
+
359
+ unless @entities
360
+ @entities = EntityList.new(@version, service_sid: @solution[:sid], )
361
+ end
362
+
363
+ @entities
364
+ end
365
+
366
+ ##
367
+ # Access the webhooks
368
+ # @return [WebhookList]
369
+ # @return [WebhookContext] if sid was passed.
370
+ def webhooks(sid=:unset)
371
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
372
+
373
+ if sid != :unset
374
+ return WebhookContext.new(@version, @solution[:sid], sid, )
375
+ end
376
+
377
+ unless @webhooks
378
+ @webhooks = WebhookList.new(@version, service_sid: @solution[:sid], )
379
+ end
380
+
381
+ @webhooks
382
+ end
383
+
338
384
  ##
339
385
  # Provide a user friendly representation
340
386
  def to_s
@@ -373,6 +419,7 @@ module Twilio
373
419
  'dtmf_input_required' => payload['dtmf_input_required'],
374
420
  'tts_name' => payload['tts_name'],
375
421
  'do_not_share_warning_enabled' => payload['do_not_share_warning_enabled'],
422
+ 'custom_code_enabled' => payload['custom_code_enabled'],
376
423
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
377
424
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
378
425
  'url' => payload['url'],
@@ -455,6 +502,12 @@ module Twilio
455
502
  @properties['do_not_share_warning_enabled']
456
503
  end
457
504
 
505
+ ##
506
+ # @return [Boolean] Whether to allow sending verifications with a custom code.
507
+ def custom_code_enabled
508
+ @properties['custom_code_enabled']
509
+ end
510
+
458
511
  ##
459
512
  # @return [Time] The RFC 2822 date and time in GMT when the resource was created
460
513
  def date_created
@@ -512,8 +565,11 @@ module Twilio
512
565
  # starting a verification.
513
566
  # @param [Boolean] do_not_share_warning_enabled Whether to add a privacy warning
514
567
  # at the end of an SMS. **Disabled by default and applies only for SMS.**
568
+ # @param [Boolean] custom_code_enabled Whether to allow sending verifications with
569
+ # a custom code instead of a randomly generated one. Not available for all
570
+ # customers.
515
571
  # @return [ServiceInstance] Updated ServiceInstance
516
- def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset)
572
+ def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset)
517
573
  context.update(
518
574
  friendly_name: friendly_name,
519
575
  code_length: code_length,
@@ -523,6 +579,7 @@ module Twilio
523
579
  tts_name: tts_name,
524
580
  psd2_enabled: psd2_enabled,
525
581
  do_not_share_warning_enabled: do_not_share_warning_enabled,
582
+ custom_code_enabled: custom_code_enabled,
526
583
  )
527
584
  end
528
585
 
@@ -554,6 +611,20 @@ module Twilio
554
611
  context.messaging_configurations
555
612
  end
556
613
 
614
+ ##
615
+ # Access the entities
616
+ # @return [entities] entities
617
+ def entities
618
+ context.entities
619
+ end
620
+
621
+ ##
622
+ # Access the webhooks
623
+ # @return [webhooks] webhooks
624
+ def webhooks
625
+ context.webhooks
626
+ end
627
+
557
628
  ##
558
629
  # Provide a user friendly representation
559
630
  def to_s
@@ -8,8 +8,8 @@
8
8
 
9
9
  module Twilio
10
10
  module REST
11
- class Authy < Domain
12
- class V1 < Version
11
+ class Verify < Domain
12
+ class V2 < Version
13
13
  class ServiceContext < InstanceContext
14
14
  ##
15
15
  # 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.
@@ -129,7 +129,7 @@ module Twilio
129
129
  ##
130
130
  # Provide a user friendly representation
131
131
  def to_s
132
- '#<Twilio.Authy.V1.EntityList>'
132
+ '#<Twilio.Verify.V2.EntityList>'
133
133
  end
134
134
  end
135
135
 
@@ -160,7 +160,7 @@ module Twilio
160
160
  ##
161
161
  # Provide a user friendly representation
162
162
  def to_s
163
- '<Twilio.Authy.V1.EntityPage>'
163
+ '<Twilio.Verify.V2.EntityPage>'
164
164
  end
165
165
  end
166
166
 
@@ -182,6 +182,7 @@ module Twilio
182
182
 
183
183
  # Dependents
184
184
  @factors = nil
185
+ @access_tokens = nil
185
186
  end
186
187
 
187
188
  ##
@@ -233,18 +234,34 @@ module Twilio
233
234
  @factors
234
235
  end
235
236
 
237
+ ##
238
+ # Access the access_tokens
239
+ # @return [AccessTokenList]
240
+ # @return [AccessTokenContext]
241
+ def access_tokens
242
+ unless @access_tokens
243
+ @access_tokens = AccessTokenList.new(
244
+ @version,
245
+ service_sid: @solution[:service_sid],
246
+ identity: @solution[:identity],
247
+ )
248
+ end
249
+
250
+ @access_tokens
251
+ end
252
+
236
253
  ##
237
254
  # Provide a user friendly representation
238
255
  def to_s
239
256
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
240
- "#<Twilio.Authy.V1.EntityContext #{context}>"
257
+ "#<Twilio.Verify.V2.EntityContext #{context}>"
241
258
  end
242
259
 
243
260
  ##
244
261
  # Provide a detailed, user friendly representation
245
262
  def inspect
246
263
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
247
- "#<Twilio.Authy.V1.EntityContext #{context}>"
264
+ "#<Twilio.Verify.V2.EntityContext #{context}>"
248
265
  end
249
266
  end
250
267
 
@@ -358,18 +375,25 @@ module Twilio
358
375
  context.factors
359
376
  end
360
377
 
378
+ ##
379
+ # Access the access_tokens
380
+ # @return [access_tokens] access_tokens
381
+ def access_tokens
382
+ context.access_tokens
383
+ end
384
+
361
385
  ##
362
386
  # Provide a user friendly representation
363
387
  def to_s
364
388
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
365
- "<Twilio.Authy.V1.EntityInstance #{values}>"
389
+ "<Twilio.Verify.V2.EntityInstance #{values}>"
366
390
  end
367
391
 
368
392
  ##
369
393
  # Provide a detailed, user friendly representation
370
394
  def inspect
371
395
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
372
- "<Twilio.Authy.V1.EntityInstance #{values}>"
396
+ "<Twilio.Verify.V2.EntityInstance #{values}>"
373
397
  end
374
398
  end
375
399
  end
@@ -0,0 +1,141 @@
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 Verify < Domain
12
+ class V2 < Version
13
+ class ServiceContext < InstanceContext
14
+ class EntityContext < InstanceContext
15
+ ##
16
+ # 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.
17
+ class AccessTokenList < ListResource
18
+ ##
19
+ # Initialize the AccessTokenList
20
+ # @param [Version] version Version that contains the resource
21
+ # @param [String] service_sid The unique SID identifier of the Service.
22
+ # @param [String] identity Customer unique identity for the Entity of the Service.
23
+ # This could be anything the customer wants, an email, a phone number, a Twitter
24
+ # handle, a site username, etc.
25
+ # @return [AccessTokenList] AccessTokenList
26
+ def initialize(version, service_sid: nil, identity: nil)
27
+ super(version)
28
+
29
+ # Path Solution
30
+ @solution = {service_sid: service_sid, identity: identity}
31
+ @uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}/AccessTokens"
32
+ end
33
+
34
+ ##
35
+ # Retrieve a single page of AccessTokenInstance records from the API.
36
+ # Request is executed immediately.
37
+ # @param [access_token.FactorTypes] factor_type The Type of this Factor. eg. push
38
+ # @return [AccessTokenInstance] Newly created AccessTokenInstance
39
+ def create(factor_type: nil)
40
+ data = Twilio::Values.of({'FactorType' => factor_type, })
41
+
42
+ payload = @version.create(
43
+ 'POST',
44
+ @uri,
45
+ data: data
46
+ )
47
+
48
+ AccessTokenInstance.new(
49
+ @version,
50
+ payload,
51
+ service_sid: @solution[:service_sid],
52
+ identity: @solution[:identity],
53
+ )
54
+ end
55
+
56
+ ##
57
+ # Provide a user friendly representation
58
+ def to_s
59
+ '#<Twilio.Verify.V2.AccessTokenList>'
60
+ end
61
+ end
62
+
63
+ ##
64
+ # 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.
65
+ class AccessTokenPage < Page
66
+ ##
67
+ # Initialize the AccessTokenPage
68
+ # @param [Version] version Version that contains the resource
69
+ # @param [Response] response Response from the API
70
+ # @param [Hash] solution Path solution for the resource
71
+ # @return [AccessTokenPage] AccessTokenPage
72
+ def initialize(version, response, solution)
73
+ super(version, response)
74
+
75
+ # Path Solution
76
+ @solution = solution
77
+ end
78
+
79
+ ##
80
+ # Build an instance of AccessTokenInstance
81
+ # @param [Hash] payload Payload response from the API
82
+ # @return [AccessTokenInstance] AccessTokenInstance
83
+ def get_instance(payload)
84
+ AccessTokenInstance.new(
85
+ @version,
86
+ payload,
87
+ service_sid: @solution[:service_sid],
88
+ identity: @solution[:identity],
89
+ )
90
+ end
91
+
92
+ ##
93
+ # Provide a user friendly representation
94
+ def to_s
95
+ '<Twilio.Verify.V2.AccessTokenPage>'
96
+ end
97
+ end
98
+
99
+ ##
100
+ # 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.
101
+ class AccessTokenInstance < InstanceResource
102
+ ##
103
+ # Initialize the AccessTokenInstance
104
+ # @param [Version] version Version that contains the resource
105
+ # @param [Hash] payload payload that contains response from Twilio
106
+ # @param [String] service_sid The unique SID identifier of the Service.
107
+ # @param [String] identity Customer unique identity for the Entity of the Service.
108
+ # This could be anything the customer wants, an email, a phone number, a Twitter
109
+ # handle, a site username, etc.
110
+ # @return [AccessTokenInstance] AccessTokenInstance
111
+ def initialize(version, payload, service_sid: nil, identity: nil)
112
+ super(version)
113
+
114
+ # Marshaled Properties
115
+ @properties = {'token' => payload['token'], }
116
+ end
117
+
118
+ ##
119
+ # @return [String] Generated access token.
120
+ def token
121
+ @properties['token']
122
+ end
123
+
124
+ ##
125
+ # Provide a user friendly representation
126
+ def to_s
127
+ "<Twilio.Verify.V2.AccessTokenInstance>"
128
+ end
129
+
130
+ ##
131
+ # Provide a detailed, user friendly representation
132
+ def inspect
133
+ "<Twilio.Verify.V2.AccessTokenInstance>"
134
+ end
135
+ end
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
@@ -8,8 +8,8 @@
8
8
 
9
9
  module Twilio
10
10
  module REST
11
- class Authy < Domain
12
- class V1 < Version
11
+ class Verify < Domain
12
+ class V2 < Version
13
13
  class ServiceContext < InstanceContext
14
14
  class EntityContext < InstanceContext
15
15
  ##
@@ -150,7 +150,7 @@ module Twilio
150
150
  ##
151
151
  # Provide a user friendly representation
152
152
  def to_s
153
- '#<Twilio.Authy.V1.FactorList>'
153
+ '#<Twilio.Verify.V2.FactorList>'
154
154
  end
155
155
  end
156
156
 
@@ -186,7 +186,7 @@ module Twilio
186
186
  ##
187
187
  # Provide a user friendly representation
188
188
  def to_s
189
- '<Twilio.Authy.V1.FactorPage>'
189
+ '<Twilio.Verify.V2.FactorPage>'
190
190
  end
191
191
  end
192
192
 
@@ -303,14 +303,14 @@ module Twilio
303
303
  # Provide a user friendly representation
304
304
  def to_s
305
305
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
306
- "#<Twilio.Authy.V1.FactorContext #{context}>"
306
+ "#<Twilio.Verify.V2.FactorContext #{context}>"
307
307
  end
308
308
 
309
309
  ##
310
310
  # Provide a detailed, user friendly representation
311
311
  def inspect
312
312
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
313
- "#<Twilio.Authy.V1.FactorContext #{context}>"
313
+ "#<Twilio.Verify.V2.FactorContext #{context}>"
314
314
  end
315
315
  end
316
316
 
@@ -482,14 +482,14 @@ module Twilio
482
482
  # Provide a user friendly representation
483
483
  def to_s
484
484
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
485
- "<Twilio.Authy.V1.FactorInstance #{values}>"
485
+ "<Twilio.Verify.V2.FactorInstance #{values}>"
486
486
  end
487
487
 
488
488
  ##
489
489
  # Provide a detailed, user friendly representation
490
490
  def inspect
491
491
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
492
- "<Twilio.Authy.V1.FactorInstance #{values}>"
492
+ "<Twilio.Verify.V2.FactorInstance #{values}>"
493
493
  end
494
494
  end
495
495
  end