Class: Gusto::ChildSupportDataAgenciesItemFipsCodesItem

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code: OMIT, county: OMIT, additional_properties: nil) ⇒ Gusto::ChildSupportDataAgenciesItemFipsCodesItem

Parameters:

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



25
26
27
28
29
30
31
32
# File 'lib/fern_gusto/types/child_support_data_agencies_item_fips_codes_item.rb', line 25

def initialize(code: OMIT, county: OMIT, additional_properties: nil)
  @code = code if code != OMIT
  @county = county if county != OMIT
  @additional_properties = additional_properties
  @_field_set = { "code": code, "county": county }.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



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

def additional_properties
  @additional_properties
end

#codeString (readonly)

Returns FIPS code for state or county.

Returns:

  • (String)

    FIPS code for state or county



8
9
10
# File 'lib/fern_gusto/types/child_support_data_agencies_item_fips_codes_item.rb', line 8

def code
  @code
end

#countyObject (readonly)

FIPS code applies state wide.



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

def county
  @county
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::ChildSupportDataAgenciesItemFipsCodesItem

Parameters:

  • json_object (String)

Returns:



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/fern_gusto/types/child_support_data_agencies_item_fips_codes_item.rb', line 38

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

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


62
63
64
65
# File 'lib/fern_gusto/types/child_support_data_agencies_item_fips_codes_item.rb', line 62

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

Instance Method Details

#to_jsonString

Returns:

  • (String)


53
54
55
# File 'lib/fern_gusto/types/child_support_data_agencies_item_fips_codes_item.rb', line 53

def to_json
  @_field_set&.to_json
end