Class: Twilio::REST::Verify::V2::ServiceContext::AccessTokenList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/verify/v2/service/access_token.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid: nil) ⇒ AccessTokenList

Initialize the AccessTokenList

Parameters:

  • version (Version)

    Version that contains the resource

  • service_sid (String) (defaults to: nil)

    The unique string that we created to identify the Service resource.


23
24
25
26
27
28
29
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 23

def initialize(version, service_sid: nil)
  super(version)

  # Path Solution
  @solution = {service_sid: service_sid}
  @uri = "/Services/#{@solution[:service_sid]}/AccessTokens"
end

Instance Method Details

#create(identity: nil, factor_type: nil) ⇒ AccessTokenInstance

Create the AccessTokenInstance

Parameters:

  • identity (String) (defaults to: nil)

    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.

  • factor_type (access_token.FactorTypes) (defaults to: nil)

    The Type of this Factor. Eg. `push`

Returns:


39
40
41
42
43
44
45
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 39

def create(identity: nil, factor_type: nil)
  data = Twilio::Values.of({'Identity' => identity, 'FactorType' => factor_type, })

  payload = @version.create('POST', @uri, data: data)

  AccessTokenInstance.new(@version, payload, service_sid: @solution[:service_sid], )
end

#to_sObject

Provide a user friendly representation


49
50
51
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 49

def to_s
  '#<Twilio.Verify.V2.AccessTokenList>'
end