Class: Twilio::REST::Api::V2010::AccountContext::TokenList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Api::V2010::AccountContext::TokenList
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/token.rb
Instance Method Summary collapse
-
#create(ttl: :unset) ⇒ TokenInstance
Retrieve a single page of TokenInstance records from the API.
-
#initialize(version, account_sid: nil) ⇒ TokenList
constructor
Initialize the TokenList.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, account_sid: nil) ⇒ TokenList
Initialize the TokenList
19 20 21 22 23 24 25 |
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 19 def initialize(version, account_sid: nil) super(version) # Path Solution @solution = {account_sid: account_sid} @uri = "/Accounts/#{@solution[:account_sid]}/Tokens.json" end |
Instance Method Details
#create(ttl: :unset) ⇒ TokenInstance
Retrieve a single page of TokenInstance records from the API. Request is executed immediately.
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 33 def create(ttl: :unset) data = Twilio::Values.of({'Ttl' => ttl, }) payload = @version.create( 'POST', @uri, data: data ) TokenInstance.new(@version, payload, account_sid: @solution[:account_sid], ) end |
#to_s ⇒ Object
Provide a user friendly representation
47 48 49 |
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 47 def to_s '#<Twilio.Api.V2010.TokenList>' end |