Class: Twilio::REST::Oauth::V1::TokenInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Oauth::V1::TokenInstance
- Defined in:
- lib/twilio-ruby/rest/oauth/v1/token.rb
Instance Method Summary collapse
-
#access_token ⇒ String
Token which carries the necessary information to access a Twilio resource directly.
-
#access_token_expires_at ⇒ Time
The RFC 2822 date and time in GMT when the access token expires.
-
#id_token ⇒ String
The id_token.
-
#initialize(version, payload) ⇒ TokenInstance
constructor
Initialize the TokenInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#refresh_token ⇒ String
Token which carries the information necessary to get a new access token.
-
#refresh_token_expires_at ⇒ Time
The RFC 2822 date and time in GMT when the refresh token expires.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, payload) ⇒ TokenInstance
Initialize the TokenInstance
99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 99 def initialize(version, payload) super(version) # Marshaled Properties @properties = { 'access_token' => payload['access_token'], 'refresh_token' => payload['refresh_token'], 'id_token' => payload['id_token'], 'refresh_token_expires_at' => Twilio.deserialize_iso8601_datetime(payload['refresh_token_expires_at']), 'access_token_expires_at' => Twilio.deserialize_iso8601_datetime(payload['access_token_expires_at']), } end |
Instance Method Details
#access_token ⇒ String
Returns Token which carries the necessary information to access a Twilio resource directly.
114 115 116 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 114 def access_token @properties['access_token'] end |
#access_token_expires_at ⇒ Time
Returns The RFC 2822 date and time in GMT when the access token expires.
138 139 140 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 138 def access_token_expires_at @properties['access_token_expires_at'] end |
#id_token ⇒ String
Returns The id_token.
126 127 128 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 126 def id_token @properties['id_token'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
150 151 152 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 150 def inspect "<Twilio.Oauth.V1.TokenInstance>" end |
#refresh_token ⇒ String
Returns Token which carries the information necessary to get a new access token.
120 121 122 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 120 def refresh_token @properties['refresh_token'] end |
#refresh_token_expires_at ⇒ Time
Returns The RFC 2822 date and time in GMT when the refresh token expires.
132 133 134 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 132 def refresh_token_expires_at @properties['refresh_token_expires_at'] end |
#to_s ⇒ Object
Provide a user friendly representation
144 145 146 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 144 def to_s "<Twilio.Oauth.V1.TokenInstance>" end |