Class: Gusto::EmployeeAddress

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid: OMIT, employee_uuid: OMIT, effective_date: OMIT, courtesy_withholding: OMIT, street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, active: OMIT, version: OMIT, additional_properties: nil) ⇒ Gusto::EmployeeAddress

Parameters:

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/fern_gusto/types/employee_address.rb', line 59

def initialize(uuid: OMIT, employee_uuid: OMIT, effective_date: OMIT, courtesy_withholding: OMIT, street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, active: OMIT, version: OMIT, additional_properties: nil)
  @uuid = uuid if uuid != OMIT
  @employee_uuid = employee_uuid if employee_uuid != OMIT
  @effective_date = effective_date if effective_date != OMIT
  @courtesy_withholding = courtesy_withholding if courtesy_withholding != OMIT
  @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
  @country = country if country != OMIT
  @active = active if active != OMIT
  @version = version if version != OMIT
  @additional_properties = additional_properties
  @_field_set = { "uuid": uuid, "employee_uuid": employee_uuid, "effective_date": effective_date, "courtesy_withholding": courtesy_withholding, "street_1": street1, "street_2": street2, "city": city, "state": state, "zip": zip, "country": country, "active": active, "version": version }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#activeObject (readonly)

have historical data associated with them.



29
30
31
# File 'lib/fern_gusto/types/employee_address.rb', line 29

def active
  @active
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



35
36
37
# File 'lib/fern_gusto/types/employee_address.rb', line 35

def additional_properties
  @additional_properties
end

#cityString (readonly)

Returns:

  • (String)


20
21
22
# File 'lib/fern_gusto/types/employee_address.rb', line 20

def city
  @city
end

#countryString (readonly)

Returns:

  • (String)


26
27
28
# File 'lib/fern_gusto/types/employee_address.rb', line 26

def country
  @country
end

#courtesy_withholdingBoolean (readonly)

Returns Determines if home taxes should be withheld and paid for employee.

Returns:

  • (Boolean)

    Determines if home taxes should be withheld and paid for employee.



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

def courtesy_withholding
  @courtesy_withholding
end

#effective_dateString (readonly)

Returns The date the employee started living at the address.

Returns:

  • (String)

    The date the employee started living at the address.



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

def effective_date
  @effective_date
end

#employee_uuidString (readonly)

Returns The UUID of the employee.

Returns:

  • (String)

    The UUID of the employee



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

def employee_uuid
  @employee_uuid
end

#stateString (readonly)

Returns:

  • (String)


22
23
24
# File 'lib/fern_gusto/types/employee_address.rb', line 22

def state
  @state
end

#street1String (readonly)

Returns:

  • (String)


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

def street1
  @street1
end

#street2String (readonly)

Returns:

  • (String)


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

def street2
  @street2
end

#uuidString (readonly)

Returns The UUID of the employee address.

Returns:

  • (String)

    The UUID of the employee address



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

def uuid
  @uuid
end

#versionObject (readonly)

on how to use this field.



33
34
35
# File 'lib/fern_gusto/types/employee_address.rb', line 33

def version
  @version
end

#zipString (readonly)

Returns:

  • (String)


24
25
26
# File 'lib/fern_gusto/types/employee_address.rb', line 24

def zip
  @zip
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::EmployeeAddress

Parameters:

  • json_object (String)

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/fern_gusto/types/employee_address.rb', line 81

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

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/fern_gusto/types/employee_address.rb', line 124

def self.validate_raw(obj:)
  obj.uuid&.is_a?(String) != false || raise("Passed value for field obj.uuid is not the expected type, validation failed.")
  obj.employee_uuid&.is_a?(String) != false || raise("Passed value for field obj.employee_uuid is not the expected type, validation failed.")
  obj.effective_date&.is_a?(String) != false || raise("Passed value for field obj.effective_date is not the expected type, validation failed.")
  obj.courtesy_withholding&.is_a?(Boolean) != false || raise("Passed value for field obj.courtesy_withholding is not the expected type, validation failed.")
  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.")
  obj.country&.is_a?(String) != false || raise("Passed value for field obj.country is not the expected type, validation failed.")
  obj.active&.is_a?(Boolean) != false || raise("Passed value for field obj.active is not the expected type, validation failed.")
  obj.version&.is_a?(String) != false || raise("Passed value for field obj.version is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


115
116
117
# File 'lib/fern_gusto/types/employee_address.rb', line 115

def to_json
  @_field_set&.to_json
end