Class: Gusto::HistoricalEmployeeBodyHomeAddress

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, additional_properties: nil) ⇒ Gusto::HistoricalEmployeeBodyHomeAddress

Parameters:

  • street1 (String) (defaults to: OMIT)
  • street2 (String) (defaults to: OMIT)
  • city (String) (defaults to: OMIT)
  • state (String) (defaults to: OMIT)
  • zip (String) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/fern_gusto/types/historical_employee_body_home_address.rb', line 32

def initialize(street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, additional_properties: nil)
  @street1 = street1 if street1 != OMIT
  @street2 = street2 if street2 != OMIT
  @city = city if city != OMIT
  @state = state if state != OMIT
  @zip = zip if zip != OMIT
  @additional_properties = additional_properties
  @_field_set = { "street_1": street1, "street_2": street2, "city": city, "state": state, "zip": zip }.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



18
19
20
# File 'lib/fern_gusto/types/historical_employee_body_home_address.rb', line 18

def additional_properties
  @additional_properties
end

#cityString (readonly)

Returns:

  • (String)


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

def city
  @city
end

#stateString (readonly)

Returns:

  • (String)


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

def state
  @state
end

#street1String (readonly)

Returns:

  • (String)


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

def street1
  @street1
end

#street2String (readonly)

Returns:

  • (String)


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

def street2
  @street2
end

#zipString (readonly)

Returns:

  • (String)


16
17
18
# File 'lib/fern_gusto/types/historical_employee_body_home_address.rb', line 16

def zip
  @zip
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::HistoricalEmployeeBodyHomeAddress

Parameters:

  • json_object (String)

Returns:



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/fern_gusto/types/historical_employee_body_home_address.rb', line 47

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  street1 = parsed_json["street_1"]
  street2 = parsed_json["street_2"]
  city = parsed_json["city"]
  state = parsed_json["state"]
  zip = parsed_json["zip"]
  new(
    street1: street1,
    street2: street2,
    city: city,
    state: state,
    zip: zip,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


76
77
78
79
80
81
82
# File 'lib/fern_gusto/types/historical_employee_body_home_address.rb', line 76

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

Instance Method Details

#to_jsonString

Returns:

  • (String)


67
68
69
# File 'lib/fern_gusto/types/historical_employee_body_home_address.rb', line 67

def to_json
  @_field_set&.to_json
end