Class: MundiApi::CreateAccessTokenRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mundi_api/models/create_access_token_request.rb

Overview

Request for creating a new Access Token

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(esxpires_in = nil) ⇒ CreateAccessTokenRequest

Returns a new instance of CreateAccessTokenRequest.



20
21
22
# File 'lib/mundi_api/models/create_access_token_request.rb', line 20

def initialize(esxpires_in = nil)
  @esxpires_in = esxpires_in
end

Instance Attribute Details

#esxpires_inInteger

Minutes to expire the token

Returns:

  • (Integer)


9
10
11
# File 'lib/mundi_api/models/create_access_token_request.rb', line 9

def esxpires_in
  @esxpires_in
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



25
26
27
28
29
30
31
32
33
# File 'lib/mundi_api/models/create_access_token_request.rb', line 25

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  esxpires_in = hash['esxpires_in']

  # Create object from extracted values.

  CreateAccessTokenRequest.new(esxpires_in)
end

.namesObject

A mapping from model property names to API property names.



12
13
14
15
16
17
18
# File 'lib/mundi_api/models/create_access_token_request.rb', line 12

def self.names
  if @_hash.nil?
    @_hash = {}
    @_hash['esxpires_in'] = 'esxpires_in'
  end
  @_hash
end