Class: Alula::TokenExchange::ImpersonatedToken

Inherits:
Object
  • Object
show all
Defined in:
lib/alula/resources/token_exchange.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ ImpersonatedToken

Returns a new instance of ImpersonatedToken.



70
71
72
73
74
75
76
77
78
79
80
# File 'lib/alula/resources/token_exchange.rb', line 70

def initialize(attributes)
  @raw_response = attributes

  @date_created = Time.parse(attributes['dateCreated'])
  @access_token = attributes['accessToken']
  @expires_at = Time.parse(attributes['expires'])
  @expires_in = (@expires_at - Time.now.utc).to_i
  @refresh_token = attributes['refresh_token']
  @scope = attributes['scope']
  @impersonated_by = attributes['impersonatedBy']
end

Instance Attribute Details

#access_tokenObject (readonly)

Simple Oauth::Response reader object



68
69
70
# File 'lib/alula/resources/token_exchange.rb', line 68

def access_token
  @access_token
end

#date_createdObject (readonly)

Simple Oauth::Response reader object



68
69
70
# File 'lib/alula/resources/token_exchange.rb', line 68

def date_created
  @date_created
end

#expires_atObject (readonly)

Simple Oauth::Response reader object



68
69
70
# File 'lib/alula/resources/token_exchange.rb', line 68

def expires_at
  @expires_at
end

#expires_inObject (readonly)

Simple Oauth::Response reader object



68
69
70
# File 'lib/alula/resources/token_exchange.rb', line 68

def expires_in
  @expires_in
end

#impersonated_byObject (readonly)

Simple Oauth::Response reader object



68
69
70
# File 'lib/alula/resources/token_exchange.rb', line 68

def impersonated_by
  @impersonated_by
end

#refresh_tokenObject (readonly)

Simple Oauth::Response reader object



68
69
70
# File 'lib/alula/resources/token_exchange.rb', line 68

def refresh_token
  @refresh_token
end

#scopeObject (readonly)

Simple Oauth::Response reader object



68
69
70
# File 'lib/alula/resources/token_exchange.rb', line 68

def scope
  @scope
end