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 date and time in GMT when the refresh token expires in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
- #id_token ⇒ String
-
#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 date and time in GMT when the refresh token expires in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, payload) ⇒ TokenInstance
Initialize the TokenInstance
119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 119 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.
135 136 137 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 135 def access_token @properties['access_token'] end |
#access_token_expires_at ⇒ Time
Returns The date and time in GMT when the refresh token expires in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
159 160 161 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 159 def access_token_expires_at @properties['access_token_expires_at'] end |
#id_token ⇒ String
147 148 149 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 147 def id_token @properties['id_token'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
171 172 173 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 171 def inspect "<Twilio.Oauth.V1.TokenInstance>" end |
#refresh_token ⇒ String
Returns Token which carries the information necessary to get a new access token.
141 142 143 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 141 def refresh_token @properties['refresh_token'] end |
#refresh_token_expires_at ⇒ Time
Returns The date and time in GMT when the refresh token expires in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
153 154 155 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 153 def refresh_token_expires_at @properties['refresh_token_expires_at'] end |
#to_s ⇒ Object
Provide a user friendly representation
165 166 167 |
# File 'lib/twilio-ruby/rest/oauth/v1/token.rb', line 165 def to_s "<Twilio.Oauth.V1.TokenInstance>" end |