Class: Gusto::EmployeeWorkAddress
- Inherits:
-
Object
- Object
- Gusto::EmployeeWorkAddress
- Defined in:
- lib/fern_gusto/types/employee_work_address.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#active ⇒ Boolean
readonly
Signifies if this address is the active work address for the current date.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #city ⇒ String readonly
- #country ⇒ String readonly
-
#effective_date ⇒ String
readonly
The date the employee began working at this location.
-
#employee_uuid ⇒ String
readonly
UUID reference to the employee for this work address.
-
#location_uuid ⇒ String
readonly
UUID reference to the company location for this work address.
- #state ⇒ String readonly
- #street1 ⇒ String readonly
- #street2 ⇒ String readonly
-
#uuid ⇒ String
readonly
The unique identifier of this work address.
-
#version ⇒ Object
readonly
on how to use this field.
- #zip ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(uuid:, effective_date: OMIT, active: OMIT, location_uuid: OMIT, employee_uuid: OMIT, version: OMIT, street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, additional_properties: nil) ⇒ Gusto::EmployeeWorkAddress constructor
- #to_json ⇒ String
Constructor Details
#initialize(uuid:, effective_date: OMIT, active: OMIT, location_uuid: OMIT, employee_uuid: OMIT, version: OMIT, street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, additional_properties: nil) ⇒ Gusto::EmployeeWorkAddress
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 57 def initialize(uuid:, effective_date: OMIT, active: OMIT, location_uuid: OMIT, employee_uuid: OMIT, version: OMIT, street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, additional_properties: nil) @uuid = uuid @effective_date = effective_date if effective_date != OMIT @active = active if active != OMIT @location_uuid = location_uuid if location_uuid != OMIT @employee_uuid = employee_uuid if employee_uuid != OMIT @version = version if version != 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 @additional_properties = additional_properties @_field_set = { "uuid": uuid, "effective_date": effective_date, "active": active, "location_uuid": location_uuid, "employee_uuid": employee_uuid, "version": version, "street_1": street1, "street_2": street2, "city": city, "state": state, "zip": zip, "country": country }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#active ⇒ Boolean (readonly)
Returns Signifies if this address is the active work address for the current date.
12 13 14 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 12 def active @active end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
34 35 36 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 34 def additional_properties @additional_properties end |
#city ⇒ String (readonly)
26 27 28 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 26 def city @city end |
#country ⇒ String (readonly)
32 33 34 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 32 def country @country end |
#effective_date ⇒ String (readonly)
Returns The date the employee began working at this location.
10 11 12 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 10 def effective_date @effective_date end |
#employee_uuid ⇒ String (readonly)
Returns UUID reference to the employee for this work address.
16 17 18 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 16 def employee_uuid @employee_uuid end |
#location_uuid ⇒ String (readonly)
Returns UUID reference to the company location for this work address.
14 15 16 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 14 def location_uuid @location_uuid end |
#state ⇒ String (readonly)
28 29 30 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 28 def state @state end |
#street1 ⇒ String (readonly)
22 23 24 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 22 def street1 @street1 end |
#street2 ⇒ String (readonly)
24 25 26 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 24 def street2 @street2 end |
#uuid ⇒ String (readonly)
Returns The unique identifier of this work address.
8 9 10 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 8 def uuid @uuid end |
#version ⇒ Object (readonly)
on how to use this field.
20 21 22 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 20 def version @version end |
#zip ⇒ String (readonly)
30 31 32 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 30 def zip @zip end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::EmployeeWorkAddress
79 80 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 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 79 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) uuid = parsed_json["uuid"] effective_date = parsed_json["effective_date"] active = parsed_json["active"] location_uuid = parsed_json["location_uuid"] employee_uuid = parsed_json["employee_uuid"] version = parsed_json["version"] 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"] new( uuid: uuid, effective_date: effective_date, active: active, location_uuid: location_uuid, employee_uuid: employee_uuid, version: version, street1: street1, street2: street2, city: city, state: state, zip: zip, country: country, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 122 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.effective_date&.is_a?(String) != false || raise("Passed value for field obj.effective_date 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.location_uuid&.is_a?(String) != false || raise("Passed value for field obj.location_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.version&.is_a?(String) != false || raise("Passed value for field obj.version 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.") end |
Instance Method Details
#to_json ⇒ String
113 114 115 |
# File 'lib/fern_gusto/types/employee_work_address.rb', line 113 def to_json @_field_set&.to_json end |