Class: Gusto::EmployeeAddress
- Inherits:
-
Object
- Object
- Gusto::EmployeeAddress
- Defined in:
- lib/fern_gusto/types/employee_address.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
have historical data associated with them.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #city ⇒ String readonly
- #country ⇒ String readonly
-
#courtesy_withholding ⇒ Boolean
readonly
Determines if home taxes should be withheld and paid for employee.
-
#effective_date ⇒ String
readonly
The date the employee started living at the address.
-
#employee_uuid ⇒ String
readonly
The UUID of the employee.
- #state ⇒ String readonly
- #street1 ⇒ String readonly
- #street2 ⇒ String readonly
-
#uuid ⇒ String
readonly
The UUID of the employee address.
-
#version ⇒ Object
readonly
on how to use this field.
- #zip ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #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 constructor
- #to_json ⇒ String
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
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
#active ⇒ Object (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_properties ⇒ OpenStruct (readonly)
Returns 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 |
#city ⇒ String (readonly)
20 21 22 |
# File 'lib/fern_gusto/types/employee_address.rb', line 20 def city @city end |
#country ⇒ String (readonly)
26 27 28 |
# File 'lib/fern_gusto/types/employee_address.rb', line 26 def country @country end |
#courtesy_withholding ⇒ Boolean (readonly)
Returns 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_date ⇒ String (readonly)
Returns 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_uuid ⇒ String (readonly)
Returns The UUID of the employee.
10 11 12 |
# File 'lib/fern_gusto/types/employee_address.rb', line 10 def employee_uuid @employee_uuid end |
#state ⇒ String (readonly)
22 23 24 |
# File 'lib/fern_gusto/types/employee_address.rb', line 22 def state @state end |
#street1 ⇒ String (readonly)
16 17 18 |
# File 'lib/fern_gusto/types/employee_address.rb', line 16 def street1 @street1 end |
#street2 ⇒ String (readonly)
18 19 20 |
# File 'lib/fern_gusto/types/employee_address.rb', line 18 def street2 @street2 end |
#uuid ⇒ String (readonly)
Returns The UUID of the employee address.
8 9 10 |
# File 'lib/fern_gusto/types/employee_address.rb', line 8 def uuid @uuid end |
#version ⇒ Object (readonly)
on how to use this field.
33 34 35 |
# File 'lib/fern_gusto/types/employee_address.rb', line 33 def version @version end |
#zip ⇒ String (readonly)
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
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
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_json ⇒ String
115 116 117 |
# File 'lib/fern_gusto/types/employee_address.rb', line 115 def to_json @_field_set&.to_json end |