Class: Gusto::ChildSupportDataAgenciesItemRequiredAttributesItem

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key: OMIT, label: OMIT, additional_properties: nil) ⇒ Gusto::ChildSupportDataAgenciesItemRequiredAttributesItem

Parameters:

  • label (String) (defaults to: OMIT)

    A human readable name of the attribute, e.g. CSE Case Number

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



28
29
30
31
32
33
34
35
# File 'lib/fern_gusto/types/child_support_data_agencies_item_required_attributes_item.rb', line 28

def initialize(key: OMIT, label: OMIT, additional_properties: nil)
  @key = key if key != OMIT
  @label = label if label != OMIT
  @additional_properties = additional_properties
  @_field_set = { "key": key, "label": label }.reject do | _k, v |
  v == OMIT
end
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



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

def additional_properties
  @additional_properties
end

#keyObject (readonly)

state agency requirements change in the future.



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

def key
  @key
end

#labelString (readonly)

Returns A human readable name of the attribute, e.g. CSE Case Number.

Returns:

  • (String)

    A human readable name of the attribute, e.g. CSE Case Number



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

def label
  @label
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::ChildSupportDataAgenciesItemRequiredAttributesItem

Parameters:

  • json_object (String)

Returns:



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/fern_gusto/types/child_support_data_agencies_item_required_attributes_item.rb', line 41

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

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


65
66
67
68
# File 'lib/fern_gusto/types/child_support_data_agencies_item_required_attributes_item.rb', line 65

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

Instance Method Details

#to_jsonString

Returns:

  • (String)


56
57
58
# File 'lib/fern_gusto/types/child_support_data_agencies_item_required_attributes_item.rb', line 56

def to_json
  @_field_set&.to_json
end