class Twilio::REST::Api::V2010::AccountContext::TokenList

Public Class Methods

new(version, account_sid: nil) click to toggle source

Initialize the TokenList @param [Version] version Version that contains the resource @param [String] account_sid The SID of the

{Account}[https://www.twilio.com/docs/iam/api/account] that created the Token
resource.

@return [TokenList] TokenList

Calls superclass method Twilio::REST::ListResource::new
   # File lib/twilio-ruby/rest/api/v2010/account/token.rb
22 def initialize(version, account_sid: nil)
23   super(version)
24 
25   # Path Solution
26   @solution = {account_sid: account_sid}
27   @uri = "/Accounts/#{@solution[:account_sid]}/Tokens.json"
28 end

Public Instance Methods

create(ttl: :unset) click to toggle source

Create the TokenInstance @param [String] ttl The duration in seconds for which the generated credentials

are valid. The default value is 86400 (24 hours).

@return [TokenInstance] Created TokenInstance

   # File lib/twilio-ruby/rest/api/v2010/account/token.rb
35 def create(ttl: :unset)
36   data = Twilio::Values.of({'Ttl' => ttl, })
37 
38   payload = @version.create('POST', @uri, data: data)
39 
40   TokenInstance.new(@version, payload, account_sid: @solution[:account_sid], )
41 end
to_s() click to toggle source

Provide a user friendly representation

   # File lib/twilio-ruby/rest/api/v2010/account/token.rb
45 def to_s
46   '#<Twilio.Api.V2010.TokenList>'
47 end