Class: Gusto::Employees::Employee
- Inherits:
-
Object
- Object
- Gusto::Employees::Employee
- Defined in:
- lib/fern_gusto/employees/types/employee.rb
Overview
The representation of an employee in Gusto.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#company_uuid ⇒ String
readonly
The UUID of the company the employee is employed by.
-
#current_employment_status ⇒ Object
readonly
months of the year or less.
-
#custom_fields ⇒ Object
readonly
custom_fields value set.
- #date_of_birth ⇒ String readonly
-
#department ⇒ String
readonly
The employee’s department in the company.
- #eligible_paid_time_off ⇒ Array<Gusto::Payrolls::PaidTimeOff> readonly
-
#email ⇒ Object
readonly
other purpose (e.g. marketing).
- #first_name ⇒ String readonly
- #garnishments ⇒ Array<Gusto::Garnishment> readonly
-
#has_ssn ⇒ Boolean
readonly
Indicates whether the employee has an SSN in Gusto.
- #jobs ⇒ Array<Gusto::JobsAndCompensations::Job> readonly
- #last_name ⇒ String readonly
-
#manager_uuid ⇒ String
readonly
The UUID of the employee’s manager.
- #middle_initial ⇒ String readonly
-
#onboarded ⇒ Boolean
readonly
Whether the employee has completed onboarding.
-
#onboarding_status ⇒ Gusto::Employees::EmployeeOnboardingStatus
readonly
The current onboarding status of the employee.
-
#payment_method ⇒ Gusto::Employees::EmployeePaymentMethod
readonly
The employee’s payment method.
- #phone ⇒ String readonly
- #preferred_first_name ⇒ String readonly
-
#ssn ⇒ String
readonly
Deprecated.
-
#terminated ⇒ Boolean
readonly
Whether the employee is terminated.
- #terminations ⇒ Array<Gusto::Terminations::Termination> readonly
-
#two_percent_shareholder ⇒ Object
readonly
only applies to companies with an S-Corp entity type.
-
#uuid ⇒ String
readonly
The UUID of the employee in Gusto.
-
#version ⇒ Object
readonly
on how to use this field.
-
#work_email ⇒ Object
readonly
other purpose (e.g. marketing).
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(uuid:, first_name:, middle_initial: OMIT, last_name:, email: OMIT, company_uuid: OMIT, manager_uuid: OMIT, version: OMIT, department: OMIT, terminated: OMIT, two_percent_shareholder: OMIT, onboarded: OMIT, onboarding_status: OMIT, jobs: OMIT, eligible_paid_time_off: OMIT, terminations: OMIT, garnishments: OMIT, custom_fields: OMIT, date_of_birth: OMIT, has_ssn: OMIT, ssn: OMIT, phone: OMIT, preferred_first_name: OMIT, payment_method: OMIT, work_email: OMIT, current_employment_status: OMIT, additional_properties: nil) ⇒ Gusto::Employees::Employee constructor
- #to_json ⇒ String
Constructor Details
#initialize(uuid:, first_name:, middle_initial: OMIT, last_name:, email: OMIT, company_uuid: OMIT, manager_uuid: OMIT, version: OMIT, department: OMIT, terminated: OMIT, two_percent_shareholder: OMIT, onboarded: OMIT, onboarding_status: OMIT, jobs: OMIT, eligible_paid_time_off: OMIT, terminations: OMIT, garnishments: OMIT, custom_fields: OMIT, date_of_birth: OMIT, has_ssn: OMIT, ssn: OMIT, phone: OMIT, preferred_first_name: OMIT, payment_method: OMIT, work_email: OMIT, current_employment_status: OMIT, additional_properties: nil) ⇒ Gusto::Employees::Employee
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 129 def initialize(uuid:, first_name:, middle_initial: OMIT, last_name:, email: OMIT, company_uuid: OMIT, manager_uuid: OMIT, version: OMIT, department: OMIT, terminated: OMIT, two_percent_shareholder: OMIT, onboarded: OMIT, onboarding_status: OMIT, jobs: OMIT, eligible_paid_time_off: OMIT, terminations: OMIT, garnishments: OMIT, custom_fields: OMIT, date_of_birth: OMIT, has_ssn: OMIT, ssn: OMIT, phone: OMIT, preferred_first_name: OMIT, payment_method: OMIT, work_email: OMIT, current_employment_status: OMIT, additional_properties: nil) @uuid = uuid @first_name = first_name @middle_initial = middle_initial if middle_initial != OMIT @last_name = last_name @email = email if email != OMIT @company_uuid = company_uuid if company_uuid != OMIT @manager_uuid = manager_uuid if manager_uuid != OMIT @version = version if version != OMIT @department = department if department != OMIT @terminated = terminated if terminated != OMIT @two_percent_shareholder = two_percent_shareholder if two_percent_shareholder != OMIT @onboarded = onboarded if onboarded != OMIT @onboarding_status = onboarding_status if onboarding_status != OMIT @jobs = jobs if jobs != OMIT @eligible_paid_time_off = eligible_paid_time_off if eligible_paid_time_off != OMIT @terminations = terminations if terminations != OMIT @garnishments = garnishments if garnishments != OMIT @custom_fields = custom_fields if custom_fields != OMIT @date_of_birth = date_of_birth if date_of_birth != OMIT @has_ssn = has_ssn if has_ssn != OMIT @ssn = ssn if ssn != OMIT @phone = phone if phone != OMIT @preferred_first_name = preferred_first_name if preferred_first_name != OMIT @payment_method = payment_method if payment_method != OMIT @work_email = work_email if work_email != OMIT @current_employment_status = current_employment_status if current_employment_status != OMIT @additional_properties = additional_properties @_field_set = { "uuid": uuid, "first_name": first_name, "middle_initial": middle_initial, "last_name": last_name, "email": email, "company_uuid": company_uuid, "manager_uuid": manager_uuid, "version": version, "department": department, "terminated": terminated, "two_percent_shareholder": two_percent_shareholder, "onboarded": onboarded, "onboarding_status": onboarding_status, "jobs": jobs, "eligible_paid_time_off": eligible_paid_time_off, "terminations": terminations, "garnishments": garnishments, "custom_fields": custom_fields, "date_of_birth": date_of_birth, "has_ssn": has_ssn, "ssn": ssn, "phone": phone, "preferred_first_name": preferred_first_name, "payment_method": payment_method, "work_email": work_email, "current_employment_status": current_employment_status }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
82 83 84 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 82 def additional_properties @additional_properties end |
#company_uuid ⇒ String (readonly)
Returns The UUID of the company the employee is employed by.
30 31 32 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 30 def company_uuid @company_uuid end |
#current_employment_status ⇒ Object (readonly)
months of the year or less.
80 81 82 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 80 def current_employment_status @current_employment_status end |
#custom_fields ⇒ Object (readonly)
custom_fields value set
58 59 60 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 58 def custom_fields @custom_fields end |
#date_of_birth ⇒ String (readonly)
60 61 62 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 60 def date_of_birth @date_of_birth end |
#department ⇒ String (readonly)
Returns The employee’s department in the company.
38 39 40 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 38 def department @department end |
#eligible_paid_time_off ⇒ Array<Gusto::Payrolls::PaidTimeOff> (readonly)
51 52 53 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 51 def eligible_paid_time_off @eligible_paid_time_off end |
#email ⇒ Object (readonly)
other purpose (e.g. marketing).
28 29 30 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 28 def email @email end |
#first_name ⇒ String (readonly)
20 21 22 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 20 def first_name @first_name end |
#garnishments ⇒ Array<Gusto::Garnishment> (readonly)
55 56 57 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 55 def garnishments @garnishments end |
#has_ssn ⇒ Boolean (readonly)
Returns Indicates whether the employee has an SSN in Gusto.
62 63 64 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 62 def has_ssn @has_ssn end |
#jobs ⇒ Array<Gusto::JobsAndCompensations::Job> (readonly)
49 50 51 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 49 def jobs @jobs end |
#last_name ⇒ String (readonly)
24 25 26 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 24 def last_name @last_name end |
#manager_uuid ⇒ String (readonly)
Returns The UUID of the employee’s manager.
32 33 34 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 32 def manager_uuid @manager_uuid end |
#middle_initial ⇒ String (readonly)
22 23 24 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 22 def middle_initial @middle_initial end |
#onboarded ⇒ Boolean (readonly)
Returns Whether the employee has completed onboarding.
45 46 47 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 45 def onboarded @onboarded end |
#onboarding_status ⇒ Gusto::Employees::EmployeeOnboardingStatus (readonly)
Returns The current onboarding status of the employee.
47 48 49 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 47 def onboarding_status @onboarding_status end |
#payment_method ⇒ Gusto::Employees::EmployeePaymentMethod (readonly)
Returns The employee’s payment method.
70 71 72 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 70 def payment_method @payment_method end |
#phone ⇒ String (readonly)
66 67 68 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 66 def phone @phone end |
#preferred_first_name ⇒ String (readonly)
68 69 70 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 68 def preferred_first_name @preferred_first_name end |
#ssn ⇒ String (readonly)
Returns Deprecated. This field always returns an empty string.
64 65 66 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 64 def ssn @ssn end |
#terminated ⇒ Boolean (readonly)
Returns Whether the employee is terminated.
40 41 42 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 40 def terminated @terminated end |
#terminations ⇒ Array<Gusto::Terminations::Termination> (readonly)
53 54 55 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 53 def terminations @terminations end |
#two_percent_shareholder ⇒ Object (readonly)
only applies to companies with an S-Corp entity type.
43 44 45 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 43 def two_percent_shareholder @two_percent_shareholder end |
#uuid ⇒ String (readonly)
Returns The UUID of the employee in Gusto.
18 19 20 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 18 def uuid @uuid end |
#version ⇒ Object (readonly)
on how to use this field.
36 37 38 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 36 def version @version end |
#work_email ⇒ Object (readonly)
other purpose (e.g. marketing).
74 75 76 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 74 def work_email @work_email end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::Employees::Employee
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 165 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) uuid = parsed_json["uuid"] first_name = parsed_json["first_name"] middle_initial = parsed_json["middle_initial"] last_name = parsed_json["last_name"] email = parsed_json["email"] company_uuid = parsed_json["company_uuid"] manager_uuid = parsed_json["manager_uuid"] version = parsed_json["version"] department = parsed_json["department"] terminated = parsed_json["terminated"] two_percent_shareholder = parsed_json["two_percent_shareholder"] onboarded = parsed_json["onboarded"] onboarding_status = parsed_json["onboarding_status"] jobs = parsed_json["jobs"]&.map do | item | item = item.to_json Gusto::JobsAndCompensations::Job.from_json(json_object: item) end eligible_paid_time_off = parsed_json["eligible_paid_time_off"]&.map do | item | item = item.to_json Gusto::Payrolls::PaidTimeOff.from_json(json_object: item) end terminations = parsed_json["terminations"]&.map do | item | item = item.to_json Gusto::Terminations::Termination.from_json(json_object: item) end garnishments = parsed_json["garnishments"]&.map do | item | item = item.to_json Gusto::Garnishment.from_json(json_object: item) end custom_fields = parsed_json["custom_fields"]&.map do | item | item = item.to_json Gusto::CustomFields::EmployeeCustomField.from_json(json_object: item) end date_of_birth = parsed_json["date_of_birth"] has_ssn = parsed_json["has_ssn"] ssn = parsed_json["ssn"] phone = parsed_json["phone"] preferred_first_name = parsed_json["preferred_first_name"] payment_method = parsed_json["payment_method"] work_email = parsed_json["work_email"] current_employment_status = parsed_json["current_employment_status"] new( uuid: uuid, first_name: first_name, middle_initial: middle_initial, last_name: last_name, email: email, company_uuid: company_uuid, manager_uuid: manager_uuid, version: version, department: department, terminated: terminated, two_percent_shareholder: two_percent_shareholder, onboarded: onboarded, onboarding_status: onboarding_status, jobs: jobs, eligible_paid_time_off: eligible_paid_time_off, terminations: terminations, garnishments: garnishments, custom_fields: custom_fields, date_of_birth: date_of_birth, has_ssn: has_ssn, ssn: ssn, phone: phone, preferred_first_name: preferred_first_name, payment_method: payment_method, work_email: work_email, current_employment_status: current_employment_status, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 251 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.first_name.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.") obj.middle_initial&.is_a?(String) != false || raise("Passed value for field obj.middle_initial is not the expected type, validation failed.") obj.last_name.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.") obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.") obj.company_uuid&.is_a?(String) != false || raise("Passed value for field obj.company_uuid is not the expected type, validation failed.") obj.manager_uuid&.is_a?(String) != false || raise("Passed value for field obj.manager_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.department&.is_a?(String) != false || raise("Passed value for field obj.department is not the expected type, validation failed.") obj.terminated&.is_a?(Boolean) != false || raise("Passed value for field obj.terminated is not the expected type, validation failed.") obj.two_percent_shareholder&.is_a?(Boolean) != false || raise("Passed value for field obj.two_percent_shareholder is not the expected type, validation failed.") obj.onboarded&.is_a?(Boolean) != false || raise("Passed value for field obj.onboarded is not the expected type, validation failed.") obj.onboarding_status&.is_a?(Gusto::Employees::EmployeeOnboardingStatus) != false || raise("Passed value for field obj.onboarding_status is not the expected type, validation failed.") obj.jobs&.is_a?(Array) != false || raise("Passed value for field obj.jobs is not the expected type, validation failed.") obj.eligible_paid_time_off&.is_a?(Array) != false || raise("Passed value for field obj.eligible_paid_time_off is not the expected type, validation failed.") obj.terminations&.is_a?(Array) != false || raise("Passed value for field obj.terminations is not the expected type, validation failed.") obj.garnishments&.is_a?(Array) != false || raise("Passed value for field obj.garnishments is not the expected type, validation failed.") obj.custom_fields&.is_a?(Array) != false || raise("Passed value for field obj.custom_fields is not the expected type, validation failed.") obj.date_of_birth&.is_a?(String) != false || raise("Passed value for field obj.date_of_birth is not the expected type, validation failed.") obj.has_ssn&.is_a?(Boolean) != false || raise("Passed value for field obj.has_ssn is not the expected type, validation failed.") obj.ssn&.is_a?(String) != false || raise("Passed value for field obj.ssn is not the expected type, validation failed.") obj.phone&.is_a?(String) != false || raise("Passed value for field obj.phone is not the expected type, validation failed.") obj.preferred_first_name&.is_a?(String) != false || raise("Passed value for field obj.preferred_first_name is not the expected type, validation failed.") obj.payment_method&.is_a?(Gusto::Employees::EmployeePaymentMethod) != false || raise("Passed value for field obj.payment_method is not the expected type, validation failed.") obj.work_email&.is_a?(String) != false || raise("Passed value for field obj.work_email is not the expected type, validation failed.") obj.current_employment_status&.is_a?(Gusto::Employees::EmployeeCurrentEmploymentStatus) != false || raise("Passed value for field obj.current_employment_status is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
242 243 244 |
# File 'lib/fern_gusto/employees/types/employee.rb', line 242 def to_json @_field_set&.to_json end |