Sha256: 61be1b54cf75637133d121973537b5fc5aae6f89d215aca767a39ec9bcb4f0bb

Contents?: true

Size: 1.06 KB

Versions: 3

Compression:

Stored size: 1.06 KB

Contents

require 'modelish'

module G5AuthenticationClient
  # G5 Authentication access token info
  class TokenInfo < Modelish::Base
    ignore_unknown_properties!

    # @!attribute [rw] resource_owner_id
    #   @return [String]
    #   The ID of the user that owns the resource
    property :resource_owner_id, type: String

    # @!attribute [rw] scopes
    #   @return [Array]
    #   The OAuth scopes associated with this token
    property :scopes, type: Array, default: []

    # @!attribute [rw] expires_in_seconds
    #   @return [Integer]
    #   The amount of time until the token expires
    property :expires_in_seconds, type: Integer

    # @!attribute [rw] application_uid
    #   @return [String]
    #   The UID of the OAuth application that requested this token
    property :application_uid, from: :application,
                               type: lambda { |val| (val[:uid] || val['uid']).to_s }

    # @!attribute [rw] created_at
    #   @return [Time]
    #   The token creation timestamp
    property :created_at, type: lambda { |val| Time.at(val.to_i) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
g5_authentication_client-0.5.5 lib/g5_authentication_client/token_info.rb
g5_authentication_client-1.0.0.pre.1 lib/g5_authentication_client/token_info.rb
g5_authentication_client-0.5.4 lib/g5_authentication_client/token_info.rb