Class: Gusto::Token::TokenGetInfoResponseResource

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

Overview

Information about the token resource.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, uuid:, additional_properties: nil) ⇒ Gusto::Token::TokenGetInfoResponseResource

Parameters:

  • type (String)

    Type of object

  • uuid (String)

    UUID of object

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



25
26
27
28
29
30
# File 'lib/fern_gusto/token/types/token_get_info_response_resource.rb', line 25

def initialize(type:, uuid:, additional_properties: nil)
  @type = type
  @uuid = uuid
  @additional_properties = additional_properties
  @_field_set = { "type": type, "uuid": uuid }
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



14
15
16
# File 'lib/fern_gusto/token/types/token_get_info_response_resource.rb', line 14

def additional_properties
  @additional_properties
end

#typeString (readonly)

Returns Type of object.

Returns:

  • (String)

    Type of object



10
11
12
# File 'lib/fern_gusto/token/types/token_get_info_response_resource.rb', line 10

def type
  @type
end

#uuidString (readonly)

Returns UUID of object.

Returns:

  • (String)

    UUID of object



12
13
14
# File 'lib/fern_gusto/token/types/token_get_info_response_resource.rb', line 12

def uuid
  @uuid
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fern_gusto/token/types/token_get_info_response_resource.rb', line 35

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  type = parsed_json["type"]
  uuid = parsed_json["uuid"]
  new(
    type: type,
    uuid: uuid,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


58
59
60
61
# File 'lib/fern_gusto/token/types/token_get_info_response_resource.rb', line 58

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

Instance Method Details

#to_jsonString

Returns:

  • (String)


49
50
51
# File 'lib/fern_gusto/token/types/token_get_info_response_resource.rb', line 49

def to_json
  @_field_set&.to_json
end