Class: Gusto::Token::TokenGetSystemAccessTokenResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/token/types/token_get_system_access_token_response.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token:, token_type:, created_at:, expires_in:, additional_properties: nil) ⇒ Gusto::Token::TokenGetSystemAccessTokenResponse

Parameters:

  • access_token (String)

    The system access token

  • token_type (String)
  • created_at (Integer)

    Unix timestamp when the token was created

  • expires_in (Integer)

    Number of seconds until the token expires

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



30
31
32
33
34
35
36
37
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 30

def initialize(access_token:, token_type:, created_at:, expires_in:, additional_properties: nil)
  @access_token = access_token
  @token_type = token_type
  @created_at = created_at
  @expires_in = expires_in
  @additional_properties = additional_properties
  @_field_set = { "access_token": access_token, "token_type": token_type, "created_at": created_at, "expires_in": expires_in }
end

Instance Attribute Details

#access_tokenString (readonly)

Returns The system access token.

Returns:

  • (String)

    The system access token



9
10
11
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 9

def access_token
  @access_token
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



17
18
19
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 17

def additional_properties
  @additional_properties
end

#created_atInteger (readonly)

Returns Unix timestamp when the token was created.

Returns:

  • (Integer)

    Unix timestamp when the token was created



13
14
15
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 13

def created_at
  @created_at
end

#expires_inInteger (readonly)

Returns Number of seconds until the token expires.

Returns:

  • (Integer)

    Number of seconds until the token expires



15
16
17
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 15

def expires_in
  @expires_in
end

#token_typeString (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 11

def token_type
  @token_type
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::Token::TokenGetSystemAccessTokenResponse

Parameters:

  • json_object (String)

Returns:



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 42

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  access_token = parsed_json["access_token"]
  token_type = parsed_json["token_type"]
  created_at = parsed_json["created_at"]
  expires_in = parsed_json["expires_in"]
  new(
    access_token: access_token,
    token_type: token_type,
    created_at: created_at,
    expires_in: expires_in,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


69
70
71
72
73
74
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 69

def self.validate_raw(obj:)
  obj.access_token.is_a?(String) != false || raise("Passed value for field obj.access_token is not the expected type, validation failed.")
  obj.token_type.is_a?(String) != false || raise("Passed value for field obj.token_type is not the expected type, validation failed.")
  obj.created_at.is_a?(Integer) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
  obj.expires_in.is_a?(Integer) != false || raise("Passed value for field obj.expires_in is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


60
61
62
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 60

def to_json
  @_field_set&.to_json
end