class Twilio::REST::Verify::V2::ServiceContext::AccessTokenList
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
new(version, service_sid: nil)
click to toggle source
Initialize the AccessTokenList
@param [Version] version Version
that contains the resource @param [String] service_sid The unique string that we created to identify the
Service resource.
@return [AccessTokenList] AccessTokenList
Calls superclass method
Twilio::REST::ListResource::new
# File lib/twilio-ruby/rest/verify/v2/service/access_token.rb 23 def initialize(version, service_sid: nil) 24 super(version) 25 26 # Path Solution 27 @solution = {service_sid: service_sid} 28 @uri = "/Services/#{@solution[:service_sid]}/AccessTokens" 29 end
Public Instance Methods
create(identity: nil, factor_type: nil)
click to toggle source
Create the AccessTokenInstance
@param [String] identity The unique external identifier for the Entity of the
Service. This identifier should be immutable, not PII, and generated by your external system, such as your user's UUID, GUID, or SID.
@param [access_token.FactorTypes] factor_type The Type of this Factor. Eg.
`push`
@return [AccessTokenInstance] Created AccessTokenInstance
# File lib/twilio-ruby/rest/verify/v2/service/access_token.rb 39 def create(identity: nil, factor_type: nil) 40 data = Twilio::Values.of({'Identity' => identity, 'FactorType' => factor_type, }) 41 42 payload = @version.create('POST', @uri, data: data) 43 44 AccessTokenInstance.new(@version, payload, service_sid: @solution[:service_sid], ) 45 end
to_s()
click to toggle source
Provide a user friendly representation
# File lib/twilio-ruby/rest/verify/v2/service/access_token.rb 49 def to_s 50 '#<Twilio.Verify.V2.AccessTokenList>' 51 end