class Attio::OAuth::Token
def initialize(attributes = {})
def initialize(attributes = {}) # Since this doesn't inherit from Resources::Base, we need to normalize normalized_attrs = normalize_attributes(attributes) @access_token = normalized_attrs[:access_token] @refresh_token = normalized_attrs[:refresh_token] @token_type = normalized_attrs[:token_type] || "Bearer" @expires_in = normalized_attrs[:expires_in]&.to_i @scope = parse_scope(normalized_attrs[:scope]) @created_at = normalized_attrs[:created_at] || Time.now.utc @client = normalized_attrs[:client] calculate_expiration! validate! end